Method, system and device for optimizing electric heavy truck battery swap interface based on machine learning and medium

By combining multimodal perception fusion and fuzzy adaptive impedance control with long short-term memory networks, the perception and control problems of traditional electric heavy-duty truck battery swapping solutions in complex environments have been solved, achieving high-precision and safe automated battery swapping interface alignment and insertion/removal.

CN122275683APending Publication Date: 2026-06-26GUIZHOU GUIPING EXPRESSWAY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUIZHOU GUIPING EXPRESSWAY CO LTD
Filing Date
2026-03-05
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Traditional electric heavy-duty truck battery swapping solutions suffer from limited perception and poor environmental adaptability in environments such as drastic changes in lighting, lens fogging, partial mud and dirt obstruction of interfaces, and undulating terrain, leading to automatic docking failures. Furthermore, their rigid control modes are prone to generating excessive contact forces when faced with manufacturing tolerances and vehicle suspension settlement, resulting in component jamming or damage.

Method used

Multimodal perception fusion technology is adopted, which combines binocular vision image data, six-dimensional force sensor data and two-dimensional lidar point cloud data for weighted fusion perception processing to generate real-time fused pose estimation. Compliant motion commands are generated through fuzzy adaptive impedance control, and long short-term memory network is used to compensate for prediction errors to achieve compliant motion of the robotic arm.

Benefits of technology

In complex environments, it achieves a high success rate for battery swapping interfaces, safe and damage-free automated alignment and insertion, maintains high precision over a long period, and improves the robustness and compliance of the battery swapping process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122275683A_ABST
    Figure CN122275683A_ABST
Patent Text Reader

Abstract

This application relates to a machine learning-based optimization method, system, device, and medium for battery swapping interfaces of electric heavy-duty trucks. The method includes: receiving synchronously acquired binocular vision image data, six-dimensional force sensor data, and two-dimensional LiDAR point cloud data, and performing multimodal weighted fusion sensing processing to generate a real-time fused pose estimate; processing the real-time fused pose estimate and six-dimensional force sensor data through fuzzy adaptive impedance control to generate Cartesian space compliant motion commands; predicting and generating real-time error compensation quantities using a long short-term memory network based on fused target pose data, original control commands, and final residual alignment error data sequences from historical battery swapping operations; and generating battery swapping robotic arm drive commands based on the Cartesian space compliant motion commands and the real-time error compensation quantities. This method enables automated alignment and insertion / removal of the battery swapping interface with high success rate, safety, no damage, and long-term high precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of control technology, and in particular relates to a method, system, device and medium for optimizing the battery swapping interface of electric heavy trucks based on machine learning. Background Technology

[0002] With the development of new energy vehicle technology, electric heavy-duty truck technology has emerged. Battery swapping is the mainstream solution to address the pain points of long charging time and low operating efficiency of electric heavy-duty trucks, requiring high-precision, high-reliability, and high-efficiency automatic docking between the battery box and the vehicle body battery swapping interface.

[0003] Traditional automated battery swapping solutions mainly rely on high-precision trajectory pre-programming and visual servo guidance to complete the automatic docking of battery swapping interfaces.

[0004] However, the above methods are limited in their perception and have poor environmental adaptability. They rely on a single vision system and are prone to feature extraction failures when there are drastic changes in lighting, lens fogging, partial mud or dirt obscuring the interface, or uneven terrain, which can lead to guidance failure. In addition, the control mode is rigid and lacks flexibility. The position rigid control strategy is prone to generating excessive contact force when faced with manufacturing tolerances, vehicle suspension settlement, slight interface deformation, etc., which can cause parts to jam or be damaged. Summary of the Invention

[0005] Therefore, it is necessary to provide a machine learning-based optimization method, system, device, and medium for the battery swapping interface of electric heavy-duty trucks that can integrate multimodal perception and achieve adaptive compliant control, in order to address the above-mentioned technical problems.

[0006] Firstly, this application provides a machine learning-based method for optimizing the battery swapping interface of electric heavy-duty trucks, including:

[0007] It receives synchronously acquired binocular vision image data, six-dimensional force sensor data, and two-dimensional lidar point cloud data, and performs multimodal weighted fusion perception processing on the binocular vision image data and two-dimensional lidar point cloud data to generate real-time fused pose estimation of the vehicle-side battery swapping interface relative to the end coordinate system of the battery swapping robotic arm.

[0008] By processing real-time fused pose estimation and six-dimensional force sensor data through fuzzy adaptive impedance control, a Cartesian space compliant motion command is generated to drive the end effector of the battery swapping robotic arm.

[0009] Based on the fusion target pose data, original control commands and final residual alignment error data sequence from historical battery swapping operations, a pre-trained long short-term memory network is used to predict and generate a real-time error compensation amount to compensate for the long-term drift error of the system.

[0010] The driving commands for the battery swapping robotic arm are generated based on the Cartesian space compliant motion command and the real-time error compensation. The driving commands for the battery swapping robotic arm are used to instruct the multi-degree-of-freedom actuators of the battery swapping robotic arm to perform the alignment and insertion / removal operations of the battery swapping interface.

[0011] In one embodiment, multimodal weighted fusion perception processing is performed on binocular vision image data and two-dimensional LiDAR point cloud data to generate a real-time fused pose estimate of the vehicle-side battery swapping interface relative to the coordinate system of the battery swapping robotic arm end effector, including:

[0012] Preprocessing and feature point detection are performed on the binocular vision image data to obtain the pixel coordinates of the interface identifier point matching the left and right images. Based on the pixel coordinates of the interface identifier point and combined with the camera calibration parameters, the visual pose estimate of the interface in the visual sensor coordinate system is calculated through triangulation and the Perspective-n-Point algorithm.

[0013] Clustering and line segment feature extraction are performed on the two-dimensional lidar point cloud data to obtain point cloud features. The point cloud features are then iteratively registered with a pre-built standard model of an electric heavy truck chassis to obtain lidar pose estimation values. The lidar pose estimation values ​​include the horizontal position deviation and yaw angle deviation of the interface along the battery swapping track direction.

[0014] Based on the average gradient value of the image, the number of interface identifier matching points, and the average reprojection error of feature points from the binocular vision image data, the real-time first reliability weight of the visual perception channel is calculated, and the real-time second reliability weight of the lidar perception channel is calculated based on the number of matching point pairs and the registration residual of the iterative point cloud registration.

[0015] Based on the Kalman filter with the interface pose as the state variable, the visual pose estimate and the lidar pose estimate are used as observation inputs. Combined with the adjustment factor of the observation noise covariance matrix transformed by the first reliability weight and the second reliability weight, Kalman filtering is performed to obtain the real-time fused pose estimate.

[0016] In one embodiment, based on the average gradient value of the binocular vision image data, the number of matched interface marker points, and the average reprojection error of feature points, a real-time first reliability weight for the visual perception channel is calculated. Then, based on the number of matched point pairs and the registration residual from iterative point cloud registration, a real-time second reliability weight for the lidar perception channel is calculated, including:

[0017] The real-time first reliability weight is obtained using the following formula:

[0018]

[0019] in, As the first reliability weight in real time; The average gradient value of the image; Image sharpness threshold; Match the number of interface identifiers; This represents the total number of interface identifiers. and The first The reprojection coordinates of each feature point and the coordinates of the binocular vision image; , and These are weighting coefficients; To prevent small amounts from being divided by zero;

[0020] The real-time second reliability weight is obtained using the following formula:

[0021]

[0022] in, As the second reliability weight in real time; To match the number of point pairs, The threshold for the number of matching point pairs; To register residuals; To prevent small amounts from being divided by zero; and These are the weighting coefficients.

[0023] In one embodiment, fuzzy adaptive impedance control is used to process real-time fused pose estimation and six-dimensional force sensor data to generate Cartesian space compliant motion commands for driving the end effector of the battery swapping robotic arm, including:

[0024] Based on real-time fusion pose estimation and the actual pose of the end effector of the battery swapping robot, the current Cartesian space pose tracking error vector is calculated, and the norm of the Cartesian space pose tracking error vector is normalized to obtain the first fuzzy input.

[0025] The vector norm of the contact force data in the six-dimensional force sensor data is normalized to obtain the second fuzzy input quantity;

[0026] The first and second fuzzy inputs are fed into a fuzzy inference engine based on a fuzzy rule base to obtain the stiffness adjustment factor and damping adjustment factor; the expression of the fuzzy inference engine is as follows: ,in, For the first fuzzy input quantity, This is the second fuzzy input quantity. For the power of expectation, , and For real-time impedance parameters, , , The nominal Cartesian stiffness matrix, The nominal Cartesian damping matrix, This is the stiffness adjustment factor. This is the damping adjustment factor;

[0027] Multiply the nominal Cartesian stiffness matrix by the stiffness adjustment factor scalar to obtain the real-time adaptive stiffness matrix, and multiply the nominal Cartesian damping matrix by the damping adjustment factor scalar to obtain the real-time adaptive damping matrix.

[0028] Based on the real-time adaptive stiffness matrix, real-time adaptive damping matrix, Cartesian space pose tracking error vector, contact force data, and desired contact force, the Cartesian space compliance adjustment velocity vector is calculated using the admittance control principle. This Cartesian space compliance adjustment velocity vector is then vector-superimposed with the proportional control velocity vector based on the Cartesian space pose tracking error vector to obtain the Cartesian space compliance motion command. The expression for the Cartesian space compliance motion command is: Wherein, the Cartesian space compliant adjustment velocity vector is The expected pose correction amount corresponding to the pose tracking error vector in Cartesian space. , For proportional control of the velocity vector, This is the velocity proportional gain matrix.

[0029] In one embodiment, the fuzzy linguistic variables of the first fuzzy input quantity include large, medium, and small; the fuzzy linguistic variables of the second fuzzy input quantity are zero, small, and large.

