Industrial robot energy consumption prediction model construction method and transfer learning method
By constructing an industrial robot energy consumption prediction model based on GRU network and masked self-attention mechanism, the problem of parameterless energy consumption prediction is solved, and accurate energy consumption prediction and rapid model transfer under different conditions are achieved, which is applicable to industrial robot energy consumption prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-10
- Publication Date
- 2026-03-03
AI Technical Summary
Existing technologies struggle to accurately predict the energy consumption of industrial robots without obtaining their electrical and dynamic parameters, and data-driven modeling methods suffer from insufficient data under different operating trajectories and working conditions.
An energy consumption prediction model for industrial robots is constructed. By utilizing a GRU network and a masked self-attention mechanism, the reference joint trajectory is converted into a variable time-scale scaled trajectory through a joint trajectory variable time-scale scaling module. Combined with data preprocessing, stacked GRU layers and regression output layer, the causal relationship between joint trajectory and energy consumption is extracted to achieve energy consumption prediction.
Without needing to obtain robot parameters, it can accurately predict the energy consumption of industrial robots under different time scaling patterns, and quickly adapt to the target domain through transfer learning methods, enabling the widespread application of the energy consumption prediction model.
Smart Images

Figure CN117226845B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial robot technology, specifically a method for constructing an energy consumption prediction model for industrial robots and a transfer learning method. Background Technology
[0002] Industrial robots are widely used in manufacturing to replace or assist employees in handling, assembling, and processing tasks. Due to their widespread distribution and low energy efficiency, the prediction of energy consumption under different operating trajectories and working conditions is receiving increasing attention. Calculating the energy consumption of industrial robots requires obtaining their robotic arm inertial parameters, such as mass, center of gravity, and inertia tensor; transmission system friction coefficients, such as Coulomb friction coefficient and viscous friction coefficient; and drive system electrical parameters, such as the armature inductance, back electromotive force constant, motor torque constant, rotor moment of inertia of permanent magnet synchronous motors, and the conduction and switching loss coefficients of rectifiers and inverters. However, due to the commercial nature of industrial robots, users often cannot obtain these parameters. Therefore, in engineering applications, the electrical and dynamic parameters required for calculating the energy consumption of industrial robots must be obtained through complex parameter experiments, which makes the calculation of industrial robot energy consumption labor-intensive and prone to significant errors.
[0003] Meanwhile, data-driven modeling methods have proven to be a feasible approach for revealing the quantitative relationship between industrial robot operating parameters and energy consumption. However, in manufacturing systems, there are many different types of robots, and modeling the energy consumption of each type requires significant hardware computing resources and data samples labeled with power or energy consumption. Furthermore, the energy consumption characteristics of industrial robots vary depending on their configuration and operating conditions, and sufficient data samples for certain trajectories may not be available in actual robot processing scenarios. These factors hinder the development and widespread adoption of data-driven industrial robot energy consumption prediction models. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a method for constructing an industrial robot energy consumption prediction model and a transfer learning method. The constructed industrial robot energy consumption prediction model can predict the energy consumption of the industrial robot under different time scaling rules of the joint trajectory under a preset task without obtaining any robot electrical and dynamic parameters. The transfer learning method can quickly deploy the constructed industrial robot energy consumption prediction model to other industrial robots and different working conditions.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] This invention first proposes a method for constructing an energy consumption prediction model for industrial robots, comprising the following steps:
[0007] Step 1: Based on the energy consumption components of industrial robots, construct power P and energy consumption E models:
[0008]
[0009] Where m represents the end load; q, and These represent the position, velocity, and acceleration vectors of the joint, respectively; t f Indicates the end time of the industrial robot's movement; This represents a nonlinear mapping relationship;
[0010] Step 2: Construct an industrial robot energy consumption prediction model by combining GRU network and masked self-attention mechanism; the industrial robot energy consumption prediction model includes a joint trajectory variable time scale scaling module, a data preprocessing layer, a stacked GRU layer, a masked self-attention mechanism, a fully connected layer, and a regression output layer;
[0011] Step 3: Use the joint trajectory time-scale scaling module to scale the reference joint trajectory q r (t r The uniform time interval sequence Δ is converted into a variable time-scaled trajectory q. s (t k ) and variable time-scaled time interval sequence h k Based on variable time-scale scaling of trajectory q s (t) and the time-scaled time interval sequence h k Convert the power P and energy consumption E model into a discrete form:
[0012]
[0013] Where, q s (t k ) represents a trajectory scaled by a variable time scale; Represents the trajectory q scaled by the variable time scale s (t k The first derivative with respect to time t, i.e., joint velocity; Represents the trajectory q scaled by the variable time scale s (t k The second derivative with respect to time t, i.e., joint acceleration; N is the number of control segments on the time axis;
[0014] Step 4: Using m and h k q s (t k ), and As input, the data preprocessing layer is used to standardize and normalize the input data sequence, and the data sequence is divided into training set, validation set and test set according to energy consumption level using a hierarchical sampling method;
[0015] Step 5: Input the training set into the stacked GRU layer, and use the stacked GRU layer combined with the masked self-attention mechanism to extract the power P and energy consumption E, the end load m, and the joint trajectory q. s (t k ),speed acceleration and variable time scale scaling time interval sequence h k The causal relationship between them;
[0016] Step 6: Based on the extracted causal relationships, the predicted values of power and energy consumption output from the regression output layer are used to obtain the power prediction sequence and energy consumption prediction sequence for the industrial robot.
[0017] Step 7: Based on the power prediction sequence and energy consumption prediction sequence of the industrial robot, determine whether the error between the predicted value of power P and the actual value of energy consumption E is less than the set threshold. If yes, proceed to step 9; otherwise, proceed to step 8.
[0018] Step 8: Update the weights of the stacked GRU layers using the backpropagation algorithm, and then execute Step 5;
[0019] Step 9: Verify and test the accuracy of energy consumption prediction using the validation set and test set respectively, and construct the energy consumption prediction model for industrial robots.
[0020] Furthermore, in step one, the method for constructing the power P and energy consumption E models is as follows:
[0021] Based on the energy consumption composition of industrial robots, the expression for power P is obtained as follows:
[0022] P = P mec +P dri +P oth
[0023] Among them, P mec P represents the mechanical power of an industrial robot. dri P represents the power lost in the drive system. oth Indicates the power of auxiliary components in an industrial robot;
[0024] Mechanical power P mec Represented as:
[0025]
[0026] in, This represents the joint torque vector of an n-link industrial robot driven by n permanent magnet synchronous motors. The equivalent frictional torque on the joints of an industrial robot can be described as relating q and The nonlinear function; P fri This refers to the frictional losses caused by the mechanical transmission components of the robot.
[0027] The joint moment vector τ is obtained using the Lagrange formula:
[0028]
[0029] in, Let be the joint space inertia matrix of the robot; Used to describe Coriolis torque and centrifugal torque; τ represents the gravitational torque; e This represents the equivalent external torque applied to the robot joints via the end effector, and:
[0030]
[0031] in, For τ e With m, q, and Nonlinear mapping relationship between them;
[0032] Drive system energy loss power P dri Represented as:
[0033] P dri =P Cu +P Fe +P inv +P bra +P rec +P DC
[0034] Among them, P inv and P rec P represents the switching loss and conduction loss of the inverter and rectifier, respectively; bra P represents the power consumed in the braking resistor. DC P represents the difference between the DC bus input power and the output power; Cu and P Fe These represent copper loss and iron loss respectively; and:
[0035]
[0036] in, Indicates copper loss and joint position q, velocity and acceleration Nonlinear mapping relationship between them; This represents the nonlinear mapping relationship between iron loss and joint torque τ; P represents the switching loss. inv The nonlinear mapping relationship between the joint torque τ and the joint torque τ; and P DC P bra and P rec Relative to joint position q and velocity and acceleration The nonlinear mapping relationship between them; τ represents the joint torque;
[0037] Auxiliary component power P oth If is a constant, then the power P is expressed as:
[0038]
[0039] The energy consumption E of an industrial robot is expressed as:
[0040]
[0041] Among them, t f This indicates the end time of the industrial robot's movement.
[0042] Furthermore, in step three, the reference joint trajectory q will be used. r (t r The uniform time interval sequence Δ is converted into a variable time-scaled trajectory q. s (t k ) and variable time-scaled time interval sequence h k The method steps are as follows:
[0043] 11) For the reference joint trajectory q r (t r On the time axis t r The numbers u0, u1, u2, ..., u are evenly distributed on the top. N-1 ,u N There are a total of N+1 control time points, and the time axis is divided into N control segments. Let Δ = u k+1 -u k If 0 ≤ k ≤ N, then Δ is a constant;
[0044] 12) For the control section [u k ,u k+1 Joint reference trajectory q on ] r (t r Dynamic scaling with varying time scales is performed, and the functional relationship before and after scaling is as follows:
[0045] t r =u(t),
[0046] q s (t)=q r (t r )=q r (u(t)),
[0047]
[0048] Where u is a variable time-scale scaling function; and , respectively, are the first and second derivatives of u with respect to t; t is the scaled joint trajectory execution time variable;
[0049] 13) Order In the control section [u k ,u k+1 If u and t are constants within the control segment [u], then u and t are constants within the control segment [u]. k ,u k+1 The state-space expression that satisfies time scaling is as follows:
[0050]
[0051] Among them, h k This represents a time interval sequence scaled by a variable time scale, and:
[0052] h k =t k+1 -t k
[0053] Among them, t k For u k The control time points obtained after scaling by a variable time scale.
[0054] Furthermore, the stacked GRU layers include at least two GRU neural network layers. The principle of the GRU neural network is as follows:
[0055] r t(k) =σ(W xr x t(k) +W hr h t(k-1) +b r )
[0056] z t(k) =σ(W xz x t(k) +W hz h t(k-1) +b z )
[0057]
[0058] Where, r t(k) and z t(k) They are tk The outputs of the update and reset gates at specific times; h t(k) and Is the GRU unit at time t k The output and candidate states; W xr and W hr W xz and W hz W xh and W hrh The weight coefficient matrices, b, correspond to the respective states and output information. r b z b h These are the corresponding bias terms; "e" represents matrix multiplication; "+" represents matrix addition; σ and tanh represent the sigmoid activation function and the hyperbolic tangent activation function, respectively.
[0059] Furthermore, the masked self-attention mechanism is used to improve the stacked GRU layers' attention to causal information {h}. t(k) The extraction capability of}, 0≤k≤N is based on the following principle:
[0060] Using three coefficient matrices (W) q W k W v ) will {h t(k)}, 0≤k≤N are encoded into three new matrices, called query Q, key K, and value V; the similarity between the query and key is calculated using a scaled dot product attention function, taking into account the causal relationship between power and the input vector sequence, at a computation time step t. k When focusing attention, a mask is used to set the attention weight of future information to zero; the expression is:
[0061]
[0062] Among them, Attention t(k) This indicates a masked self-attention mechanism; d K Let K represent the dimension of K.
[0063] Furthermore, in step seven, the mean square error (MSE) is used to characterize the power prediction error:
[0064]
[0065] Among them, P i (t k ) is the control time point t k The measured power value, For the predicted control time point t k The predicted power value; L is the number of trajectory samples with varying time scales; N is the number of control segments on the time axis;
[0066] Energy consumption prediction error is characterized by mean absolute percentage error (MAPE):
[0067]
[0068] Among them, E i Let i be the total energy consumption value of the i-th trajectory; This represents the total energy consumption of the i-th trajectory output by the convolutional neural network.
[0069] This invention also proposes a transfer learning method for an industrial robot energy consumption prediction model, comprising the following steps:
[0070] S1: An industrial robot energy consumption prediction model is constructed in the source domain using the method described above;
[0071] S2: Transfer the industrial robot energy consumption prediction model obtained from the source domain to the target domain. The stacked GRU layers include at least two GRU neural networks stacked sequentially, namely the first GRU neural network, the second GRU neural network, ..., the i-th GRU neural network, ..., the m-th GRU neural network. The parameters of the j-th GRU neural network before freezing remain unchanged. The parameters of the (j+1)-th to m-th GRU neural networks and the masked self-attention mechanism in the industrial robot energy consumption prediction model are fine-tuned using the dataset in the target domain to obtain the industrial robot energy consumption prediction transfer model, where 1≤i,j≤m-1,m≥2.
[0072] The beneficial effects of this invention are as follows:
[0073] The method for constructing an industrial robot energy consumption prediction model of the present invention first analyzes the energy consumption composition of the industrial robot to construct a power P and energy consumption E model, revealing the relationship between power P and energy consumption E and joint position q and velocity. and acceleration The nonlinear mapping relationship between them is then established; subsequently, an industrial robot energy consumption prediction model is constructed to solve this nonlinear mapping relationship. Specifically, the reference joint trajectory q is scaled using a joint trajectory variable time-scale scaling module. r (t r The uniform time interval sequence Δ is converted into a variable time-scaled trajectory q. s (t k ) and variable time-scaled time interval sequence h k This transforms the power P and energy consumption E model into a discrete form; thus, with the end load m and joint position q... s (t k ), joint velocity Joint acceleration and the time interval sequence h with variable time scale kAs input, power P and energy consumption E are extracted using stacked GRU layers combined with a masked self-attention mechanism, along with end-load m and joint trajectory q. s (t k ),speed acceleration and variable time scale scaling time interval sequence h k The causal relationship between them can be used to obtain the predicted values of industrial robot power P and energy consumption E; that is, the industrial robot energy consumption prediction model construction method of the present invention can complete the energy consumption prediction of industrial robot joint trajectory under different time scaling laws under preset tasks without obtaining any robot electrical and dynamic parameters.
[0074] The present invention provides a transfer learning method for industrial robot energy consumption prediction models. By transferring the industrial robot energy consumption prediction model constructed in the source domain to the target domain, and considering the configuration and working conditions of the industrial robot in the target domain, the parameters of the bottom-level GRU neural network are frozen. Only a small amount of data in the target domain is needed to fine-tune the parameters of the upper-level GRU neural network and the masked self-attention mechanism to adapt to the prediction requirements of power P and energy consumption E in the target domain. This enables the rapid deployment of industrial robot energy consumption prediction models, facilitating their large-scale promotion. Attached Figure Description
[0075] To make the objectives, technical solutions, and beneficial effects of this invention clearer, the following figures are provided for illustration:
[0076] Figure 1 This is a structural diagram of an industrial robot energy consumption prediction model.
[0077] Figure 2 A diagram showing the non-linear mapping between the reference timeframe and the scaled timeframe;
[0078] Figure 3 Here is a diagram of the GRU neural network structure;
[0079] Figure 4 This is a schematic diagram of the masked self-attention mechanism.
[0080] Figure 5 This is a schematic diagram of the transfer learning method for predicting energy consumption of industrial robots according to the present invention. Detailed Implementation
[0081] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0082] The method for constructing an industrial robot energy consumption prediction model in this embodiment includes the following steps.
[0083] Step 1: Based on the energy consumption composition of industrial robots, construct power P and energy consumption E models.
[0084] Specifically, the method for constructing the power P and energy consumption E models is as follows:
[0085] Based on the energy consumption composition of industrial robots, the expression for power P is obtained as follows:
[0086] P = P mec +P dri +P oth
[0087] Among them, P mec P represents the mechanical power of an industrial robot. dri P represents the power lost in the drive system, such as energy losses caused by the motor, inverter, braking resistor, and rectifier; oth This indicates the power consumption of auxiliary components of industrial robots, such as the control system, control cabinet PC, control panel, and cooling fan. oth Power can be divided into load-independent power and load-dependent power. Since the load-dependent power value is small, P is ignored in this embodiment. oth The portion of power related to medium load. Therefore, P oth It can be approximated as the power in standby mode, and can be considered as a constant.
[0088] Ignoring motor transmission efficiency, mechanical power P mec Represented as:
[0089]
[0090] in, This represents the joint torque vector of an n-link industrial robot driven by n permanent magnet synchronous motors. The equivalent frictional torque on the joints of an industrial robot, mainly composed of Coulomb friction and viscous friction, can be described as relating q and Nonlinear functions; and These represent the position, velocity, and acceleration vectors of the joint, respectively; P fri This refers to the frictional losses caused by the mechanical transmission components of the robot.
[0091] Assuming the dynamic parameters are known, the joint moment vector τ is obtained using the Lagrange formula:
[0092]
[0093] in, Let be the joint space inertia matrix of the robot; Used to describe Coriolis torque and centrifugal torque; τ represents the gravitational torque; e The equivalent external torque applied to the robot joint by the end effector can be obtained from the force Jacobian matrix and the forces and torques applied to the end effector in the task space. For industrial robot pick-and-place scenarios, the machining force between the end effector and the workpiece is ignored, and only the load on the end effector is considered. Since this load is only related to the joint position, velocity, acceleration, and end effector mass, the equivalent external torque τ... e It can be represented as:
[0094]
[0095] in, For τ e With m, q, and The nonlinear mapping relationship between them.
[0096] The drive system of an industrial robot consists of a permanent magnet synchronous motor, an inverter, a DC bus, a braking resistor, and a rectifier. Therefore, P dri The main losses include copper and iron losses in the permanent magnet synchronous motor, regenerative braking losses in the braking resistor, and switching and conduction losses in the inverter and rectifier. Therefore, the energy loss power P of the drive system is... dri Represented as:
[0097] P dri =P Cu +P Fe +P inv +P bra +P rec +P DC
[0098] Among them, P inv and P rec P represents the switching loss and conduction loss of the inverter and rectifier, respectively; bra P represents the power consumed in the braking resistor. DC P represents the difference between the DC bus input power and the output power; Cu and P Fe These represent copper loss and iron loss, respectively.
[0099] Since copper losses and iron losses are related to motor torque and motor speed, considering the linear relationship between joint torque, joint speed, motor torque, and motor speed, copper losses and iron losses can be expressed as:
[0100]
[0101] Among them, among them, Indicates copper loss and joint position q, velocity and acceleration Nonlinear mapping relationship between them; This represents the nonlinear mapping relationship between iron loss and joint torque τ; τ represents the joint torque.
[0102] Because of P inv The conduction losses and switching losses in the joint are linearly related to the square and absolute value of the joint torque, respectively. Therefore, P inv The nonlinear mapping between τ and τ can be expressed as:
[0103]
[0104] in, P represents the switching loss. inv The nonlinear mapping relationship between the joint torque τ and the joint torque τ.
[0105] Because industrial robot drive systems allow permanent magnet synchronous motors to exchange regenerative energy via a DC bus, the power P of the DC bus, braking resistor, and rectifier in the industrial robot drive system... DC P bra P rec The causal relationship between the robot's joint position, velocity, and acceleration can be expressed as:
[0106]
[0107] in, and P DC P bra and P rec Relative to joint position q and velocity and acceleration The nonlinear mapping relationship between them.
[0108] Based on the above formulas, it can be seen that the total power P of an industrial robot is related not only to the position, velocity, and acceleration of the joints at the current moment, but also to the motion state at previous moments. Power P is expressed as:
[0109]
[0110] The energy consumption E of an industrial robot is expressed as:
[0111]
[0112] Among them, t f Indicates the end time of the industrial robot's motion; m represents the end-effector load; q, and These represent the position, velocity, and acceleration vectors of the joint, respectively. This represents a nonlinear mapping relationship.
[0113] Step 2: Construct an industrial robot energy consumption prediction model by combining GRU networks and masked self-attention mechanisms. For example... Figure 1 As shown, the industrial robot energy consumption prediction model includes a joint trajectory variable time scale scaling module, a data preprocessing layer, a stacked GRU layer, a masked self-attention mechanism, a fully connected layer, and a regression output layer.
[0114] Step 3: Use the joint trajectory time-scale scaling module to scale the reference joint trajectory q r (t r The uniform time interval sequence Δ is converted into a variable time-scaled trajectory q. s (t k ) and variable time-scaled time interval sequence h k .
[0115] Reference joint trajectory q r (t r The uniform time interval sequence Δ is converted into a variable time-scaled trajectory q. s (t k ) and variable time-scaled time interval sequence h k The method steps are as follows:
[0116] 11) The task of an industrial robot is to follow a pre-planned reference joint trajectory q r (t r The trajectory is executed to avoid obstacles and unusual configurations, and the target robot's preset joint trajectory function is obtained as a reference trajectory q. r (t r ), where t r The execution time variable for the preset joint trajectory is defined. Energy saving in industrial robot trajectories can be achieved by scaling the reference trajectory at different rates; therefore, for the reference joint trajectory q... r (t r On the time axis t r The numbers u0, u1, u2, ..., u are evenly distributed on the top. N-1 ,u N There are a total of N+1 control time points, and the time axis is divided into N control segments. Let Δ = u k+1 -u k If 0 ≤ k ≤ N, then Δ is a constant.
[0117] 12) For the control section [u k ,u k+1 Joint reference trajectory q on ] r (t r Dynamic scaling with varying time scales is performed, and the functional relationship before and after scaling is as follows:
[0118] t r =u(t),
[0119] q s (t)=q r (t r )=q r (u(t)),
[0120]
[0121] Where u is a variable time-scale scaling function; and , respectively, are the first and second derivatives of u with respect to t; t is the scaled joint trajectory execution time variable. Time variable t before and after scaling. r The mapping relationship with t is as follows: Figure 2 As shown.
[0122] 13) Order In the control section [u k ,u k+1 If u and t are constants within the control segment [u], then u and t are constants within the control segment [u]. k ,u k+1 The state-space expression that satisfies time scaling is as follows:
[0123]
[0124] Among them, h k This represents a time interval sequence scaled by a variable time scale, and:
[0125] h k =t k+1 -t k
[0126] Among them, t k For u k The control time points obtained after scaling by a variable time scale.
[0127] By setting The sequence, i.e., u0, u1, u2, ..., u N-1 ,u N There are a total of N+1 control time points. This value enables dynamic scaling of the reference joint trajectory on each control segment across different time scales. Based on the target robot's maximum allowable execution speed, acceleration, and other conditions, the following settings are configured. The range of values is randomly generated to form a sufficient number of groups. The value of the sequence, and for The sequence is filtered, and the corresponding variable time-scaled trajectory q is obtained. s(t). Since there is a causal relationship between the robot's total power P, total energy consumption E and the robot's joint motion variables (joint position, velocity, acceleration), the trajectory q can be scaled based on a variable time scale. s (t) and the time-scaled time interval sequence h k Convert the power P and energy consumption E model into a discrete form:
[0128]
[0129] Where, q s (t k ) represents a trajectory scaled by a variable time scale; Represents the trajectory q scaled by the variable time scale s (t k The first derivative with respect to time t, i.e., joint velocity; Represents the trajectory q scaled by the variable time scale s (t k The second derivative with respect to time t is the joint acceleration; N is the number of control segments on the time axis.
[0130] Step 4: Since the DH parameters, dynamic parameters, and electrical parameters of the drive system of the industrial robot remain unchanged after the robot is given a parameter, the task parameters of the industrial robot, i.e., the reference trajectory vector q... r (t k ), The terminal load m and the time scale function u vary with the task; therefore, in this embodiment, m and h are used as the basis for the calculation. k q s (t k ), and As input, the data preprocessing layer is used to standardize and normalize the input data sequence, and the data sequence is divided into training set, validation set and test set according to energy consumption level using a hierarchical sampling method.
[0131] Step 5: Input the training set into the stacked GRU layer, and use the stacked GRU layer combined with the masked self-attention mechanism to extract the power P and energy consumption E, the end load m, and the joint trajectory q. s (t k ),speed acceleration and variable time scale scaling time interval sequence h k The causal relationship between them.
[0132] In this embodiment, the stacked GRU layers include at least two layers of GRU neural networks. For example... Figure 3 As shown, the principle of the GRU neural network is as follows:
[0133] r t(k)=σ(W xr x t(k) +W hr h t(k-1) +b r )
[0134] z t(k) =σ(W xz x t(k) +W hz h t(k-1) +b z )
[0135]
[0136] Where, r t(k) and z t(k) They are t k The outputs of the update and reset gates at specific times; h t(k) and Is the GRU unit at time t k The output and candidate states; W xr and W hr W xz and W hz W xh and W hrh The weight coefficient matrices, b, correspond to the respective states and output information. r b z b h These represent the corresponding bias terms; "e" indicates matrix multiplication; "+" indicates matrix addition; σ and tanh represent the sigmoid activation function and the hyperbolic tangent activation function, respectively, defined as:
[0137]
[0138] like Figure 4 As shown, the masked self-attention mechanism is used to improve the attention of stacked GRU layers to causal information {h}. t(k) The extraction capability of}, 0≤k≤N is based on the principle of using three coefficient matrices (W q W k W v ) will {h t(k)}, 0≤k≤N are encoded into three new matrices, called query Q, key K, and value V; the similarity between the query and key is calculated using a scaled dot product attention function, taking into account the causal relationship between power and the input vector sequence, at a computation time step t. k When performing attention, a mask is used to set the attention weights for future information to zero. This ensures that the model relies only on current and previous information to generate predictions, preserving causal constraints; the expression for the masked self-attention mechanism is:
[0139]
[0140] Among them, Attention t(k) This indicates a masked self-attention mechanism; d K Let K represent the dimension of K.
[0141] Step 6: Based on the extracted causal relationships, the predicted values of the output power P and energy consumption E of the regression output layer are used to obtain the power prediction sequence and energy consumption prediction sequence of the industrial robot.
[0142] Step 7: Based on the power prediction sequence and energy consumption prediction sequence of the industrial robot, determine whether the error between the predicted value of power P and the actual value of energy consumption E is less than the set threshold. If yes, proceed to step 9; otherwise, proceed to step 8.
[0143] In this embodiment, the mean square error (MSE) is used to characterize the power prediction error:
[0144]
[0145] Among them, P i (t k ) is the control time point t k The measured power value, For the predicted control time point t k The predicted power value; L is the number of trajectory samples with varying time scales; N is the number of control segments on the time axis.
[0146] In this embodiment, the mean absolute percentage error (MAPE) is used to characterize the energy consumption prediction error:
[0147]
[0148] Among them, E i Let i be the total energy consumption value of the i-th trajectory; This represents the total energy consumption of the i-th trajectory output by the convolutional neural network.
[0149] Step 8: Update the weights of the stacked GRU layers using the backpropagation algorithm, and then execute Step 5. This embodiment uses the Glorot initializer to initialize the weights of the industrial robot energy consumption prediction model.
[0150] Step 9: Verify and test the accuracy of energy consumption prediction using the validation set and test set respectively, and construct the energy consumption prediction model for industrial robots.
[0151] This embodiment also proposes a transfer learning method for an industrial robot energy consumption prediction model, including the following steps:
[0152] S1: An industrial robot energy consumption prediction model is constructed in the source domain using the method described above in this embodiment.
[0153] S2: Transfer the industrial robot energy consumption prediction model obtained from the source domain to the target domain. The stacked GRU layers include at least two GRU neural networks stacked sequentially, namely the first GRU neural network, the second GRU neural network, ..., the i-th GRU neural network, ..., the m-th GRU neural network. The parameters of the j-th GRU neural network before freezing remain unchanged. The parameters of the (j+1)-th to m-th GRU neural networks and the masked self-attention mechanism in the industrial robot energy consumption prediction model are fine-tuned using the dataset in the target domain to obtain the industrial robot energy consumption prediction transfer model, where 1≤i,j≤m-1,m≥2.
[0154] A time-scaled trajectory q is run on the robot in both the source and target domains. s (t), and measured the actual joint position, velocity, acceleration, and power data; a transfer learning algorithm based on pre-training-fine-tuning was used to construct the energy consumption model of the industrial robot in the target domain, the specific process of which is as follows: Figure 5 As shown on the right, model-based transfer learning typically consists of two stages: pre-training and fine-tuning. The pre-training stage involves training on large-scale labeled data, i.e., training on source domain data, to obtain a standard industrial robot energy consumption prediction model. The fine-tuning stage involves fine-tuning the pre-trained deep learning model on the target domain using a small amount of labeled data for a specific task. The target domain model parameters are usually initialized to the pre-trained model parameters. Then, some or all of the network parameters in the first few layers are frozen, as this part of the network mainly performs general feature extraction for the prediction task. Simultaneously, the parameters of the remaining layers are fine-tuned.
[0155] in accordance with Figure 5 The transfer learning method shown designs and executes a pre-training-fine-tuning transfer learning scheme on source and target domain data, which can effectively realize the construction of energy consumption prediction models for different types of industrial robots, different trajectories, and different load masses in the case of few samples in the target domain.
[0156] The above-described embodiments are merely preferred embodiments provided to fully illustrate the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the present invention are all within the scope of protection of the present invention. The scope of protection of the present invention is defined by the claims.
Claims
1. An industrial robot energy consumption prediction model construction method, characterized by: Comprising the following steps: Step one: Based on the energy consumption composition of industrial robots, build power and energy consumption models: wherein, denotes an end load; , and denote the position, velocity and acceleration vectors of a joint, respectively; denotes the end time of the industrial robot motion; denotes a nonlinear mapping relationship; Step two: an industrial robot energy consumption prediction model is constructed by combining a GRU network and a mask self-attention mechanism; the industrial robot energy consumption prediction model comprises a joint trajectory variable time scale scaling module, a data preprocessing layer, a stacked GRU layer, a mask self-attention mechanism, a full connection layer, and a regression output layer; Step three: convert the reference joint trajectory and uniform time interval sequence into a variable time scale scaled trajectory and variable time scale scaled time interval sequence based on the variable time scale scaled trajectory and variable time scale scaled time interval sequence convert the power and energy consumption model into a discrete form: wherein, denotes a variable time scale scaled trajectory the first derivative of time , i.e. joint velocity; denotes a variable time scale scaled trajectory the second derivative of time , i.e. joint acceleration; is the number of control segments on the time axis; Step four: taking , , , and as input, the input data sequence is standardized, normalized by using the data preprocessing layer, and the data sequence is divided into training set, validation set and test set in a hierarchical sampling manner according to the energy consumption level; Step five: input the training set into stacked GRU layers to extract power with stacked GRU layers combined with masked self-attention mechanism and energy consumption and end effector load , joint trajectories , velocities , accelerations , and variable time-scale scaled time interval sequences ; Step six: based on the extracted causal relationship, the predicted values of power and energy consumption are output by using the regression output layer, and then the industrial robot power prediction sequence and the energy consumption prediction sequence are obtained; Step seven: based on the power prediction sequence and the energy consumption prediction sequence, respectively, determine whether the errors between the predicted values and the true values of the power and the energy consumption are both less than a set threshold value: if yes, execute step nine; if no, execute step eight. Step eight: the weights of the stacked GRU layer are updated by using the back propagation algorithm, and step five is executed; Step nine: the prediction accuracy of energy consumption is verified and tested by using the validation set and the test set respectively, and the industrial robot energy consumption prediction model is constructed.
2. The industrial robot energy consumption prediction model construction method according to claim 1, characterized in that: In step one, power and energy consumption The model construction method is: Based on the energy consumption composition of industrial robots, the expression of power is obtained as follows: wherein, represents the mechanical power of the industrial robot; represents the power of energy losses in the drive system; represents the auxiliary component power of the industrial robot; Mechanical power is represented as: wherein represents the friction torque of the gear train of the robot; a robot driven by a permanent magnet synchronous motor; joint torque vector of a link series industrial robot; represents the equivalent friction torque on the joints of the industrial robot, which can be described as a nonlinear function of and represents the friction loss caused by the mechanical transmission part of the robot; Joint torque vector Obtained by Lagrange's formula: wherein, is the joint space inertia matrix of the robot; is used to describe the Coriolis and centrifugal torques; denotes the gravitational torque; denotes the equivalent external torques applied to the robot joints by the end effector, and: wherein, is with , , and a non-linear mapping relationship between Drive system energy loss power is represented as: wherein, and represent the switching and conduction losses of the inverter and rectifier, respectively; represents the power dissipated in the braking resistor; represents the difference between the input and output power of the DC bus; and represent the copper and iron losses, respectively; and: wherein, represents a nonlinear mapping relationship between copper loss and joint position , velocity and acceleration ; represents a matrix multiplication operation; represents a nonlinear mapping relationship between iron loss and joint torque ; represents a nonlinear mapping relationship between switching loss and joint torque ; , and respectively represent , and respectively a nonlinear mapping relationship between joint position , velocity and acceleration ; represents joint torque; Auxiliary component power is constant, then the power is expressed as: Energy consumption of industrial robots is represented as: wherein, denotes the end time of the motion of the industrial robot.
3. The industrial robot energy consumption prediction model construction method of claim 1, characterized in that: In step three, the joint trajectory and the uniform time interval sequence is converted into a variable time scale scaled trajectory and a variable time scale scaled time interval sequence The method steps are: 11) to the reference joint trajectory on the time axis are evenly set N+1 control time points, and the time axis is evenly divided into N control sections, let , then is a constant; 12) on the control segment joint reference trajectory time-scale dynamic scaling, the function relationship before and after scaling is: wherein, is a variable time scale scaling function; and are respectively first and second derivatives of is a scaled joint trajectory execution time variable; 13) Let be constant in the control segment , then , satisfies the time-scaled state space expression on the control segment : wherein denotes a variable time-scale scaling time interval sequence, and: wherein is the control time point after the variable time scale scaling.
4. The industrial robot energy consumption prediction model construction method of claim 1, characterized in that: The stacked GRU layer comprises at least two GRU neural networks, and the principle of the GRU neural network is as follows: wherein, and are respectively the outputs of the update gate and the reset gate at the time instant t; and are the output and the candidate state of the GRU unit at time t; and , and , and correspond respectively to the weight coefficient matrices of the respective state and output information, , , are respectively the respective bias terms; denotes a matrix multiplication operation; + denotes a matrix addition operation; and tanh denote respectively a sigmoid activation function and a hyperbolic tangent activation function. 5. The industrial robot energy consumption prediction model construction method according to claim 4, characterized in that: Masked self-attention mechanism for boosting stacked GRU layers' ability to extract causal information The principle is that: Using three coefficient matrices Will encode into three new matrices, called query , key and value ; The similarity of the query and the key is calculated using a scaled dot-product attention function, taking into account the causal relationship between the power and the input vector sequence, in calculating the attention at the time step of the attention, the attention weight of the future information is set to zero using a mask; the expression is: wherein, denotes a masked self-attention mechanism; denotes dimension of 6. The industrial robot energy consumption prediction model construction method according to claim 1, characterized in that: In step seven, the mean square error MSE Characterizing the power prediction error: wherein, is the measured power value at the control time point , is the predicted power value at the control time point ; L is the number of variable time scale trajectory samples; is the number of control segments on the time axis; The energy consumption prediction error is represented by the mean absolute percentage error MAPE: wherein, is the total energy consumption value of the i-th trajectory; is the total energy consumption value of the i-th trajectory; is the total energy consumption value of the i-th trajectory output by the convolutional neural network. is the total energy consumption value of the i-th trajectory output by the convolutional neural network.
7. An industrial robot energy consumption prediction model transfer learning method, characterized by: Comprising the following steps: S1: an industrial robot energy consumption prediction model is constructed by using the method in any one of claims 1-6 in the source domain; S2: migrate the industrial robot energy consumption prediction model constructed from the source domain to the target domain, the stacked GRU layer includes at least two layers of GRU neural networks stacked in turn, respectively, the first layer of GRU neural network, the second layer of GRU neural network, …, the i layer of GRU neural network, …, the m layer of GRU neural network; the parameters of the first j layers of GRU neural networks are unchanged, the parameters of the j+1 layer of GRU neural network to the m layer of GRU neural network and the mask self-attention mechanism in the industrial robot energy consumption prediction model are fine-tuned by using the data set in the target domain, and an industrial robot energy consumption prediction migration model is obtained, , .
Citation Information
Patent Citations
Industrial robot energy consumption prediction method
CN113752300A
Robot energy consumption model construction method and parallel bidirectional dynamic energy consumption optimization method
CN115582834A