A lithium battery soc prediction method and system for intelligent robots
Patent Information
- Application Number
- CN202611467479.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-21
- Publication Date
- 2026-10-27
AI Technical Summary
[0004]针对上述存在的技术不足,本发明的目的是提供一种用于智能机器人的锂电池SOC预测方法及系统,解决现有智能机器人锂电池SOC估算在动态变负载工况下精度低、鲁棒性差的问题
[0015]本发明的有益效果在于:将机器人关节电机驱动指令引入SOC估算流程,通过占空比变化率与负载电流上升沿斜率联合切分工况片段,使分段结果贴合机器人实际运动模态。
Smart Images

Figure CN122983705A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of lithium battery SOC estimation technology, and specifically to a lithium battery SOC prediction method and system for intelligent robots. Background Technology
[0002] Intelligent robots (such as inspection, handling, and humanoid robots) frequently start and stop their joint motors, accelerate and decelerate, and perform downhill regenerative braking during movement. This causes the battery load current to exhibit large fluctuations and bidirectional changes, far exceeding the complexity of stable operating conditions such as electric vehicles.
[0003] Among existing SOC estimation methods, the ampere-hour integration method has significant cumulative errors under drastic current fluctuations and relies on accurate initial SOC; the open-circuit voltage method requires the battery to be idle for a long time, which cannot meet the needs of continuous robot operation; although methods based on Kalman filtering or single neural networks have some improvement, they do not make full use of the high-level operating condition information of joint motor drive commands that can be obtained by the robot itself, nor do they specifically handle the distortion characteristics of the voltage platform, resulting in large estimation deviations under the robot's unique "heavy load climbing - regenerative braking" alternating operating conditions, affecting the judgment of battery life and operational safety. Summary of the Invention
[0004] To address the aforementioned technical shortcomings, the purpose of this invention is to provide a lithium battery SOC prediction method and system for intelligent robots, solving the problems of low accuracy and poor robustness in existing intelligent robot lithium battery SOC estimation under dynamic load conditions.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for predicting the state of charge (SOC) of a lithium battery for an intelligent robot, comprising: Step S1: Collect the battery terminal voltage, load current and joint motor drive commands during the movement of the intelligent robot. Based on the duty cycle change rate of the joint motor drive commands and the rising edge slope of the load current, the sampling window is divided into load conditions to obtain several continuous working condition segments and the working condition labels corresponding to each segment. Step S2: Perform sliding differential processing on the terminal voltage and load current in each operating condition segment, extract the peak position and half width at half maximum of the incremental capacity curve as voltage distortion features, and combine the voltage distortion features with the direction sign of the load current to generate the residual correction vector of the operating condition segment. Step S3: Combine the terminal voltage, load current, operating condition label, and residual correction vector of each operating condition segment into a labeled time-series input sample according to the time axis; Step S4: Input the time-series input samples into the pre-trained bidirectional gated recurrent unit network to obtain the predicted SOC value of the lithium battery at the current time.
[0006] Preferably, in one possible implementation of the first aspect, in step S1, the length of the sampling window and the sliding step size are set according to the update cycle of the joint motor drive command; The duty cycle change rate is obtained by calculating the first-order difference of the duty cycle sequence of the joint motor drive command within each sampling window. Calculate the first-order difference of the load current sequence and mark the continuous segments with positive difference values as rising edges. Take the maximum value of the first-order difference of the load current within the rising edge segment as the rising edge slope. Compare the duty cycle change rate and the rising edge slope with the first preset limit and the second preset limit, respectively. When the duty cycle change rate exceeds the first preset limit, the sampling time at this time is taken as the first segment cut point; when the rising edge slope exceeds the second preset limit, the sampling time corresponding to the maximum value of the first-order differential load current in the rising edge segment at this time is taken as the second segment cut point. The sampling window is divided into several continuous working condition segments based on all segmentation points, and each working condition segment is assigned a working condition label.
[0007] Preferably, in one possible implementation of the first aspect, the first preset limit is determined by the linear mapping relationship between the rated speed and duty cycle of the joint motor; the second preset limit is determined by the calibration curve of the stall current and the rate of increase of the load current of the joint motor. A mapping table is established between the operating condition label and the absolute value range of the duty cycle of the joint motor drive command and the average value range of the load current. For each continuous operating condition segment, the operating condition label is obtained by looking up a table based on the median of the absolute value of the duty cycle and the arithmetic mean of the load current. When the distance between the median absolute value of the duty cycle and any boundary of the interval is less than a preset threshold, the deviation between the cumulative amount of the duty cycle change rate within the working condition segment and the historical average cumulative amount of the two candidate labels on both sides of the boundary is used as the criterion, and the one with the smaller deviation is taken as the final working condition label for the working condition segment.
[0008] Preferably, in one possible implementation of the first aspect, in step S2, a sliding differential processing is applied to the terminal voltage and load current in each operating condition segment, and the width of the sliding differential window is determined according to the number of sampling points in the operating condition segment, and is an odd number not less than 3. The incremental charge is obtained by accumulating the product of the load current and the sampling interval within the sliding differential window. The absolute value of the difference between the first and last values of the terminal voltage within the same window is taken as the incremental voltage. The ratio of the absolute value of the incremental charge to the incremental voltage is taken as the incremental capacity curve value at the center point of the sliding differential window. The complete incremental capacity curve is obtained by traversing the entire operating condition segment. Local maxima detection is performed on the incremental capacity curve. The terminal voltage value corresponding to each local maximum is recorded as the peak position. A horizontal line is drawn from the half-height position of the peak where the local maximum is located, that is, half of the peak amplitude. The line intersects the curve at two points on the left and right sides of the peak. The absolute value of the terminal voltage difference between the two points is recorded as the half-height width. The peak position and the half-height width are used as the voltage distortion characteristics of the operating condition segment.
[0009] Preferably, in one possible implementation of the first aspect, the terminal voltage and load current are subjected to Savitzky-Golay smoothing filtering before the sliding differential processing, the filter window length is the same as the sliding differential window length and is an odd number, and the filter order is fixed at 2. Take the local maximum value with the largest amplitude, and use its peak position and half width at half maximum (FWHM) as the voltage distortion characteristics of this operating condition segment; The sign of the load current direction is determined by the sign of the algebraic sum of the load currents within that operating condition segment; a positive value indicates the discharge direction, and a negative value indicates the regenerative braking direction. The peak position, half-width at half-maximum, and direction sign are arranged in a fixed order to form a three-dimensional vector. The amplitude of the second largest local maximum other than the local maximum with the largest amplitude is further taken as the fourth dimension component to form a four-dimensional vector. If there is no second largest local maximum, the fourth dimension component is set to zero. Based on the mean and standard deviation of each component obtained from offline calibration, the residual correction vector for this working condition segment is obtained by standardizing the four-dimensional vector component by component.
[0010] Preferably, in one possible implementation of the first aspect, in step S3, the terminal voltage sequence, load current sequence, integer encoding of the operating condition label, and residual correction vector within each operating condition segment are aligned according to the sampling time, and the four data at the same time are stacked along the feature dimension to form a time step feature vector. Arrange the feature vectors of all time steps of the working condition segment into a two-dimensional matrix in chronological order. The number of rows in the matrix is the number of time steps of the working condition segment, and the number of columns is the feature dimension. Concatenate the two-dimensional matrices of all working condition segments along the time axis to form a two-dimensional time series input sample. During splicing, an overlap window is retained at the boundary between adjacent segments. The length of the overlap window is obtained by linear mapping the absolute value of the difference between the duty cycle change rate at the end of the previous segment and the duty cycle change rate at the beginning of the next segment.
[0011] Preferably, in one possible implementation of the first aspect, the terminal voltage and load current at each sampling moment within the overlapping window are taken as the weighted average of the corresponding moments of the two segments. The weight is inversely distributed according to the difference in duty cycle change rate between the end of the previous segment and the beginning of the next segment at the junction point, and the sum of the weight of the previous segment and the weight of the next segment at the junction point is 1. The operating condition labels within the overlapping window are the same as those in the next segment, and the residual correction vector is also the same as that in the next segment. After concatenation, the time-series input samples are normalized to minimum and maximum values channel by channel along the feature dimension; the upper and lower limits of the terminal voltage, load current, and integer encoding channels of the operating condition label, as well as the residual correction vector components, are all set based on the statistical extreme values of the channels in the training set, linearly mapping the data to... Interval.
[0012] Preferably, in one possible implementation of the first aspect, in step S4, the bidirectional gated recurrent unit network includes a forward GRU layer and a backward GRU layer. The forward GRU layer reads the temporal input samples in forward time order, and the backward GRU layer reads the temporal input samples in reverse time order. At each time step, the forward GRU layer outputs the forward hidden state, and the backward GRU layer outputs the backward hidden state. The forward hidden state and the backward hidden state at the same time step are concatenated into a vector and then fed into a fully connected mapping layer. The output dimension of the fully connected mapping layer is 1, and the activation function is a linear function. The hidden layer dimensions of the forward GRU layer and the backward GRU layer are the same and are determined by cross-validation during the training phase; A temporal attention layer is set before the fully connected mapping layer. The attention score is calculated by the scaled dot product of the concatenated hidden state and the query vector at the current time step after linear transformation and mapping to the same dimension as the concatenated hidden state. The query vector is formed by concatenating the SOC prediction value of the previous time step with the residual correction vector of the current time step; wherein, the SOC prediction value of the previous time step of the first time step is obtained by looking up the table from the open circuit voltage of the battery when it is at rest before the robot starts through the open circuit voltage-SOC calibration curve.
[0013] Preferably, in one possible implementation of the first aspect, the pre-training specifically includes: Battery data of intelligent robots under various operating conditions are collected. The SOC value calculated by the ampere-hour integration method based on open-circuit voltage calibration is used as the main supervision label, and the operating condition label is used as the auxiliary supervision label to construct training and validation sets. The time-series input samples of the training set are input into a bidirectional gated recurrent unit network to obtain the SOC prediction value at each time step. The main loss function is the mean square error between the SOC prediction value and the main supervision label. A working condition classification branch is set up in parallel with the fully connected mapping layer. This working condition classification branch is derived from the concatenated hidden state at the same time step and outputs the working condition class probability. The auxiliary loss function is the cross-entropy between the working condition class probability and the auxiliary supervision label. The total loss is obtained by weighted summation of the main loss and the auxiliary loss. The network parameters are updated through backpropagation. Training stops when the total loss on the validation set no longer decreases for several consecutive rounds, resulting in a pre-trained bidirectional gated recurrent unit network.
[0014] Secondly, the present invention provides a lithium battery SOC prediction system for intelligent robots, the system being used to implement a lithium battery SOC prediction method for intelligent robots as described in the first aspect, comprising: The data acquisition and segmentation module collects the battery terminal voltage, load current, and joint motor drive commands during the movement of the intelligent robot. Based on the duty cycle change rate of the joint motor drive commands and the rising edge slope of the load current, the sampling window is segmented into load conditions to obtain several continuous working condition segments and the working condition labels corresponding to each segment. The differential and residual module performs sliding differential processing on the terminal voltage and load current in each operating condition segment, extracts the peak position and full width at half maximum of the incremental capacity curve as voltage distortion features, and generates the residual correction vector for that operating condition segment by combining the voltage distortion features with the direction sign of the load current. The sample stitching module stitches the terminal voltage, load current, operating condition label, and residual correction vector of each operating condition segment into a labeled time-series input sample along the time axis. The SOC prediction module inputs time-series input samples into a pre-trained bidirectional gated recurrent unit network to obtain the predicted SOC value of the lithium battery at the current moment.
[0015] The beneficial effects of this invention are: it introduces robot joint motor drive commands into the SOC estimation process, and segments the working conditions by combining the duty cycle change rate and the load current rising edge slope, so that the segmentation results fit the actual motion mode of the robot.
[0016] By performing sliding differential analysis on the voltage and current at each segment, the peak position and full width at half maximum (FWHM) of the incremental capacity curve are extracted as voltage distortion features. Combined with the current direction sign, a residual correction vector is generated, which can capture the nonlinear voltage response of the battery under dynamic load.
[0017] The operating condition label, residual correction vector and time-series electrical quantity are concatenated into a multi-dimensional input and fed into a bidirectional GRU network. A time attention mechanism with "previous SOC prediction value + current residual correction vector" as the query is introduced before the fully connected layer, so that the model focuses on the relevant historical hidden state at the critical operating condition switching time.
[0018] During the training phase, parallel working condition classification branches perform multi-task learning to enhance feature discriminativeness.
[0019] This invention significantly improves the SOC estimation accuracy and anti-drift capability of intelligent robots under complex working conditions such as variable load and regenerative braking. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This application provides a flowchart of a lithium battery SOC prediction method for intelligent robots. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and 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.
[0023] Example 1: As Figure 1 As shown, this invention provides a lithium battery SOC prediction method for intelligent robots, comprising: Step S1: Collect the battery terminal voltage, load current and joint motor drive commands during the movement of the intelligent robot. Based on the duty cycle change rate of the joint motor drive commands and the rising edge slope of the load current, the sampling window is segmented into load conditions to obtain several continuous working condition segments and the working condition labels corresponding to each segment.
[0024] In this embodiment, the length of the sampling window is set. With sliding step size . , Both are based on the update cycle of the joint motor drive commands of the intelligent robot. Confirmed, satisfied and .
[0025] because There is overlap between adjacent sampling windows, and multiple windows may cover the same time. To address this, segmentation is performed by sliding the sampling window one window at a time, detecting the segmentation cut points within each window, and not repeating cut points that already exist on the global time axis; the working condition segments obtained from each window segmentation are merged according to their start and end times on the global time axis, and overlapping segments are retained only once to avoid duplicate segments and label conflicts.
[0026] Within each sampling window, the duty cycle sequence of the joint motor drive commands. Calculate the first-order difference to obtain the duty cycle rate of change. ,in The sampling time number and sampling interval are: Simultaneously, the load current sequence Calculate the first difference ,mark The continuous segment is taken as the rising edge. Within each rising edge segment, take The maximum value is taken as the rising slope of that segment. ,in This represents the set of all sampling times within the rising edge segment at this moment.
[0027] Will With the first preset boundary Compare, The duty cycle is determined by the linear mapping relationship between the rated speed and the duty cycle of the joint motor: full-scale duty cycle. Rated speed of the corresponding joint motor Therefore , The change in speed command between two adjacent control cycles; the alarm threshold for speed command change within a single command update cycle. ,have to .Will With the second preset boundary Compare, Stall current of the joint motor The calibration curve of the load current rise rate was determined and then converted to obtain... ,in .when When, the sampling time at this moment is taken as the first segment cutting point; when At this time, within the rising edge segment The sampling time corresponding to the maximum value is used as the second segment cut point. Based on all segment cut points, the sampling window is divided into several continuous working condition segments, and each segment is assigned a working condition label.
[0028] A mapping table is established between the operating condition labels and the absolute value range of the duty cycle of the joint motor drive commands, as well as the average value range of the load current. The mapping table is defined as follows: the light load constant speed label corresponds to the absolute value range of the duty cycle. And the average range of load current The range of absolute duty cycle values corresponding to the mid-load acceleration label. And the average range of load current The range of absolute duty cycles corresponding to the heavy-load ramp label. And the average range of load current The range of absolute values of the duty cycle corresponding to the regenerative braking label. And the average range of load current .
[0029] Each continuous operating segment is based on the median of the absolute values of the duty cycles of all its internal sampling points. Arithmetic average of load current The initial working condition label for this working condition segment is obtained by looking up a table. When The distance to a certain boundary is less than a preset threshold. When this occurs, a weighted voting mechanism is triggered. Let the candidate labels on both sides of this boundary be... and The boundary value is (For example hour (A represents the lower boundary label, and B represents the upper boundary label). Calculate the cumulative absolute value of the duty cycle change rate at all sampling times within this working condition segment. ,in This is the set of all sampling times within this work condition segment. Then, candidate labels are calculated separately. and Historical average cumulative amount and These two values are obtained from statistics during the pre-training phase, and in this embodiment, they are taken as... , Then calculate the deviation score between the two labels: , A lower deviation score indicates that the dynamic characteristics of the work condition segment better match the historical pattern of the label, thus receiving more votes. The final work condition label is the candidate label with the lowest deviation score. For example, within a certain segment... According to the principle of left-closed and right-open, it is a light-load, uniform speed vehicle, with a distance of 0.3 from the boundary. Therefore, the "light load constant speed / medium load acceleration" conditions on both sides of 0.3 are judged. The cumulative amount within this working condition segment... ,but , The one with the smaller deviation wins, but is ultimately still judged as a lightly loaded constant speed label.
[0030] Step S2: Perform sliding differential processing on the terminal voltage and load current in each operating condition segment, extract the peak position and half width at half maximum of the incremental capacity curve as voltage distortion features, and generate the residual correction vector for that operating condition segment by combining the voltage distortion features with the direction sign of the load current.
[0031] In this embodiment, the intelligent robot battery pack consists of 6 individual battery cells connected in series, with a rated capacity of Terminal voltage All parameters refer to the total terminal voltage of the battery pack, and the parameters obtained from offline calibration are also given at the pack-level voltage. First, the terminal voltage sequence within each operating condition segment is... With load current sequence Apply Smoothing filter. Filter window length. The sampling points are set to 11, with an odd window length consistent with the subsequent sliding difference window length, and the filter order is fixed at 2. For each window, a quadratic polynomial is fitted using the least squares method, and the value of the polynomial at the center point of the window replaces the original data, thereby eliminating high-frequency noise interference. The smoothed terminal voltage sequence is denoted as... The load current sequence is denoted as ,in The sampling time number and sampling interval are: Then, a sliding difference process is performed on the smoothed data. The width of the sliding difference window... Based on the number of sampling points for this working condition segment, this embodiment sets... The number of sampling points is [number], and the window width is an odd number of not less than 3. The number of sampling points for each working condition segment after segmentation should be no less than [number]. For short segments with insufficient data points, merge them with segments that are temporally adjacent and have the same working condition label before extracting features; if the data points are still insufficient after merging, further extraction is needed. The segments are not included in the extraction of residual correction vectors; their residual correction vectors are derived from the vectors of adjacent segments. The sliding differential window moves along the time axis in steps of one sampling point. Within each sliding differential window, the load current is... With sampling interval The products are summed to obtain the incremental charge. , The calculation formula is as follows, expressed in hours:
[0032] in Index of sampling time within the window, The time is the center point of the window. Simultaneously, the terminal voltage... The absolute value of the difference between the first and last values within the same window is used as the incremental voltage. The calculation formula is:
[0033] With incremental charge The absolute value and incremental voltage The ratio is used as the incremental capacity curve value at the center point of the sliding difference window. To ensure that the incremental capacity curve is always non-negative, the calculation formula is:
[0034] By traversing the center positions of all sliding differential windows within the entire operating condition segment, a complete incremental capacity curve is obtained. The "local maximum with the largest amplitude" is the curve. The maximum value, peak position, and half-width at half-maximum are defined for this non-negative curve.
[0035] Local maxima detection is performed on the incremental capacity curve. For each time step... If both conditions are met and Then determine These are local maxima. Record all local maxima and their corresponding values. Value. Take the local maximum value with the largest amplitude and denote it. Value The corresponding terminal voltage value is at the peak position. Half-height width The definition is: on the incremental capacity curve, draw a horizontal line whose vertical axis is equal to half the peak height. The horizontal line intersects the curve at two points, left and right. The absolute value of the difference between the terminal voltages at these two points is the half-width at half-maximum (WHM). Let the terminal voltage at the left intersection point be... The terminal voltage corresponding to the right intersection point is ,but Since the curve consists of discrete points, the precise voltage value at the intersection point is determined by linear interpolation: from the peak position... Search in both directions of decreasing and increasing time, and take the first result on the left and right sides of the peak value. Down to The voltage to the left of the peak is obtained by linear interpolation at the following adjacent points. voltage to the right of the peak , , The coordinates of the time corresponding to the intersection point on the left side of the half-height line. The half-height width represents the time coordinates corresponding to the intersection point on the right side. If no intersection point is found on a certain side, the terminal voltage at the segment boundary on that side is used as a substitute; if there are no intersection points on either side, the half-height width is recorded as the terminal voltage span within the segment. Simultaneously, the existence of the second-largest local maximum is checked; if it exists, it is recorded. Value as If it does not exist, then .
[0036] Direction sign of load current The sign of the algebraic sum of the load currents within this operating condition segment is determined by the summation of the load currents at all sampling times within this operating condition segment. ,in This is the set of all sampling times within this work condition segment. If... ,but , indicating the direction of discharge; if ,but , indicating the direction of regenerative braking; if ,but .
[0037] Peak position Half height and width Direction symbols and the amplitude of the second largest local maximum A four-dimensional vector is formed in a fixed order. The four-dimensional vector is then standardized, with the standardization parameters obtained from offline calibration. mean Standard deviation ; mean Standard deviation ; mean Standard deviation ; mean Standard deviation The standardized formula is:
[0038]
[0039] Standardized four-dimensional vector This is the residual correction vector for that operating condition segment, which reflects the battery voltage distortion characteristics and load direction information within that segment.
[0040] Step S3: Combine the terminal voltage, load current, operating condition label, and residual correction vector of each operating condition segment into a labeled time-series input sample along the time axis.
[0041] In this embodiment, the terminal voltage sequence within each operating condition segment is... Load current sequence Integer encoding of operating condition label and residual correction vector Aligned according to sampling time. The integer encoding rules for the operating condition labels are as follows: light load constant speed label is coded as 0, medium load acceleration label is coded as 1, heavy load climbing label is coded as 2, and regenerative braking label is coded as 3. The residual correction vector is a four-dimensional vector containing the standardized peak position. Half height and width Direction symbols and the magnitude of the second largest local maximum Record the first The residual correction vector for each working condition segment is The vector is constant within the same segment, that is... ,in For the first The set of all sampling times within a segment. For each sampling time within this operating condition segment. These four data points are stacked along the feature dimension to form a time-step feature vector. .
[0042] The feature vectors of all time steps of this working condition segment are arranged in chronological order into a two-dimensional matrix. The number of rows in the matrix represents the number of time steps for that work condition segment. The number of columns is 7, which is the feature dimension. The two-dimensional matrices of all operating condition segments are sequentially concatenated along the time axis to form a two-dimensional time-series input sample. Its dimensions are ,in This is the sum of time steps for all segments. During stitching, an overlap window is maintained at the boundary between adjacent segments; the length of the overlap window is... The rate of change of duty cycle at the end of the previous segment Rate of change of duty cycle at the beginning of the next segment The absolute value of the difference is obtained through saturated linear mapping. The formula for saturated linear mapping is:
[0043] Where the proportionality coefficient and intercept Determined by experimental calibration, This is the maximum overlap window length. In this embodiment, it is set to... , , Number of sampling points. Duty cycle change rate. The range of values is The absolute value of the difference is at most 2, but in actual operation, due to the update frequency and inertia of the motor drive commands, the absolute value of the difference usually does not exceed 0.5. When the absolute value of the difference is 0, the overlap window length is 5 sampling points; when the absolute value of the difference is 0.3, the overlap window length is 20 sampling points, reaching the saturation upper limit. Overlap window length The number of sampling points after rounding is not less than one, and does not exceed the number of time steps in the previous segment. Half and the number of steps in the next segment of time The smaller of half; when the time steps of any segment are less than 4, cancel the overlap window and directly connect the beginning and end; for time steps less than Short segments are merged into adjacent segments before further processing.
[0044] Within the overlapping window, the terminal voltage and load current at each sampling moment are taken as the weighted average of the corresponding moments of the two preceding and following segments. Let the duty cycle change rate at the end of the preceding segment at the boundary point be... The rate of change of the duty cycle at the beginning of the next segment is... Calculate the difference According to the inverse distribution principle, the weight of the previous segment... and The weight of the next segment is inversely proportional to the weight of the previous segment. and It is directly proportional. The specific formula is:
[0045] in It is a small positive integer used to prevent the denominator from being zero and to ensure that the sum of the weights is 1. This is an empirical upper limit for the difference in duty cycle change rates. In this embodiment, it is set... , .when When smaller, Approaching 1, Approaching 0; when When it is large, Approaching 0 Approaching 1. At the intersection point, the sum of the weights of the preceding and following segments is always 1. Within the overlapping window, the first... Each sampling time Corresponding to the end of the previous segment The sampling time and the first segment of the next segment Each sampling time. The terminal voltage at that time. and load current The calculation is as follows:
[0046]
[0047] in and This is a smoothed sequence of terminal voltages and load currents from the previous segment. and This is the smoothed sequence of terminal voltage and load current for the next segment. The operating condition labels within the overlapping window are the same as those in the next segment, i.e. ,in The first part of the next segment The operating condition label is encoded as an integer at each time step. The residual correction vector within the overlapping window follows the residual correction vector of the next segment. Since the residual correction vector of the next segment is a constant vector within this operating condition segment, it is denoted as... Therefore, the residual correction vector at all times within the overlapping window is taken as... .
[0048] After the stitching is completed, the two-dimensional time-series input samples are processed. Minimum-maximum normalization is performed channel by channel along the feature dimension. Normalization is performed independently for each channel, starting with the first channel. Upper limit of each channel and lower limit The statistical extreme value of the channel on the training set is taken to avoid truncating outliers. In this embodiment, a large amount of operating condition data is collected in advance, and the global minimum and maximum values of each channel are statistically obtained: the terminal voltage channel is... The load current path is The integer encoding channels for the operating condition label are 0-3; the four component channels of the residual correction vector are respectively... , , , The normalization formula is:
[0049] For the first The values before normalization on each channel For the first The normalized values on each channel linearly map the data to... Interval. The normalized two-dimensional time-series input sample is denoted as... , which serves as the input to the bidirectional gated cyclic unit network.
[0050] Step S4: Input the time-series input samples into the pre-trained bidirectional gated recurrent unit network to obtain the predicted SOC value of the lithium battery at the current time.
[0051] In this embodiment, the bidirectional gated recurrent unit network includes a forward GRU layer and a backward GRU layer. The forward GRU layer reads the normalized two-dimensional temporal input samples in ascending time order. The backward GRU layer reads the sample in reverse chronological order. The hidden layer dimensions of the forward and backward GRU layers are the same, both being 128-dimensional. This dimension is determined during training through five-fold cross-validation, and the candidate dimension set is as follows: The dimension that minimizes the main loss function on the validation set is selected as the final value. At each time step... The forward GRU layer outputs the forward hidden state. The backward hidden state is output by the backward GRU layer. The forward and backward hidden states at the same time step are concatenated to obtain the concatenated hidden state. A temporal attention layer is set up before the fully connected mapping layer, which performs attention on each time step. Calculate an attention weight The attention weights are calculated as follows: First, a query vector is constructed. ,in This is the SOC prediction value from the previous time step. This is the residual correction vector for the current time step. For the first time step... , The open-circuit voltage of the battery when it is at rest before the robot is started. The calibration curve was obtained from a table. Specifically, the robot was left to stand still for 30 minutes before starting, and the battery terminal voltage was measured as the open-circuit voltage, denoted as [value missing]. Open circuit voltage The calibration curve was obtained in advance through laboratory testing. Under conditions of 25℃, the open-circuit voltage was recorded every 5% of capacity discharged, resulting in 21 calibration points. A continuous curve was obtained using cubic spline interpolation. Based on... The corresponding SOC value was found on the curve as... In this embodiment, the actual measurement... The table can be consulted to obtain the result. Query vector A linear transformation maps the hidden state to the same dimension as the concatenated hidden state. ,in For learnable weight matrix, This is a learnable bias vector. Then, the attention score is calculated. ,in To stitch together the dimensions of the hidden state, Use the scaling factor. Apply the attention scores over all time steps. Normalization yields the attention weights, and the context vector is obtained by weighting and summing the hidden states at each time step using these weights.
[0052] in This represents the total number of time steps input for this inference; the context vector... Concatenate with the current time step to hide the state The concatenation along the feature dimension is then fed into a fully connected mapping layer. The fully connected mapping layer has an input dimension of 512 and an output dimension of 1. The activation function is a linear function, i.e. ,in This is the weight matrix. These are bias terms, all of which are learnable parameters. That is, the current time step. The predicted SOC value of the lithium battery. Forward layer self... arrive Backward layer self to The SOC prediction value for each time step is calculated separately, and the output of the time step where the time to be estimated is located is taken as the SOC prediction value for the current time. This step uses the time series sample of a working interval as an inference input. After the data of the segment is fully collected, the SOC of the segment (including the end) is given immediately. It belongs to batch processing / quasi-online estimation. The output of a single time step does not depend on the SOC prediction value of future time, but depends on the observation value of subsequent time in the segment.
[0053] In this embodiment, the pre-training process specifically involves collecting battery data from the intelligent robot under various operating conditions, including indoor flat-ground inspection, outdoor slope patrol, and heavy-load handling. Each operating condition lasts for 30 minutes, with a sampling interval of 50ms, resulting in a total of 500 data sets collected. The SOC value calculated using the ampere-hour integration method based on open-circuit voltage calibration is used as the primary supervisory label. The ampere-hour integration method formula is as follows: ,in The initial SOC value is obtained by looking up the table based on the open-circuit voltage after 30 minutes of rest before each operation. In this embodiment, the rated capacity of the battery is... , For the load current, the integral is discretized using the trapezoidal rule. Open-circuit voltage calibration is performed every 10 minutes during the work interval, followed by a rest period of at least 30 minutes before measuring the open-circuit voltage to correct the SOC value. This calibration is only used to generate training labels during offline data acquisition and does not participate in the online estimation process; no shutdown is required during online operation. Operating condition labels are used as auxiliary monitoring labels, with four types: light load constant speed, medium load acceleration, heavy load climbing, and regenerative braking, coded as 0, 1, 2, and 3 respectively. All data is divided into running batches, with one consecutive operation counted as one batch. The training set and validation set do not contain batches from the same source, and the batch size ratio is approximately [missing information]. The time-series input samples from the training set are fed into a bidirectional gated recurrent unit network to obtain the SOC prediction value at each time step. The main loss function is the mean squared error between the SOC predicted value and the main supervisory label, calculated using the following formula: Where N is the total number of time steps in the training set. The main supervisor label is set. A condition classification branch is set in parallel with the fully connected mapping layer, which is derived from the concatenated hidden states at the same time step. The process involves mapping 256 dimensions to 4 dimensions using a fully connected layer, with the activation function being... Then through The function outputs the probability of the working condition category. ,in This is the weight matrix. This is the bias term. The auxiliary loss function is the cross-entropy between the working condition category probability and the auxiliary supervision label, calculated using the following formula: ,in To assist in the one-hot encoding of the supervision label, when the first The working condition label for each time step is The value is 1 if the main loss is true, and 0 otherwise. The total loss is obtained by weighted summation of the main loss and auxiliary loss, as shown in the formula: The weighting coefficient The loss was determined to be 0.2 through grid search. Network parameters were updated via backpropagation. The optimizer used was Adam, with an initial learning rate of 0.001, a batch size of 64, and a maximum of 100 training epochs. Training stopped when the total loss on the validation set no longer decreased for 10 consecutive epochs, resulting in a pre-trained bidirectional gated recurrent unit network.
[0054] Example 2: This invention provides a lithium battery SOC prediction system for intelligent robots, comprising: The data acquisition and segmentation module collects battery terminal voltage, load current, and joint motor drive commands during the movement of the intelligent robot. Based on the duty cycle change rate of the joint motor drive commands and the rising edge slope of the load current, the sampling window is segmented into load conditions to obtain several continuous operating condition segments and corresponding operating condition labels for each segment.
[0055] The differential and residual module performs sliding differential processing on the terminal voltage and load current in each operating condition segment, extracts the peak position and full width at half maximum (FWHM) of the incremental capacity curve as voltage distortion features, and generates the residual correction vector for that operating condition segment by combining the voltage distortion features with the direction sign of the load current.
[0056] The sample stitching module stitches the terminal voltage, load current, operating condition label, and residual correction vector of each operating condition segment into a labeled time-series input sample along the time axis.
[0057] The SOC prediction module inputs time-series input samples into a pre-trained bidirectional gated recurrent unit network to obtain the predicted SOC value of the lithium battery at the current moment.
[0058] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for predicting the state of charge (SOC) of a lithium battery for intelligent robots, characterized in that, include: Step S1: Collect the battery terminal voltage, load current and joint motor drive commands during the movement of the intelligent robot. Based on the duty cycle change rate of the joint motor drive commands and the rising edge slope of the load current, the sampling window is divided into load conditions to obtain several continuous working condition segments and the working condition labels corresponding to each segment. Step S2: Perform sliding differential processing on the terminal voltage and load current in each operating condition segment, extract the peak position and half width at half maximum of the incremental capacity curve as voltage distortion features, and combine the voltage distortion features with the direction sign of the load current to generate the residual correction vector of the operating condition segment. Step S3: Combine the terminal voltage, load current, operating condition label, and residual correction vector of each operating condition segment into a labeled time-series input sample according to the time axis; Step S4: Input the time-series input samples into the pre-trained bidirectional gated recurrent unit network to obtain the predicted SOC value of the lithium battery at the current time.
2. The lithium battery SOC prediction method for intelligent robots as described in claim 1, characterized in that, In step S1, the length of the sampling window and the sliding step size are set according to the update cycle of the joint motor drive command. The duty cycle change rate is obtained by calculating the first-order difference of the duty cycle sequence of the joint motor drive command within each sampling window. Calculate the first-order difference of the load current sequence and mark the continuous segments with positive difference values as rising edges. Take the maximum value of the first-order difference of the load current within the rising edge segment as the rising edge slope. Compare the duty cycle change rate and the rising edge slope with the first preset limit and the second preset limit, respectively. When the duty cycle change rate exceeds the first preset limit, the sampling time at this time is taken as the first segment cut point; when the rising edge slope exceeds the second preset limit, the sampling time corresponding to the maximum value of the first-order differential load current in the rising edge segment at this time is taken as the second segment cut point. The sampling window is divided into several continuous working condition segments based on all segmentation points, and each working condition segment is assigned a working condition label.
3. The lithium battery SOC prediction method for intelligent robots as described in claim 2, characterized in that, The first preset limit is determined by the linear mapping relationship between the rated speed and duty cycle of the joint motor; the second preset limit is determined by the calibration curve of the stall current and the rate of increase of the load current of the joint motor. A mapping table is established between the operating condition label and the absolute value range of the duty cycle of the joint motor drive command and the average value range of the load current. For each continuous operating condition segment, the operating condition label is obtained by looking up a table based on the median of the absolute value of the duty cycle and the arithmetic mean of the load current. When the distance between the median absolute value of the duty cycle and any boundary of the interval is less than a preset threshold, the deviation between the cumulative amount of the duty cycle change rate within the working condition segment and the historical average cumulative amount of the two candidate labels on both sides of the boundary is used as the criterion, and the one with the smaller deviation is taken as the final working condition label for the working condition segment.
4. The lithium battery SOC prediction method for intelligent robots as described in claim 1, characterized in that, In step S2, a sliding differential processing is applied to the terminal voltage and load current in each operating condition segment. The width of the sliding differential window is determined according to the number of sampling points in the operating condition segment and is an odd number not less than 3. The incremental charge is obtained by accumulating the product of the load current and the sampling interval within the sliding differential window. The absolute value of the difference between the first and last values of the terminal voltage within the same window is taken as the incremental voltage. The ratio of the absolute value of the incremental charge to the incremental voltage is taken as the incremental capacity curve value at the center point of the sliding differential window. The complete incremental capacity curve is obtained by traversing the entire operating condition segment. Local maxima detection is performed on the incremental capacity curve. The terminal voltage value corresponding to each local maximum is recorded as the peak position. A horizontal line is drawn from the half-height position of the peak where the local maximum is located, that is, half of the peak amplitude. The line intersects the curve at two points on the left and right sides of the peak. The absolute value of the terminal voltage difference between the two points is recorded as the half-height width. The peak position and the half-height width are used as the voltage distortion characteristics of the operating condition segment.
5. The lithium battery SOC prediction method for intelligent robots as described in claim 4, characterized in that, Before the sliding differential processing, the terminal voltage and load current are smoothed by Savitzky-Golay filtering. The filter window length is the same as the sliding differential window length and is an odd number. The filter order is fixed at 2. Take the local maximum value with the largest amplitude, and use its peak position and half width at half maximum (FWHM) as the voltage distortion characteristics of this operating condition segment; The sign of the load current direction is determined by the sign of the algebraic sum of the load currents within that operating condition segment; a positive value indicates the discharge direction, and a negative value indicates the regenerative braking direction. The peak position, half-width at half-maximum, and direction sign are arranged in a fixed order to form a three-dimensional vector. The amplitude of the second largest local maximum other than the local maximum with the largest amplitude is further taken as the fourth dimension component to form a four-dimensional vector. If there is no second largest local maximum, the fourth dimension component is set to zero. Based on the mean and standard deviation of each component obtained from offline calibration, the residual correction vector for this working condition segment is obtained by standardizing the four-dimensional vector component by component.
6. The lithium battery SOC prediction method for intelligent robots as described in claim 1, characterized in that, In step S3, the terminal voltage sequence, load current sequence, integer encoding of the operating condition label, and residual correction vector in each operating condition segment are aligned according to the sampling time, and the four data at the same time are stacked along the feature dimension to form a time step feature vector. Arrange the feature vectors of all time steps of the working condition segment into a two-dimensional matrix in chronological order. The number of rows in the matrix is the number of time steps of the working condition segment, and the number of columns is the feature dimension. Concatenate the two-dimensional matrices of all working condition segments along the time axis to form a two-dimensional time series input sample. During splicing, an overlap window is retained at the boundary between adjacent segments. The length of the overlap window is obtained by linear mapping the absolute value of the difference between the duty cycle change rate at the end of the previous segment and the duty cycle change rate at the beginning of the next segment.
7. The lithium battery SOC prediction method for intelligent robots as described in claim 6, characterized in that, The terminal voltage and load current at each sampling moment within the overlapping window are taken as the weighted average of the corresponding moments of the two segments. The weight is inversely distributed by the difference in duty cycle change rate between the end of the previous segment and the beginning of the next segment at the junction point. The sum of the weight of the previous segment and the weight of the next segment at the junction point is 1. The operating condition labels within the overlapping window are the same as those in the next segment, and the residual correction vector is also the same as that in the next segment. After concatenation, the time-series input samples are normalized to minimum and maximum values channel by channel along the feature dimension; the upper and lower limits of the terminal voltage, load current, and integer encoding channels of the operating condition label, as well as the residual correction vector components, are all set based on the statistical extreme values of the channels in the training set, linearly mapping the data to... Interval.
8. The lithium battery SOC prediction method for intelligent robots as described in claim 1, characterized in that, In step S4, the bidirectional gated recurrent unit network includes a forward GRU layer and a backward GRU layer. The forward GRU layer reads the temporal input samples in forward time order, and the backward GRU layer reads the temporal input samples in reverse time order. At each time step, the forward GRU layer outputs the forward hidden state, and the backward GRU layer outputs the backward hidden state. The forward hidden state and the backward hidden state at the same time step are concatenated into a vector and then fed into a fully connected mapping layer. The output dimension of the fully connected mapping layer is 1, and the activation function is a linear function. The hidden layer dimensions of the forward GRU layer and the backward GRU layer are the same and are determined by cross-validation during the training phase; A temporal attention layer is set before the fully connected mapping layer. The attention score is calculated by the scaled dot product of the concatenated hidden state and the query vector at the current time step after linear transformation and mapping to the same dimension as the concatenated hidden state. The query vector is formed by concatenating the SOC prediction value of the previous time step with the residual correction vector of the current time step; wherein, the SOC prediction value of the previous time step of the first time step is obtained by looking up the table from the open circuit voltage of the battery when it is at rest before the robot starts through the open circuit voltage-SOC calibration curve.
9. The lithium battery SOC prediction method for intelligent robots as described in claim 8, characterized in that, The pre-training specifically refers to: Battery data of intelligent robots under various operating conditions are collected. The SOC value calculated by the ampere-hour integration method based on open-circuit voltage calibration is used as the main supervision label, and the operating condition label is used as the auxiliary supervision label to construct training and validation sets. The time-series input samples of the training set are input into a bidirectional gated recurrent unit network to obtain the SOC prediction value at each time step. The main loss function is the mean square error between the SOC prediction value and the main supervision label. A working condition classification branch is set up in parallel with the fully connected mapping layer. This working condition classification branch is derived from the concatenated hidden state at the same time step and outputs the working condition class probability. The auxiliary loss function is the cross-entropy between the working condition class probability and the auxiliary supervision label. The total loss is obtained by weighted summation of the main loss and the auxiliary loss. The network parameters are updated through backpropagation. Training stops when the total loss on the validation set no longer decreases for several consecutive rounds, resulting in a pre-trained bidirectional gated recurrent unit network.
10. A lithium battery SOC prediction system for intelligent robots, characterized in that, The system is used to implement a lithium battery SOC prediction method for intelligent robots as described in any one of claims 1 to 9, comprising: The data acquisition and segmentation module collects the battery terminal voltage, load current, and joint motor drive commands during the movement of the intelligent robot. Based on the duty cycle change rate of the joint motor drive commands and the rising edge slope of the load current, the sampling window is segmented into load conditions to obtain several continuous working condition segments and the working condition labels corresponding to each segment. The differential and residual module performs sliding differential processing on the terminal voltage and load current in each operating condition segment, extracts the peak position and full width at half maximum of the incremental capacity curve as voltage distortion features, and generates the residual correction vector for that operating condition segment by combining the voltage distortion features with the direction sign of the load current. The sample stitching module stitches the terminal voltage, load current, operating condition label, and residual correction vector of each operating condition segment into a labeled time-series input sample along the time axis. The SOC prediction module inputs time-series input samples into a pre-trained bidirectional gated recurrent unit network to obtain the predicted SOC value of the lithium battery at the current moment.