[0030] The fuzzy rule base is constructed using the following methods:

[0031] When the first fuzzy input is large and the second fuzzy input is zero, the stiffness adjustment factor is high and the damping adjustment factor is medium.

[0032] When the first fuzzy input is small and the second fuzzy input is small, the stiffness adjustment factor is medium and the damping adjustment factor is medium.

[0033] When the second fuzzy input is large, both the stiffness adjustment factor and the damping adjustment factor are low.

[0034] The fuzzy set is fuzzified using an objective function, and the output of the fuzzy inference engine is defuzzified using the centroid method to obtain the scalar values ​​of the stiffness adjustment factor and the damping adjustment factor. The objective function is a triangular function or a Gaussian membership function. The fuzzy set includes the first fuzzy input, the second fuzzy input, the stiffness adjustment factor, and the damping adjustment factor.

[0035] In one embodiment, the Long Short-Term Memory network is trained using the following method:

[0036] After each insertion and removal operation is completed, the fused target pose data, Cartesian space compliant motion command, and six-degree-of-freedom residual alignment error data measured after physical locking through the micro-switch array built into the interface are collected before the insertion and removal contact occurs. Data samples are obtained and stored in the circular buffer database in chronological order.

[0037] Based on minimizing the mean squared error between the model prediction error and the actual residual error, the Long Short-Term Memory (LSTM) network model is trained using data samples from the circular buffer database to obtain the LSM network. The LSM network includes an input layer, a hidden layer based on a gating mechanism, and an output layer.

[0038] In one embodiment, the real-time error compensation amount is used in the feedforward compensation path or the parameter influence path; the feedforward compensation path corresponds to performing Lie algebra addition on the real-time error compensation amount and the real-time fused pose estimation to generate the pre-compensated optimized target pose, which serves as a new benchmark for calculating the Cartesian space pose tracking error vector; the parameter influence path corresponds to using the Euclidean norm and principal direction vector of the real-time error compensation amount as additional features as the third fuzzy input of the fuzzy inferencer.

[0039] Based on the fused target pose data, original control commands, and final residual alignment error data sequence from historical battery swapping operations, a pre-trained long short-term memory network is used to predict and generate real-time error compensation quantities to compensate for long-term drift errors in the system, including:

[0040] The real-time error compensation amount can be obtained using the following formula:

[0041]

[0042] in, This is the amount of real-time error compensation; For Long Short-Term Memory (LSTM) network mapping functions, Indicates the first Data samples from this operation.

[0043] Secondly, this application also provides a machine learning-based electric heavy-duty truck battery swapping interface optimization system, including:

[0044] The perception module is used to receive synchronously acquired binocular vision image data, six-dimensional force sensor data and two-dimensional lidar point cloud data, and to perform multimodal weighted fusion perception processing on the binocular vision image data and two-dimensional lidar point cloud data to generate real-time fused pose estimation of the vehicle-end battery swapping interface relative to the end coordinate system of the battery swapping robotic arm.

[0045] The control module is used to process real-time fused pose estimation and six-dimensional force sensor data through fuzzy adaptive impedance control to generate Cartesian space compliant motion commands for driving the end effector of the battery swapping robot arm.

[0046] The compensation module is used to generate a real-time error compensation amount to compensate for the long-term drift error of the system by using a pre-trained long short-term memory network to predict the fused target pose data, original control commands and final residual alignment error data sequence from historical battery swapping operations.

[0047] The decision module is used to generate drive commands for the battery swapping robotic arm based on the Cartesian space compliant motion command and the real-time error compensation amount; the drive commands for the battery swapping robotic arm are used to instruct the multi-degree-of-freedom actuators of the battery swapping robotic arm to perform the alignment and insertion / removal operations of the battery swapping interface.

[0048] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the above-mentioned machine learning-based electric heavy truck battery swapping interface optimization methods.

[0049] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the above-mentioned machine learning-based electric heavy-duty truck battery swapping interface optimization methods.

[0050] The aforementioned machine learning-based optimization method, system, equipment, and medium for electric heavy-duty truck battery swapping interfaces estimates the relative pose of the interface by integrating binocular vision, force sensing, and lidar multimodal data. The pose estimation is combined with real-time contact force input to a fuzzy adaptive impedance controller to generate motion commands that combine positioning accuracy and contact compliance. The system uses a long short-term memory network to learn system errors in historical operations and generate real-time feedforward compensation. The combined motion commands and compensation drive the robotic arm to perform the operation, thereby achieving high success rate, safe and damage-free operation, and long-term high precision automated alignment and insertion of the battery swapping interface in complex environments. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is a flowchart illustrating the machine learning-based electric heavy-duty truck battery swapping interface optimization method of the present invention.

[0053] Figure 2 This is a flowchart illustrating the steps of step S101.

[0054] Figure 3 This is a flowchart illustrating the steps of step S102.

[0055] Figure 4 This is a structural diagram of the machine learning-based electric heavy-duty truck battery swapping interface optimization system of the present invention. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0057] In one embodiment, such as Figure 1 As shown, a machine learning-based optimization method for battery swapping interfaces in electric heavy-duty trucks is provided. This embodiment illustrates the method by applying it to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0058] S101: Receives synchronously acquired binocular vision image data, six-dimensional force sensor data, and two-dimensional lidar point cloud data, and performs multimodal weighted fusion perception processing on the binocular vision image data and two-dimensional lidar point cloud data to generate a real-time fused pose estimate of the vehicle-side battery swapping interface relative to the end coordinate system of the battery swapping robotic arm.

[0059] Indicatively, binocular vision image data is acquired by a binocular vision camera fixed to the end effector of the battery swapping robotic arm. A six-dimensional force sensor is set at the connection between the end effector of the robotic arm and the battery swapping gun to collect the contact force and contact torque information generated during the battery swapping interface docking process in real time. A two-dimensional lidar is fixed to the top of the battery swapping compartment to scan the vehicle chassis outline and assist in providing coarse positioning along the track direction when vision is limited.

[0060] Optionally, the acquired binocular vision image data is preprocessed, including image denoising, grayscale conversion, feature point extraction, and stereo matching. Then, by combining the intrinsic and extrinsic parameter matrices of the binocular vision camera, the visual pose estimation of the feature points of the vehicle-end battery swapping interface in the coordinate system of the battery swapping robotic arm is calculated using the triangulation principle. ,in These represent the three-dimensional position coordinates of the battery swapping interface along the X, Y, and Z axes in the coordinate system of the robotic arm's end effector, obtained from visual calculations. The three-dimensional attitude angles of the battery swapping interface around the X, Y, and Z axes in the coordinate system of the robotic arm end effector, obtained from visual calculation, are as follows: The two-dimensional LiDAR point cloud data is preprocessed, using a statistical filtering algorithm to remove environmental noise points and outliers, and a feature extraction algorithm to extract geometric feature points such as edges and corners of the battery swapping interface. Based on the spatial distribution characteristics of these feature points, the LiDAR pose estimate is calculated. ,in These represent the three-dimensional position coordinates of the battery swapping interface along the X, Y, and Z axes in the coordinate system of the robotic arm's end effector, obtained from the LiDAR calculations. These represent the three-dimensional attitude angles of the battery swapping interface around the X, Y, and Z axes in the coordinate system of the robotic arm's end effector, calculated by the LiDAR. Furthermore, the perception confidence score and the binocular vision confidence score are calculated based on the real-time data quality of each sensor. The confidence level of a 2D LiDAR is calculated by comprehensively considering factors such as image sharpness, the number of effectively extracted feature points, and feature point matching accuracy. The result is calculated by comprehensively considering factors such as point cloud data density, noise ratio, and the number of effectively extracted geometric feature points, and it also satisfies the normalization constraint. Then, a weighted linear fusion algorithm is used to fuse the position and attitude separately. The position fusion formula is as follows: The attitude fusion formula is: Integrate location fusion results pose fusion results Real-time fused pose estimation of the vehicle-side battery swapping interface relative to the coordinate system of the battery swapping robotic arm's end effector. .

[0061] S102. The real-time fused pose estimation and six-dimensional force sensor data are processed by fuzzy adaptive impedance control to generate Cartesian space compliant motion commands for driving the end effector of the battery swapping robot arm.

[0062] Specifically, using real-time fusion pose estimation and real-time contact force / torque data collected by a six-dimensional force sensor as input, a fuzzy adaptive impedance control algorithm is applied to generate Cartesian space compliant motion commands. This establishes a dynamic mapping relationship between the pose of the end effector of the battery swapping robotic arm and the contact force / torque, achieving compliant force-position coupling. The fuzzy adaptive impedance control, based on traditional impedance control, adjusts impedance parameters in real-time through a fuzzy logic system to adapt to the changing contact conditions during battery swapping. For example, the real-time contact data collected by the six-dimensional force sensor is... ,in These represent the three-dimensional contact forces generated along the X, Y, and Z axes of the robotic arm's end-effector coordinate system during the contact process at the battery swapping interface. These are the three-dimensional contact torques generated around the X, Y, and Z axes of the robotic arm end coordinate system during the contact process of the battery swapping interface.

[0063] Optionally, the desired dynamic model for impedance control can be set as follows: ,in, Let be the desired inertia matrix, and be a diagonal positive definite matrix whose diagonal elements correspond to the Cartesian spaces X, Y, Z, ... , , The expected inertia coefficients for six degrees of freedom This is the actual acceleration vector of the robotic arm's end effector, including three-dimensional linear acceleration and three-dimensional angular acceleration. The desired acceleration vector is derived from the real-time fused pose estimation. The result is obtained by performing a second-order differential operation with respect to time. Let be the desired damping matrix, and be a diagonal positive definite matrix, whose diagonal elements correspond to the desired damping coefficients of the six degrees of freedom in Cartesian space. This is the actual velocity vector of the robotic arm's end effector, including three-dimensional linear velocity and three-dimensional angular velocity. The desired velocity vector is derived from the real-time fused pose estimation. The first-order differential of time is obtained as follows: Let be the desired stiffness matrix, and be a diagonal positive definite matrix, whose diagonal elements correspond to the desired stiffness coefficients of the six degrees of freedom in Cartesian space. This is the actual pose vector of the robotic arm's end effector. The desired pose vector is obtained from the real-time fused pose estimation. Direct assignment, Let the contact force error vector be the expected contact force vector. With actual contact force vector We get the result by subtraction, i.e. , The six-degree-of-freedom expected contact force / torque threshold vector is preset for the battery swapping docking process. Its value is determined based on the mechanical structural strength, material properties and docking process requirements of the battery swapping interface.

[0064] Contact force error vector and the vector of the rate of change of contact force error As input to a fuzzy logic system From the contact force error vector The desired inertia matrix is ​​obtained by performing a first-order differential operation on time. Desired damping matrix Desired stiffness matrix The correction value is used as the output of the fuzzy logic system. The universe of discourse, fuzzy subsets, and membership functions of the fuzzy logic system are designed based on the actual working conditions and control accuracy requirements of the battery swapping connection. Specifically, the precise input quantity is converted into a fuzzy quantity through fuzzification, then inference is performed using preset fuzzy inference rules, and finally, the fuzzy quantity obtained through defuzzification is converted into a precise impedance parameter correction value. This correction value is then superimposed with the initial impedance parameter value to obtain the real-time adaptive impedance parameter. By substituting the real-time adaptive impedance parameters into the desired dynamic model of impedance control and solving the inverse kinematics, the desired velocity and acceleration commands of the robotic arm's end effector in Cartesian space are obtained. These two types of commands are then integrated to generate Cartesian space compliant motion commands for driving the end effector of the battery-swapping robotic arm. .

[0065] S103. Based on the fusion target pose data, original control commands and final residual alignment error data sequence from historical battery swapping operations, a pre-trained long short-term memory network is used to predict and generate a real-time error compensation amount to compensate for the long-term drift error of the system.

[0066] Furthermore, the long-term drift error of the system is mainly caused by factors such as mechanical wear of the battery swapping robotic arm and end effector, drift of the binocular vision camera calibration parameters, sensor zero drift, and changes in mechanical transmission clearance. The time-series data sequence of historical battery swapping operations includes fused target pose data. Original control commands and final residual alignment error data , This is the sequence number of the historical battery swapping operation, and , The total number of historical battery swapping operations is fused with target pose data. For the first In this battery swapping operation, the preset target fusion pose of the vehicle-side battery swapping interface and the end effector of the battery swapping robotic arm, and the original control commands For the first The Cartesian space compliant motion command without error compensation was used in the second battery swap operation, resulting in residual alignment error data. For the first After the battery swapping operation is completed, the six-degree-of-freedom residual error between the actual alignment pose and the target pose of the vehicle-end battery swapping interface and the end effector of the robotic arm is obtained. The six-degree-of-freedom residual error is detected in real time by the multimodal weighted fusion perception system and includes three-dimensional position residual error and three-dimensional attitude residual error.

[0067] The historical time-series data sequence is first preprocessed; for example, by using... The criteria identify and remove outliers from the data, and then normalization is used to eliminate dimensional differences in the data across dimensions. The Long Short-Term Memory (LSTM) network structure includes an input layer, hidden layers, and an output layer. The number of neurons in the input layer is determined by the total dimension of the fused target pose data, original control commands, and final residual alignment error data. The hidden layer uses multiple LSTM units, each of which extracts temporal features of historical data and learns long-term dependencies through gating mechanisms such as input gates, forget gates, and output gates. The number of neurons in the output layer is consistent with the dimension of the six-degree-of-freedom error compensation. Optionally, the preprocessed historical data sequence is divided into training and test sets according to a preset ratio, using mean squared error as the loss function. The loss function formula is... ,in, The value of the loss function. This represents the number of samples in the training set. The residual alignment error predicted by the network. The actual final residual alignment error is used to iteratively optimize the network's weights and bias parameters using the stochastic gradient descent algorithm until the loss function value converges to a preset threshold, thus completing the network pre-training. The test set is used to verify the network's generalization ability.

[0068] S104. Generate battery swapping robot arm drive commands based on Cartesian space compliant motion commands and real-time error compensation; the battery swapping robot arm drive commands are used to instruct the multi-degree-of-freedom actuators of the battery swapping robot arm to perform alignment and insertion / removal operations of the battery swapping interface.

[0069] Optionally, the real-time error compensation amount for the six degrees of freedom can be adjusted. Perform a first-order differential operation on time to convert the pose compensation amount into a velocity compensation command in Cartesian space. The conversion formula is: ,in, For speed compensation commands, The first derivative of the real-time error compensation with respect to time. The Cartesian space compliant motion command. With speed compensation command By performing vector superposition, the compensated Cartesian space motion command is obtained. The superposition formula is: The compensated motion command integrates the dynamic adjustment characteristics of compliant control and the compensation characteristics of long-term drift error, resulting in higher control accuracy and adaptability to different operating conditions. The compensated Cartesian space motion command... The motion controller of the battery-swapping robotic arm inputs six degrees of freedom motion commands in Cartesian space, which are then converted into joint space motion commands for each joint of the robotic arm using an inverse kinematics (IK) algorithm. The IK is based on the DH parameter model of the robotic arm, which includes the link length, link twist angle, joint offset, and joint angle for each joint. A homogeneous transformation matrix is ​​used to establish the pose mapping relationship between the end effector coordinate system and the base coordinate system. The formula for the homogeneous transformation matrix is ​​as follows: ,in, For the first The link is relative to the first Homogeneous transformation matrix of the links For the first The joint angles of each joint. For the first The torsion angle of each link For the first The length of each link For the first The offset of each joint is obtained by converting the homogeneous transformation matrix of each link in series to obtain the overall homogeneous transformation matrix of the end effector relative to the base coordinate system. Furthermore, the expected joint angle and joint angular velocity of each joint are obtained by solving the inverse matrix, which is the joint space motion command.

[0070] The joint space motion commands are converted from digital to analog, generating electrical signals as drive commands for the battery swapping robotic arm. These commands contain the drive parameters for each degree of freedom actuator of the robotic arm, corresponding to the motion control requirements of the multi-degree-of-freedom actuators such as the rotary joints and translational joints. After receiving the drive commands, the drive module of the battery swapping robotic arm converts the electrical signals into drive power for each actuator, driving the multi-degree-of-freedom actuators to complete the corresponding joint movements as required by the commands. This drives the end effector to move towards the battery swapping interface at the vehicle end, achieving high-precision alignment of the battery swapping interface. After alignment, the battery swapping robotic arm continues to control the motion trajectory and contact force of the end effector according to the drive commands, performing the insertion and removal of the battery swapping interface to complete the automatic docking of the battery box with the vehicle's battery swapping interface.

[0071] In the aforementioned machine learning-based optimization method for electric heavy-duty truck battery swapping interfaces, multi-source data from binocular vision images, six-dimensional force sensors, and two-dimensional lidar are simultaneously acquired. Multimodal weighted fusion perception processing generates a real-time fused pose estimate of the vehicle-side battery swapping interface relative to the end-effector coordinate system of the battery swapping robotic arm. Fuzzy adaptive impedance control is used to collaboratively process this real-time fused pose estimate with the six-dimensional force sensor data to generate Cartesian space compliant motion commands to drive the end-effector of the robotic arm. Based on the fused target pose data from historical battery swapping operations, the original control commands, and the final residual alignment error data sequence, a pre-trained long short-term memory network predicts and generates real-time error compensation for the system's long-term drift error. Combining the Cartesian space compliant motion commands with the real-time error compensation, drive commands for the battery swapping robotic arm are generated, driving the multi-degree-of-freedom actuator to complete interface alignment and insertion / removal operations. Ultimately, this achieves high perception robustness of battery swapping operations under complex conditions, safe, compliant, and efficient docking processes, and high-precision self-optimization and low-maintenance requirements for long-term system operation.

[0072] In one embodiment, multimodal weighted fusion perception processing is performed on binocular vision image data and two-dimensional LiDAR point cloud data to generate a real-time fused pose estimate of the vehicle-side battery swapping interface relative to the coordinate system of the battery swapping robotic arm end effector, including:

[0073] S201. Preprocess and detect feature points on the binocular vision image data to obtain the pixel coordinates of the interface identifier point matching the left and right images. Based on the pixel coordinates of the interface identifier point and the camera calibration parameters, calculate the estimated visual pose of the interface in the visual sensor coordinate system through triangulation and the Perspective-n-Point algorithm.

[0074] To illustrate, a systematic preprocessing method is used for binocular vision image data. First, Gaussian filtering algorithm is used to denoise the image and suppress the interference of random noise on feature extraction. Then, adaptive histogram equalization method is used to enhance image contrast and improve the distinction between interface markers and background.

[0075] A deep learning-based feature point detection network is used to detect feature points in the preprocessed left and right binocular images. This network learns the geometric and grayscale distribution features of the battery swapping interface markers through offline pre-training. During online detection, it can accurately identify preset high-reflectivity markers or inherent interface corner points, outputting a set of pixel coordinates for each feature point in the left and right images. Specifically, stereo matching is performed on the feature points of the left and right images. A feature descriptor-based matching strategy is adopted, calculating the descriptor similarity between each feature point in the left image and candidate feature points in the right image. The point pairs with the highest similarity and satisfying the bidirectional matching constraint are selected as valid matching point pairs, resulting in a set of pixel coordinates for the matched interface markers. ,in For the first The pixel coordinates of the marker points in the left image For the first The pixel coordinates of the marker points in the right image. This is the identifier number.

[0076] Camera calibration parameters include intrinsic parameter matrix and extrinsic parameter matrix Intrinsic parameter matrix Characterizing the optical properties and imaging geometry of a binocular camera, i.e. ,in, and The camera in the image shaft and Effective focal length in the axial direction, and These represent the offsets of the image coordinate system origin in the pixel coordinate system; the extrinsic parameter matrix. Characterizes the pose relationship between the vision sensor coordinate system and the end effector coordinate system of the battery swapping robot, including the rotation matrix. Translation vector ,Right now .

[0077] By combining the matched set of pixel coordinates with the camera calibration parameters, the three-dimensional coordinates of the marker point in the visual sensor coordinate system are solved using the principle of triangulation. ,in For the first The three-dimensional coordinates of each marker point in the visual sensor coordinate system For triangulation, the solution function is... This represents the baseline length of the binocular camera.

[0078] The 3D coordinates of all marker points are input into the Perspective-n-Point algorithm. Using the 3D coordinates of the marker points in the visual sensor coordinate system and their corresponding pixel coordinates as input, the algorithm solves for the pose transformation matrix of the vehicle-side battery swapping interface relative to the visual sensor coordinate system. The pose transformation matrix contains rotation and translation information. The optimal solution is obtained by iteratively optimizing and minimizing the reprojection error, ultimately outputting the visual pose estimate. ,in, This is the rotation matrix of the vehicle-side battery swapping interface relative to the vision sensor coordinate system, used to describe the attitude relationship. This is the translation vector of the vehicle-side battery swapping interface relative to the visual sensor coordinate system, used to describe the positional relationship.

[0079] S202. Cluster and extract line segment features from the two-dimensional lidar point cloud data to obtain point cloud features. Iteratively register the point cloud features with the pre-built standard model of electric heavy truck chassis to obtain lidar pose estimation values. The lidar pose estimation values ​​include the horizontal position deviation and yaw angle deviation of the interface along the battery swapping track direction.

[0080] Optionally, the point cloud data acquired by the 2D LiDAR is preprocessed. First, a statistical filtering algorithm is used to remove outliers, retaining only valid point cloud data. Then, the preprocessed valid point cloud data is clustered using an Euclidean clustering algorithm. Points with a distance less than a preset clustering threshold are grouped into the same cluster to eliminate background interference. Line segment features are extracted from the separated chassis point cloud clusters using a random sampling consensus algorithm. A line segment model is fitted by randomly selecting sample points from the point set, and the distance from other points to this model is calculated. Points with a distance less than a threshold are identified as inliers. The optimal line segment feature is obtained through iterative optimization. This line segment feature corresponds to the critical edge structure of the chassis and reflects the positional distribution of the interface along the battery swapping track.

[0081] The standard model of the electric heavy-duty truck chassis is constructed based on the design drawings or measured data of the electric heavy-duty truck chassis, and includes the three-dimensional coordinate information of the key contours of the chassis. For example, an iterative nearest-point algorithm is used for point cloud registration. The line segment feature point cloud extracted by the LiDAR is initially aligned with the corresponding feature point cloud of the standard model. In each iteration, the nearest point in the standard model is searched for each point in the LiDAR point cloud, constructing a set of point pairs. The optimal rigid transformation matrix is ​​solved based on the set of point pairs. This matrix contains translation and rotation components, used to correct the pose deviation between the LiDAR point cloud and the standard model. The above process is iteratively executed until the registration residual is less than a preset convergence threshold, completing the registration operation.

[0082] The horizontal position deviation along the battery swapping track direction is extracted using the rigid transformation matrix obtained through registration. and yaw angle deviation Both of these constitute the lidar pose estimation value. The horizontal position deviation is one of them. The yaw angle deviation represents the offset of the vehicle-side battery swapping interface relative to its standard position along the battery swapping track direction. This characterizes the rotational offset of the vehicle-side battery swapping interface around a plane perpendicular to the battery swapping track.

[0083] S203. Based on the average gradient value of the image, the number of interface identifier matching points, and the average reprojection error of feature points from the binocular vision image data, the real-time first reliability weight of the visual perception channel is calculated. Based on the number of matching point pairs and the registration residual of the iterative point cloud registration, the real-time second reliability weight of the lidar perception channel is calculated.

[0084] Optional, image average gradient value By calculating the grayscale values ​​of image pixels and The average gradient magnitude in the direction is used to characterize image sharpness; a higher gradient value indicates richer image details and stronger reliability of feature extraction; the number of interface marker points matched. The number of effectively matched marker pairs in the binocular image represents the number of matches. A higher number of matches indicates greater redundancy in the visual data and stronger stability in pose calculation. The mean reprojection error of feature points represents the average value of the feature point reprojection error. The reprojection error is the average of the Euclidean distances between the pixel coordinates of all matched marker points after reprojection from 3D spatial coordinates to the 2D image plane and the actual detected pixel coordinates. A smaller reprojection error indicates higher accuracy in pose calculation. First reliability weight. The calculation expression is as follows ,in , , Let be the weighting coefficient, satisfying ; This is the image gradient threshold, used to distinguish between sharp and blurry images; The total number of preset marker points for the interface; To prevent extremely small positive numbers with a denominator of zero, their values ​​are much smaller than the minimum possible value of the mean reprojection error.

[0085] Number of matching point pairs The number of valid point pairs constructed in each iteration of the iterative nearest-point registration process represents the total number of matching point pairs. A higher number of matching point pairs indicates a higher degree of overlap between the LiDAR point cloud and the standard model; the registration residual represents the total number of valid point pairs constructed in each iteration of the iterative nearest-point registration process. This is the average Euclidean distance between all matched point pairs after registration. A smaller registration residual indicates higher registration accuracy. Second reliability weight. The calculation expression is as follows ,in , Let be the weighting coefficient, satisfying ; A threshold for the number of matching point pairs is used to distinguish between valid and invalid registrations; To prevent extremely small positive numbers with a denominator of zero, their values ​​are much smaller than the minimum possible value of the registration residual.

[0086] S204. Based on the Kalman filter with the interface pose as the state variable, the visual pose estimate and the lidar pose estimate are used as observation inputs. Combined with the adjustment factor of the observation noise covariance matrix transformed by the first reliability weight and the second reliability weight, Kalman filtering is performed to obtain the real-time fused pose estimate.

[0087] Specifically, define the system state vector. ,in , , These are the three-dimensional position components of the vehicle-side battery swapping interface relative to the coordinate system of the end effector of the battery swapping robotic arm. , , These represent the three-dimensional attitude angles of the vehicle-end battery swapping interface relative to the coordinate system of the battery swapping robotic arm's end effector: roll angle, pitch angle, and yaw angle. The system state equation is as follows: ,in, For the first The state vector at time t, For the first The state vector at time t, The state transition matrix is ​​set as an identity matrix because the interface pose change during the battery swapping docking process satisfies the rigid body motion characteristics. , Let be the process noise vector, which follows a function with zero mean and a covariance matrix of... Gaussian distribution, Let be the process noise covariance matrix, used to characterize the uncertainty of the system model. The system observation equation is: ,in For the first The observation vector at time step is obtained by integrating the visual pose estimate and the lidar pose estimate, i.e. , For the first The visual observation vector at time step 1 corresponds to the position and attitude parameters of the visual pose estimate. For the first The lidar observation vector at time 1 corresponds to the horizontal position deviation and yaw angle deviation of the lidar pose estimation value. The remaining components are supplemented with zero padding to match the dimension of the state vector. The observation matrix is ​​used to establish a linear mapping relationship between the state vector and the observation vector. It is calibrated based on the installation position and measurement principle of the vision sensor and lidar. The observed noise vector follows a pattern with zero mean and a covariance matrix of... Gaussian distribution, To observe the noise covariance matrix.

[0088] Observation noise covariance matrix The adjustment is based on a first reliability weight and a second reliability weight, i.e. ,in, The inherent noise variance of the visual sensor characterizes the inherent uncertainty of visual measurements; The inherent noise variance of the lidar represents the inherent uncertainty in lidar measurements. For the first The first reliability weight at any given moment For the first The second reliability weight at each time step. When the reliability weight of a certain sensing channel decreases, the corresponding observation noise variance increases, and the weight of that channel in the fusion process automatically decreases; when the reliability weight increases, the corresponding observation noise variance decreases, and the weight of that channel in the fusion process automatically increases, thus achieving adaptive adjustment of the observation noise covariance matrix.

[0089] The prediction and update processes of the Kalman filter are repeated, and the visual pose estimate and the LiDAR pose estimate are fused in real time at each time step. The final output is the posterior state estimate. This refers to the real-time fused pose estimation of the vehicle-side battery swapping interface relative to the coordinate system of the battery swapping robotic arm's end effector.

[0090] In one embodiment, based on the average gradient value of the binocular vision image data, the number of matched interface marker points, and the average reprojection error of feature points, a real-time first reliability weight for the visual perception channel is calculated. Then, based on the number of matched point pairs and the registration residual from iterative point cloud registration, a real-time second reliability weight for the lidar perception channel is calculated, including:

[0091] The real-time first reliability weight is obtained using the following formula:

[0092]

[0093] in, As the first reliability weight in real time; The average gradient value of the image; Image sharpness threshold; Match the number of interface identifiers; This represents the total number of interface identifiers. and The first The reprojection coordinates of each feature point and the coordinates of the binocular vision image; , and These are weighting coefficients; To prevent small amounts from being divided by zero;

[0094] The real-time second reliability weight is obtained using the following formula:

[0095]

[0096] in, As the second reliability weight in real time; To match the number of point pairs, The threshold for the number of matching point pairs; To register residuals; To prevent small amounts from being divided by zero; and These are the weighting coefficients.

[0097] For example, Logistic functions can be used. , The gain coefficient maps the difference between the average gradient value of the image and the sharpness threshold to... The range is used to avoid excessive influence of fluctuations in the value of a single indicator on the weight calculation; For the first The reprojection coordinates of a feature point are the pixel coordinates obtained by back-projecting the three-dimensional spatial coordinates of the feature point obtained by triangulation, combined with the camera intrinsic parameter matrix, onto the two-dimensional image plane. For the first The binocular vision image coordinates of each feature point are obtained by directly detecting the pixel coordinates in the binocular image through a feature point detection network. The mean reprojection error of feature points is obtained by calculating the Euclidean distance between the reprojection coordinates of all matched feature points and the measured image coordinates, and then taking the arithmetic mean of all distance values. This value directly reflects the accuracy of visual pose estimation. The smaller the value, the better the consistency between the mapping of 3D coordinates and 2D image. It can be expressed in the form of a hyperbolic tangent function. To map the difference between the number of matching point pairs and the threshold to Interval and normalized to This is to avoid drastic fluctuations in the number of matching point pairs that could lead to distorted weight calculations.

[0098] In one embodiment, fuzzy adaptive impedance control is used to process real-time fused pose estimation and six-dimensional force sensor data to generate Cartesian space compliant motion commands for driving the end effector of the battery swapping robotic arm, including:

[0099] S301. Based on real-time fusion pose estimation and the actual pose of the end effector of the battery swapping robot, the current Cartesian space pose tracking error vector is calculated, and the norm of the Cartesian space pose tracking error vector is normalized to obtain the first fuzzy input.

[0100] To illustrate, the actual pose of the battery-swapping robotic arm's end effector can be obtained by combining real-time joint angle data collected by encoders at each joint of the robotic arm with the arm's DH parameter model and performing forward kinematics calculations. This results in a three-dimensional position component along the X, Y, and Z axes of Cartesian space and a three-dimensional attitude angle component around the X, Y, and Z axes, forming the actual pose vector. Real-time fused pose estimation is used as the desired pose vector. Cartesian space pose tracking error vector It is calculated by the difference between the desired pose vector and the actual pose vector, i.e. .

[0101] Furthermore, the pose tracking error vector is calculated. The Euclidean norm, the norm calculation expression is: ,in These represent the positional error components of the error vector along the X, Y, and Z axes, respectively. These are the attitude error components of the error vector around the X, Y, and Z axes, respectively. The norm of this vector is normalized, and a linear normalization method is used to map it to... The interval is used to obtain the first fuzzy input quantity. The normalization formula is ,in This represents the minimum pose error norm that may occur during battery swapping operations. The normalization process, which uses the preset maximum allowable pose error norm, aims to adapt the input quantity to the input domain of the fuzzy inference engine, thereby ensuring inference accuracy.

[0102] S302. Normalize the vector norm of the contact force data in the six-dimensional force sensor data to obtain the second fuzzy input quantity.

[0103] Indicatively, the contact force data collected by the six-dimensional force sensor is extracted, i.e. ,in These are the line contact force components along the X, Y, and Z axes of Cartesian space, respectively. These are the contact torque components about the X, Y, and Z axes of Cartesian space, respectively. Calculate the vector Euclidean norm of this contact force data; the norm calculation expression is as follows: Similarly, the linear normalization method is used to map it to... The interval is used to obtain the second fuzzy input quantity. The normalization formula is ,in This is the minimum contact force norm during the non-contact phase or slight contact. To determine the maximum contact force norm allowed by the structural strength of the battery swapping interface, normalization is used to ensure that the domain of discourse of the second fuzzy input is consistent with that of the first fuzzy input, thereby ensuring the input synergy of the fuzzy inferencer.

[0104] S303. Input the first fuzzy input and the second fuzzy input into the fuzzy inferencer based on the fuzzy rule base to obtain the stiffness adjustment factor and the damping adjustment factor; the expression of the fuzzy inferencer is: ,in, For the first fuzzy input quantity, This is the second fuzzy input quantity. For the power of expectation, , and For real-time impedance parameters, , , The nominal Cartesian stiffness matrix, The nominal Cartesian damping matrix, This is the stiffness adjustment factor. This is the damping adjustment factor.

[0105] Specifically, the fuzzy rule base covers impedance parameter adjustment strategies under different combinations of positional errors and contact forces during the battery swapping process. The division of fuzzy subsets is determined based on the control accuracy requirements and operating condition distribution characteristics of the battery swapping operation.

[0106] For example, The desired contact force vector is a six-dimensional vector preset based on the mechanical structural strength, material elastic modulus, and docking process requirements of the battery swapping interface. It includes the desired line contact force and the desired contact torque, and is used to limit the optimal contact load range during the docking process. The desired inertia matrix is ​​a diagonal positive definite matrix, whose diagonal elements correspond to the desired inertia coefficients of the six degrees of freedom in Cartesian space. The values ​​are determined based on the equivalent mass and moment of inertia of the robotic arm end effector and the battery-swapping gun, and are used to simulate the inertial characteristics of the system. It is a real-time adaptive damping matrix used to adjust the damping characteristics of the system and adapt to different contact conditions; It is a real-time adaptive stiffness matrix used to adjust the stiffness characteristics of the system and balance docking speed and compliance; The nominal Cartesian damping matrix is ​​a diagonal positive definite matrix, whose diagonal elements correspond to the initial damping coefficients of the six degrees of freedom, which serve as the reference for damping adjustment. The nominal Cartesian stiffness matrix is ​​a diagonal positive definite matrix, whose diagonal elements correspond to the initial stiffness coefficients of the six degrees of freedom, serving as the benchmark for stiffness adjustment. This is the stiffness adjustment factor, one of the outputs of the fuzzy inference engine. It is a non-negative scalar used to dynamically correct the nominal damping matrix. The damping adjustment factor is another output of the fuzzy inference engine. It is a non-negative scalar used to dynamically correct the nominal stiffness matrix. This is the first-order time derivative of the pose tracking error vector, i.e., the error rate of change vector, which reflects the changing trend of pose deviation. This is the second-order time derivative of the pose tracking error vector, i.e., the error acceleration vector, which reflects the rate of change of pose deviation.

[0107] The first fuzzy input With the second fuzzy input After inputting into the fuzzy inference engine, the precise input quantities are converted into fuzzy quantities using a membership function. Then, fuzzy inference operations are performed based on the fuzzy rule base. The inference process adopts the Mamdani inference method, and the fuzzy output quantities of the stiffness adjustment factor and damping adjustment factor are obtained through fuzzy relation synthesis. Finally, the centroid method or the maximum membership method is used for defuzzification to obtain the precise stiffness adjustment factor. With damping adjustment factor .

[0108] S304. Multiply the nominal Cartesian stiffness matrix by the stiffness adjustment factor scalar to obtain the real-time adaptive stiffness matrix, and multiply the nominal Cartesian damping matrix by the damping adjustment factor scalar to obtain the real-time adaptive damping matrix.

[0109] Nominal Cartesian stiffness matrix It is a 6×6 diagonal positive definite matrix, whose diagonal elements Corresponding to Cartesian space X, Y, Z respectively , , Initial stiffness coefficients for the six degrees of freedom. The nominal Cartesian stiffness matrix. With stiffness adjustment factor Perform scalar multiplication, that is, multiply each element in the matrix by... Multiplying them together yields the real-time adaptive stiffness matrix. The operation expression is The matrix follows It adapts to dynamic changes and optimizes stiffness characteristics under different working conditions.

[0110] Nominal Cartesian damping matrix It is a 6×6 diagonal positive definite matrix, whose diagonal elements These correspond to the initial damping coefficients for the six degrees of freedom in Cartesian space. The nominal Cartesian damping matrix is ​​then... With damping adjustment factor Perform scalar multiplication, that is, multiply each element in the matrix by... Multiplying them together yields the real-time adaptive damping matrix. The operation expression is The matrix follows It adapts to dynamic changes to optimize damping characteristics under different working conditions, and works in conjunction with the real-time adaptive stiffness matrix to ensure the dynamic response and compliance of the system.

[0111] S305. Based on the real-time adaptive stiffness matrix, real-time adaptive damping matrix, Cartesian space pose tracking error vector, contact force data, and desired contact force, the Cartesian space compliance adjustment velocity vector is calculated using the admittance control principle. This Cartesian space compliance adjustment velocity vector is then vector-superimposed with the proportional control velocity vector based on the Cartesian space pose tracking error vector to obtain the Cartesian space compliance motion command. The expression for the Cartesian space compliance motion command is: Wherein, the Cartesian space compliant adjustment velocity vector is The expected pose correction amount corresponding to the pose tracking error vector in Cartesian space. , For proportional control of the velocity vector, This is the velocity proportional gain matrix.

[0112] For example, The velocity proportional gain matrix is ​​a 6×6 diagonal positive definite matrix, whose diagonal elements correspond to the velocity proportional gain coefficients of the six degrees of freedom in Cartesian space, and are used to adjust the response sensitivity of the compliant adjustment velocity. It is the inverse of the real-time adaptive stiffness matrix, used to convert force signals into pose correction signals; This is the contact force deviation vector, reflecting the difference between the actual contact force and the expected contact force; This is the damping force term, used to simulate the damping loss of the system and suppress velocity fluctuations.

[0113] The inverse of the desired inertia matrix is ​​used to adjust the inertial response characteristics of the system. The proportional control velocity vector based on the Cartesian space pose tracking error vector is obtained through a proportional control algorithm, expressed as: ,in This is a proportional control gain matrix used to quickly reduce pose tracking errors and improve the position control accuracy of the system.

[0114] Specifically, in the contactless phase, The amplitude is small. Primarily using proportional control, the end effector is driven to rapidly approach the target pose; during the contact phase, It plays a leading role, achieving smooth control of contact force through dynamic speed adjustment, avoiding interface jamming or component damage, and ultimately ensuring high precision and high reliability of the battery swapping interface docking process.

[0115] In one embodiment, the fuzzy linguistic variables of the first fuzzy input quantity include large, medium, and small; the fuzzy linguistic variables of the second fuzzy input quantity are zero, small, and large.

[0116] The fuzzy rule base is constructed using the following methods:

[0117] S41. When the first fuzzy input quantity is large and the second fuzzy input quantity is zero, the stiffness adjustment factor is high and the damping adjustment factor is medium.

[0118] The fuzzy language variables of the first fuzzy input quantity are divided into three fuzzy sets: "large", "medium", and "small". Each fuzzy set is based on the domain of the first fuzzy input quantity Through the definition of the objective function, the objective function adopts a triangular membership function or a Gaussian membership function. Schematically, if a triangular membership function is selected, the triangular function expression of the "large" fuzzy set is , where is the starting point of the "large" set, is the peak point, is the ending point, satisfying ; the expression of the "medium" fuzzy set is , satisfying ; the expression of the "small" fuzzy set is , satisfying .

[0119] The fuzzy language variables of the second fuzzy input quantity are divided into three fuzzy sets: "zero", "small", and "large", also based on the domain Through the definition of the objective function. When a triangular membership function is selected, the expression of the "zero" fuzzy set is , where is the starting point, is the peak point, is the ending point, satisfying ; the expression of the "small" fuzzy set is , satisfying ; the expression of the "large" fuzzy set is , satisfying . If a Gaussian membership function is selected, its general expression is , where is the central value of the membership function, is the standard deviation, and the and of each fuzzy set are calibrated through offline experiments to ensure that the distribution of the fuzzy sets within the domain can accurately distinguish different working conditions.

[0120] ​​Maintaining a larger value enhances the system's sensitivity to position deviations, driving the end effector to quickly approach the target pose; a damping adjustment factor of "medium" balances the system's dynamic response speed and motion stability, avoiding motion oscillations caused by high stiffness, ensuring the stability of the end effector's attitude during rapid approach, and laying the foundation for smooth docking in the subsequent contact phase.

[0121] S42. When the first fuzzy input is small and the second fuzzy input is small, the stiffness adjustment factor is medium and the damping adjustment factor is medium.

[0122] For example, a "small" first fuzzy input indicates that the end effector is close to the target pose, and the pose tracking error is within a small range. At this point, there is no need to pursue the ultimate approach speed; instead, the focus should be on docking accuracy. A "small" second fuzzy input indicates that the end effector has made slight contact with the battery swapping interface, and the contact force amplitude is within a safe range, not yet reaching the point where significant adjustments to compliance are needed. A "medium" stiffness adjustment factor retains a certain level of position tracking accuracy while avoiding a rapid increase in contact force due to excessive stiffness. A "medium" damping adjustment factor maintains appropriate damping characteristics of the system. On the one hand, it suppresses small oscillations of the end effector, ensuring the ability to finely adjust the pose. On the other hand, it reserves buffer space for the slow increase of contact force, achieving a smooth transition from non-contact rapid approach to fine contact docking, ensuring the alignment accuracy of the battery swapping interface under conditions of small deviation and small contact force.

[0123] S43. When the second fuzzy input is large, both the stiffness adjustment factor and the damping adjustment factor are low.

[0124] When the second fuzzy input is "large," regardless of whether the first fuzzy input is in the "large," "medium," or "small" state, the stiffness adjustment factor and damping adjustment factor are both triggered to be low. A "large" second fuzzy input indicates that the contact force amplitude between the end effector and the battery swapping interface has approached or reached the maximum allowable threshold of the interface's structural strength. Maintaining a high stiffness could lead to excessive contact force, causing risks such as interface jamming, component deformation, or even damage. In this case, the core control objective shifts to rapidly reducing the contact force to ensure the safety of the docking process. A "low" stiffness adjustment factor enables real-time adaptive stiffness matrix adjustment. The value of the damping adjustment factor is significantly reduced, the system's sensitivity to position deviation is decreased, and the end effector exhibits good compliance, which can appropriately "yield" under the action of contact force to avoid rigid collisions. The "low" damping adjustment factor further enhances the system's compliant response, reduces the obstruction of damping force to contact force buffering, and enables the end effector to respond quickly to changes in contact force. It can release excessive contact load through small position adjustments until the contact force drops to a safe range, effectively avoiding failures caused by excessive contact force at the battery swapping interface and ensuring the reliability of the battery swapping docking process.

[0125] S44. The objective function is used to fuzzify the fuzzy set, and the centroid method is used to defuzzify the output of the fuzzy inference engine to obtain the scalar values ​​of the stiffness adjustment factor and the damping adjustment factor; the objective function is a triangular function or a Gaussian membership function; the fuzzy set includes the first fuzzy input, the second fuzzy input, the stiffness adjustment factor, and the damping adjustment factor.

[0126] Furthermore, during the fuzzification process, the first fuzzy input quantity, after real-time acquisition and normalization... Second fuzzy input Each fuzzy input variable is assigned a membership degree value to each fuzzy set using its corresponding membership function. For example, for the first fuzzy input variable... ,calculate , , The membership distribution of the input is obtained on the three fuzzy sets; similarly, the second fuzzy input is calculated. Membership distribution on the sets "zero", "small", and "large" , , .

[0127] Fuzzy inference employs the Mamdani inference method, which calculates the trigger strength of each rule based on the minimum membership degree from the rules in the fuzzy rule base. For example, the trigger strength... Trigger strength Triggering strength ).

[0128] The trigger strength of each rule is used to trim the membership function of the corresponding output fuzzy set, obtaining the output fuzzy subset of each rule. The membership degrees of the fuzzy subsets of the same output variable for all rules are superimposed, and the largest value is used to obtain the final output fuzzy set. (Optional) For the stiffness adjustment factor, the defuzzification formula is: ,in, This represents the minimum value of the stiffness adjustment factor. To maximize the value, the integration interval covers the entire range of the stiffness adjustment factor; the numerator is... With membership function The integral of the product over the interval of integration, with the denominator being the membership function. The integral over the integration interval. The unfuzzy formula for the damping adjustment factor is: ,in, This represents the minimum value of the damping adjustment factor. This represents the maximum possible value.

[0129] In one embodiment, the Long Short-Term Memory network is trained using the following method:

[0130] S51. After each insertion / removal operation is completed, collect the fused target pose data, Cartesian space compliant motion command before the insertion / removal contact occurs, and six-degree-of-freedom residual alignment error data measured after physical locking through the micro-switch array built into the interface to obtain data samples, and store the data samples in the circular buffer database in chronological order.

[0131] Schematic illustration: The fused target pose data is a real-time fused pose estimate taken just before the insertion / removal contact occurs. This data is output by the multimodal weighted fusion sensing module and includes six degrees of freedom information of the vehicle-side battery swapping interface relative to the end effector coordinate system of the battery swapping robotic arm, namely, the three-dimensional position components along the X, Y, and Z axes and the three-dimensional attitude angular components around the X, Y, and Z axes, forming a 6-dimensional vector. The position component represents the spatial position coordinates of the interface, and the attitude angle component represents the spatial attitude state of the interface. This data reflects the final estimation result of the target pose by the system before the insertion and removal operation.

[0132] The Cartesian space compliant motion command is the drive command output by the system instant before the insertion / removal contact occurs, i.e., the previously generated command. It contains six degrees of freedom velocity components, corresponding to three-dimensional linear velocities along the X, Y, and Z axes and three-dimensional angular velocities around the X, Y, and Z axes, forming a 6-dimensional vector. The linear velocity component controls the translational motion of the end effector, while the angular velocity component controls its rotational motion. This data records the system's motion control commands to the end effector before the insertion / removal operation.

[0133] The six-degree-of-freedom residual alignment error data is measured using a micro-switch array built into the battery swapping interface. This array employs a uniform distribution design, arranged along key circumferential, axial, and radial positions of the interface. The number of switches is determined based on the six-degree-of-freedom measurement accuracy requirements, ensuring comprehensive capture of minute pose deviations after physical locking of the interface. Once the battery box and vehicle body battery swapping interface are physically locked, the contact state between the micro-switch array and the interface changes. By detecting the on / off state and trigger stroke of each switch, combined with the preset installation position coordinates of the switches, the six-degree-of-freedom residual alignment error is calculated, forming a 6-dimensional vector. ,in This refers to the residual error in three-dimensional position. The three-dimensional attitude residual error directly reflects the pose deviation of the system that was not corrected in real time after the insertion and removal operation, and is a direct representation of the system's long-term drift error.

[0134] fused target pose data Cartesian space compliant motion instructions and six-degree-of-freedom residual alignment error data Data samples are formed by combining data according to the "input-output" correspondence. Each data sample is timestamped to record the specific time of data collection. All data samples are stored in a circular buffer database in chronological order to ensure that the data in the database always reflects the operating conditions of recent battery swapping operations, providing timely sample support for the training of the Long Short-Term Memory network.

[0135] S52. Based on minimizing the mean square error between the model prediction error and the actual residual error, the long short-term memory network model is trained using data samples from the circular buffer database to obtain the long short-term memory network. The long short-term memory network includes an input layer, a hidden layer based on a gating mechanism, and an output layer.

[0136] Furthermore, mean squared error is used as the loss function to quantify the difference between the model's prediction error and the actual residual error. The loss function formula is as follows: ,in, The value of the loss function. The total number of data samples used in training. Index for degrees of freedom, to Corresponding to the X, Y, and Z positions respectively and , , attitude, For the first The first sample The model predicts residual error for a given number of degrees of freedom. For the first The first sample The true residual error for each degree of freedom is calculated using the formula, which sums the squared errors of all degrees of freedom for all samples and takes the average, thus comprehensively reflecting the overall prediction accuracy of the model.

[0137] In one embodiment, the real-time error compensation amount is used in the feedforward compensation path or the parameter influence path; the feedforward compensation path corresponds to performing Lie algebra addition on the real-time error compensation amount and the real-time fused pose estimation to generate the pre-compensated optimized target pose, which serves as a new benchmark for calculating the Cartesian space pose tracking error vector; the parameter influence path corresponds to using the Euclidean norm and principal direction vector of the real-time error compensation amount as additional features as the third fuzzy input of the fuzzy inferencer.

[0138] Based on the fused target pose data, original control commands, and final residual alignment error data sequence from historical battery swapping operations, a pre-trained long short-term memory network is used to predict and generate real-time error compensation quantities to compensate for long-term drift errors in the system, including:

[0139] The real-time error compensation amount can be obtained using the following formula:

[0140]

[0141] in, This is the amount of real-time error compensation; For Long Short-Term Memory (LSTM) network mapping functions, Indicates the first Data samples from this operation.

[0142] Indicative, The real-time error compensation quantity for the current battery swapping operation is a six-degree-of-freedom pose compensation vector, comprising three-dimensional position compensation components along the X, Y, and Z axes of Cartesian space and three-dimensional attitude compensation components around the X, Y, and Z axes. It is used to quantify long-term drift errors caused by factors such as mechanical wear and calibration drift. The real-time error compensation quantity is integrated into the closed-loop control system through either a feedforward compensation path or a parameter influence path. These two paths can operate independently or in tandem, flexibly selected according to the operating conditions of the battery swapping operation.

[0143] Specifically, the feedforward compensation path incorporates the real-time error compensation into the target pose setting through Lie algebra addition, thereby canceling out the source of the error. Real-time fusion pose estimation is essentially a Lie group. pose transformation matrix in This matrix contains position translation and attitude rotation information, while the real-time error compensation amount Corresponding Lie algebra In vector addition, Lie algebra addition can maintain the geometric consistency of pose transformation and avoid the pose coupling error caused by ordinary vector addition. For example, real-time fusion pose estimation... Convert to Lie algebra vector By Lie algebra addition Obtain the optimized Lie algebra vector Then through exponential mapping Transform it back into the pose matrix in a Lie group, i.e., the optimized target pose after pre-compensation. The optimized target pose will replace the original real-time fused pose estimation as a new benchmark for calculating the Cartesian space pose tracking error vector, so that the pose tracking error is offset from the initial stage, significantly improving the accuracy of pose tracking.

[0144] The parameter influence path uses the feature information of the real-time error compensation amount as an additional input to dynamically adjust the decision logic of the fuzzy inference engine, that is, to calculate the real-time error compensation amount. The Euclidean norm, ; Calculate the principal direction vector of the real-time error compensation quantity by... After normalization, the normalization formula is: ,in To prevent small quantities with zero denominators, the principal direction vector represents the main direction of long-term drift error. The Euclidean norm and the principal direction vector are used as the third fuzzy input, which is input into the fuzzy inference engine along with the existing first and second fuzzy inputs. The fuzzy rule base adds inference rules that include the third fuzzy input. For example, if the norm of the third fuzzy input is large and the principal direction is the X-axis, the stiffness adjustment factor is medium. This allows the fuzzy inference engine to dynamically optimize the output of the stiffness and damping adjustment factors based on the magnitude and direction of the long-term drift error, making impedance control more adaptable to the system's error state and further improving the compliance and accuracy of the docking process.

[0145] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0146] Based on the same inventive concept, this application also provides a machine learning-based electric heavy-duty truck battery swapping interface optimization system for implementing the aforementioned machine learning-based electric heavy-duty truck battery swapping interface optimization method. The solution provided by this system is similar to the implementation scheme described in the above method. Therefore, the specific limitations of one or more machine learning-based electric heavy-duty truck battery swapping interface optimization system embodiments provided below can be found in the limitations of the machine learning-based electric heavy-duty truck battery swapping interface optimization method described above, and will not be repeated here.

[0147] In one exemplary embodiment, such as Figure 4 As shown, a machine learning-based electric heavy-duty truck battery swapping interface optimization system is provided, including:

[0148] The perception module 401 is used to receive synchronously acquired binocular vision image data, six-dimensional force sensor data and two-dimensional lidar point cloud data, and to perform multimodal weighted fusion perception processing on the binocular vision image data and two-dimensional lidar point cloud data to generate a real-time fused pose estimate of the vehicle-end battery swapping interface relative to the coordinate system of the battery swapping robotic arm end.

[0149] Control module 402 is used to process real-time fused pose estimation and six-dimensional force sensor data through fuzzy adaptive impedance control to generate Cartesian space compliant motion commands for driving the end effector of the battery swapping robot arm.

[0150] The compensation module 403 is used to generate a real-time error compensation amount for compensating the long-term drift error of the system by predicting the fused target pose data, original control commands and final residual alignment error data sequence in historical battery swapping operations through a pre-trained long short-term memory network.

[0151] The decision module 404 is used to generate drive commands for the battery swapping robotic arm based on the Cartesian space compliant motion command and the real-time error compensation amount; the drive commands for the battery swapping robotic arm are used to instruct the multi-degree-of-freedom actuator of the battery swapping robotic arm to perform the alignment and insertion / removal operations of the battery swapping interface.

[0152] In one embodiment, the sensing module 401 is further configured to:

[0153] Preprocessing and feature point detection are performed on the binocular vision image data to obtain the pixel coordinates of the interface identifier point matching the left and right images. Based on the pixel coordinates of the interface identifier point and combined with the camera calibration parameters, the visual pose estimate of the interface in the visual sensor coordinate system is calculated through triangulation and the Perspective-n-Point algorithm.

[0154] Clustering and line segment feature extraction are performed on the two-dimensional lidar point cloud data to obtain point cloud features. The point cloud features are then iteratively registered with a pre-built standard model of an electric heavy truck chassis to obtain lidar pose estimation values. The lidar pose estimation values ​​include the horizontal position deviation and yaw angle deviation of the interface along the battery swapping track direction.

[0155] Based on the average gradient value of the image, the number of interface identifier matching points, and the average reprojection error of feature points from the binocular vision image data, the real-time first reliability weight of the visual perception channel is calculated, and the real-time second reliability weight of the lidar perception channel is calculated based on the number of matching point pairs and the registration residual of the iterative point cloud registration.

[0156] Based on the Kalman filter with the interface pose as the state variable, the visual pose estimate and the lidar pose estimate are used as observation inputs. Combined with the adjustment factor of the observation noise covariance matrix transformed by the first reliability weight and the second reliability weight, Kalman filtering is performed to obtain the real-time fused pose estimate.

[0157] In one embodiment, the control module 402 is further configured to:

[0158] Based on real-time fusion pose estimation and the actual pose of the end effector of the battery swapping robot, the current Cartesian space pose tracking error vector is calculated, and the norm of the Cartesian space pose tracking error vector is normalized to obtain the first fuzzy input.

[0159] The vector norm of the contact force data in the six-dimensional force sensor data is normalized to obtain the second fuzzy input quantity;

[0160] The first and second fuzzy inputs are fed into a fuzzy inference engine based on a fuzzy rule base to obtain the stiffness adjustment factor and damping adjustment factor; the expression of the fuzzy inference engine is as follows: ,in, For the first fuzzy input quantity, This is the second fuzzy input quantity. For the power of expectation, , and For real-time impedance parameters, , , The nominal Cartesian stiffness matrix, The nominal Cartesian damping matrix, This is the stiffness adjustment factor. This is the damping adjustment factor;

[0161] Multiply the nominal Cartesian stiffness matrix by the stiffness adjustment factor scalar to obtain the real-time adaptive stiffness matrix, and multiply the nominal Cartesian damping matrix by the damping adjustment factor scalar to obtain the real-time adaptive damping matrix.

[0162] Based on the real-time adaptive stiffness matrix, real-time adaptive damping matrix, Cartesian space pose tracking error vector, contact force data, and desired contact force, the Cartesian space compliance adjustment velocity vector is calculated using the admittance control principle. This Cartesian space compliance adjustment velocity vector is then vector-superimposed with the proportional control velocity vector based on the Cartesian space pose tracking error vector to obtain the Cartesian space compliance motion command. The expression for the Cartesian space compliance motion command is: Wherein, the Cartesian space compliant adjustment velocity vector is The expected pose correction amount corresponding to the pose tracking error vector in Cartesian space. , For proportional control of the velocity vector, This is the velocity proportional gain matrix.

[0163] In one embodiment, a fuzzing module is also included for:

[0164] When the first fuzzy input is large and the second fuzzy input is zero, the stiffness adjustment factor is high and the damping adjustment factor is medium.

[0165] When the first fuzzy input is small and the second fuzzy input is small, the stiffness adjustment factor is medium and the damping adjustment factor is medium.

[0166] When the second fuzzy input is large, both the stiffness adjustment factor and the damping adjustment factor are low.

[0167] The fuzzy set is fuzzified using an objective function, and the output of the fuzzy inference engine is defuzzified using the centroid method to obtain the scalar values ​​of the stiffness adjustment factor and the damping adjustment factor. The objective function is a triangular function or a Gaussian membership function. The fuzzy set includes the first fuzzy input, the second fuzzy input, the stiffness adjustment factor, and the damping adjustment factor.

[0168] In one embodiment, a model building module is also included, for:

[0169] After each insertion and removal operation is completed, the fused target pose data, Cartesian space compliant motion command, and six-degree-of-freedom residual alignment error data measured after physical locking through the micro-switch array built into the interface are collected before the insertion and removal contact occurs. Data samples are obtained and stored in the circular buffer database in chronological order.

[0170] Based on minimizing the mean squared error between the model prediction error and the actual residual error, the Long Short-Term Memory (LSTM) network model is trained using data samples from the circular buffer database to obtain the LSM network. The LSM network includes an input layer, a hidden layer based on a gating mechanism, and an output layer.

[0171] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps in the above method embodiments.

[0172] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0173] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0174] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.

Claims

1. A method for optimizing the battery swapping interface of electric heavy-duty trucks based on machine learning, characterized in that, The method includes: The system receives synchronously acquired binocular vision image data, six-dimensional force sensor data, and two-dimensional lidar point cloud data, and performs multimodal weighted fusion perception processing on the binocular vision image data and the two-dimensional lidar point cloud data to generate a real-time fused pose estimate of the vehicle-side battery swapping interface relative to the coordinate system of the battery swapping robotic arm end. The real-time fused pose estimation and the six-dimensional force sensor data are processed by fuzzy adaptive impedance control to generate a Cartesian space compliant motion command for driving the end effector of the battery swapping robotic arm. Based on the fusion target pose data, original control commands and final residual alignment error data sequence from historical battery swapping operations, a pre-trained long short-term memory network is used to predict and generate a real-time error compensation amount to compensate for the long-term drift error of the system. The battery swapping robotic arm drive command is generated based on the Cartesian space compliant motion command and the real-time error compensation amount; the battery swapping robotic arm drive command is used to instruct the multi-degree-of-freedom actuator of the battery swapping robotic arm to perform the alignment and insertion / removal operations of the battery swapping interface.

2. The method according to claim 1, characterized in that, The step of performing multimodal weighted fusion perception processing on the binocular vision image data and the two-dimensional lidar point cloud data to generate a real-time fused pose estimate of the vehicle-side battery swapping interface relative to the coordinate system of the battery swapping robotic arm includes: The binocular vision image data is preprocessed and feature points are detected to obtain the pixel coordinates of the interface identifier points that match the left and right images. Based on the pixel coordinates of the interface identifier points and the camera calibration parameters, the visual pose estimate of the interface in the visual sensor coordinate system is calculated by triangulation and the Perspective-n-Point algorithm. Clustering and line segment feature extraction are performed on the two-dimensional lidar point cloud data to obtain point cloud features. The point cloud features are then iteratively registered with a pre-constructed standard model of an electric heavy truck chassis to obtain lidar pose estimation values. The lidar pose estimation values ​​include the horizontal position deviation and yaw angle deviation of the interface along the battery swapping track direction. Based on the average gradient value of the image, the number of matching interface identifier points, and the average reprojection error of feature points in the binocular vision image data, the real-time first reliability weight of the visual perception channel is calculated, and the real-time second reliability weight of the lidar perception channel is calculated based on the number of matching point pairs and the registration residual of the iterative point cloud registration. Based on a Kalman filter with interface pose as the state variable, the visual pose estimate and the lidar pose estimate are used as observation inputs. Combined with the adjustment factor of the observation noise covariance matrix transformed from the first reliability weight and the second reliability weight, Kalman filtering is performed to obtain the real-time fused pose estimate.

3. The method according to claim 2, characterized in that, The real-time first reliability weight of the visual perception channel is calculated based on the average gradient value of the image, the number of interface identifier matching points, and the average reprojection error of feature points from the binocular visual image data. The real-time second reliability weight of the lidar perception channel is then calculated based on the number of matching point pairs and the registration residual from the iterative point cloud registration, including: The real-time first reliability weight is obtained using the following formula: in, As the first reliability weight in real time; The average gradient value of the image; Image sharpness threshold; Match the number of interface identifiers; This represents the total number of interface identifiers. and The first The reprojection coordinates of each feature point and the coordinates of the binocular vision image; , and These are weighting coefficients; To prevent small amounts from being divided by zero; The real-time second reliability weight is obtained using the following formula: in, As the second reliability weight in real time; To match the number of point pairs, The threshold for the number of matching point pairs; To register residuals; To prevent small amounts from being divided by zero; and These are the weighting coefficients.

4. The method according to claim 1, characterized in that, The process of processing the real-time fused pose estimation and the six-dimensional force sensor data through fuzzy adaptive impedance control to generate Cartesian space compliant motion commands for driving the end effector of the battery swapping robotic arm includes: Based on the real-time fusion pose estimation and the actual pose of the end effector of the battery swapping robot arm, the current Cartesian space pose tracking error vector is calculated, and the norm of the Cartesian space pose tracking error vector is normalized to obtain the first fuzzy input quantity. The vector norm of the contact force data in the six-dimensional force sensor data is normalized to obtain the second fuzzy input quantity. The first fuzzy input and the second fuzzy input are input into a fuzzy inference engine based on a fuzzy rule base to obtain a stiffness adjustment factor and a damping adjustment factor; the expression of the fuzzy inference engine is as follows: ,in, For the first fuzzy input quantity, This is the second fuzzy input quantity. For the power of expectation, , and For real-time impedance parameters, , , The nominal Cartesian stiffness matrix, The nominal Cartesian damping matrix, This is the stiffness adjustment factor. This is the damping adjustment factor; Multiply the nominal Cartesian stiffness matrix by the stiffness adjustment factor scalar to obtain the real-time adaptive stiffness matrix, and multiply the nominal Cartesian damping matrix by the damping adjustment factor scalar to obtain the real-time adaptive damping matrix. Based on the real-time adaptive stiffness matrix, the real-time adaptive damping matrix, the Cartesian space pose tracking error vector, the contact force data, and the desired contact force, a Cartesian space compliance adjustment velocity vector is calculated using the admittance control principle. This Cartesian space compliance adjustment velocity vector is then vector-superimposed with the proportional control velocity vector based on the Cartesian space pose tracking error vector to obtain the Cartesian space compliance motion command. The expression for the Cartesian space compliance motion command is: Wherein, the Cartesian space compliant adjustment velocity vector is The expected pose correction amount corresponding to the Cartesian space pose tracking error vector , For proportional control of the velocity vector, This is the velocity proportional gain matrix.

5. The method according to claim 4, characterized in that: The fuzzy linguistic variables for the first fuzzy input quantity include large, medium, and small; the fuzzy linguistic variables for the second fuzzy input quantity are zero, small, and large. The fuzzy rule base is constructed using the following method: When the first fuzzy input is large and the second fuzzy input is zero, the stiffness adjustment factor is high and the damping adjustment factor is medium. When the first fuzzy input is small and the second fuzzy input is small, the stiffness adjustment factor is medium and the damping adjustment factor is medium. When the second fuzzy input is large, both the stiffness adjustment factor and the damping adjustment factor are low. The fuzzy set is fuzzified using an objective function, and the output of the fuzzy inference engine is defuzzified using the centroid method to obtain the scalar values ​​of the stiffness adjustment factor and the damping adjustment factor; the objective function is a triangular function or a Gaussian membership function; the fuzzy set includes the first fuzzy input, the second fuzzy input, the stiffness adjustment factor, and the damping adjustment factor.

6. The method according to claim 1, characterized in that, The Long Short-Term Memory (LSTM) network was trained using the following method: After each insertion and removal operation is completed, the fused target pose data, Cartesian space compliant motion command before the insertion and removal contact occurs, and six-degree-of-freedom residual alignment error data measured after physical locking through the micro-switch array built into the interface are collected to obtain data samples, and the data samples are stored in the circular buffer database in chronological order. Based on minimizing the mean squared error between the model prediction error and the actual residual error, the long short-term memory network model is trained using the data samples in the circular buffer database to obtain the long short-term memory network; the long short-term memory network includes an input layer, a hidden layer based on a gating mechanism, and an output layer.

7. The method according to claim 4, characterized in that: The real-time error compensation amount is used in the feedforward compensation path or the parameter influence path; the feedforward compensation path corresponds to performing Lie algebra addition on the real-time error compensation amount and the real-time fused pose estimation to generate the pre-compensated optimized target pose, which serves as a new benchmark for calculating the Cartesian space pose tracking error vector; the parameter influence path corresponds to using the Euclidean norm and principal direction vector of the real-time error compensation amount as additional features as the third fuzzy input of the fuzzy inference engine. The method, based on the fusion of target pose data, original control commands, and final residual alignment error data sequences from historical battery swapping operations, uses a pre-trained long short-term memory network for prediction to generate real-time error compensation quantities for compensating for long-term drift errors in the system, including: The real-time error compensation amount is obtained using the following formula: in, This refers to the real-time error compensation amount; For Long Short-Term Memory (LSTM) network mapping functions, Indicates the first Data samples from this operation.

8. A machine learning-based optimization system for battery swapping interfaces in electric heavy-duty trucks, characterized in that, The system includes: The perception module is used to receive synchronously acquired binocular vision image data, six-dimensional force sensor data and two-dimensional lidar point cloud data, and to perform multimodal weighted fusion perception processing on the binocular vision image data and the two-dimensional lidar point cloud data to generate a real-time fused pose estimate of the vehicle-end battery swapping interface relative to the coordinate system of the battery swapping robotic arm end. The control module is used to process the real-time fused pose estimation and the six-dimensional force sensor data through fuzzy adaptive impedance control to generate Cartesian space compliant motion commands for driving the end effector of the battery swapping robotic arm. The compensation module is used to generate a real-time error compensation amount to compensate for the long-term drift error of the system by using a pre-trained long short-term memory network to predict the fused target pose data, original control commands and final residual alignment error data sequence from historical battery swapping operations. The decision module is used to generate drive commands for the battery swapping robotic arm based on the Cartesian space compliant motion command and the real-time error compensation amount; the drive commands for the battery swapping robotic arm are used to instruct the multi-degree-of-freedom actuator of the battery swapping robotic arm to perform alignment and insertion / removal operations of the battery swapping interface.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.