High-precision stepping motor driving method and device based on AI optimization control

Through an AI-based optimization control method, the multi-layer perceptron network and barnacle mating optimizer are used to optimize the control parameters of the stepper motor, and combined with a multi-resolution proportional integral differential controller and a hybrid step release algorithm, the traditional stepper problem is solved The problem of insufficient accuracy and response speed of motor control methods in complex environments has significantly improved the overall performance of motor drive control.

CN118589913AInactive Publication Date: 2024-09-03SHENZHEN MEILAIKE TECH CO LTD SALES DEPT
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410755577.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-09-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The traditional stepper motor control method has insufficient control accuracy, slow response speed and weak anti-interference ability when dealing with complex and changeable working environments. It especially shows limitations in nonlinear, time-varying and multi-variable coupling control tasks. It is difficult to achieve ideal control effects.

Method used

Adopting an AI-based optimization control method, by collecting and preprocessing historical data on the speed, torque, current and voltage of the stepper motor, using a multi-layer perceptron network and a barnacle mating optimizer to optimize the initial control parameters, combined with multi-resolution The proportional integral differential controller and hybrid step size release algorithm adjust control parameters in real time to form an adaptive motor drive control model.

Benefits of technology

It significantly improves the control accuracy, response speed and anti-interference ability of the stepper motor, achieves more efficient motor drive control, and overcomes the problem that traditional methods easily fall into local optimality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118589913A
    Figure CN118589913A
Patent Text Reader

Abstract

The invention relates to the technical field of motor driving control, and discloses a high-precision stepping motor driving method and device based on AI optimization control. The method comprises the following steps: carrying out data acquisition and preprocessing on a stepping motor to obtain a historical operation data set; performing motor control parameter analysis through a multi-layer perceptron network to obtain an initial motor control parameter, and performing optimization through a barnacle mating optimizer to obtain a first motor control parameter; real-time control and operation monitoring are carried out through a multi-resolution proportional-integral-derivative controller, a real-time operation data set is obtained, operation error calculation is carried out, and an operation error data set is obtained; performing chaos control factor and step length adjustment based on a mixed step length release algorithm to obtain a self-adaptive adjustment step length strategy; performing network weight and offset optimization to obtain a motor drive control model; the stepping motor is driven and controlled through the motor driving control model. The AI optimization algorithm is adopted to improve the driving control precision of the stepping motor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of motor drive control technology, and in particular to a high-precision stepper motor drive method and device based on AI optimization control. Background Art

[0002] As a precision-controlled actuator, stepper motors are widely used in various high-precision devices. However, traditional stepper motor control methods often suffer from problems such as insufficient control accuracy, slow response speed, and weak anti-interference ability when dealing with complex and changing working environments. These problems mainly stem from the limitations of traditional control algorithms in dealing with complex control tasks such as nonlinearity, time-varying, and multivariable coupling.

[0003] Among the existing stepper motor control technologies, proportional integral derivative (PID) controllers and model-based control methods are common choices. However, when dealing with nonlinear and complex systems, PID controllers require precise models and parameter adjustments, otherwise it is difficult to achieve ideal control effects. Model-based control methods rely on precise system modeling and a large amount of calculations, and in practical applications, they are difficult to respond to and adapt to environmental changes in real time. In addition, traditional optimization algorithms are prone to falling into local optimality in multi-objective optimization problems, making it difficult to globally optimize motor control parameters, thus limiting the improvement of stepper motor control performance. Summary of the invention

[0004] The present application provides a high-precision stepper motor driving method and device based on AI optimization control, which is used to improve the driving control accuracy of the stepper motor by adopting the AI ​​optimization algorithm.

[0005] In a first aspect, the present application provides a high-precision stepper motor driving method based on AI optimization control, and the high-precision stepper motor driving method based on AI optimization control includes: Collect and preprocess the historical operation data of the speed, torque, current and voltage of the stepper motor to obtain a historical operation data set; Inputting the historical operation data set into a preset multi-layer perceptron network to perform motor control parameter analysis to obtain initial motor control parameters, and optimizing the initial motor control parameters through a barnacle mating optimizer to obtain first motor control parameters; By using a multi-resolution proportional-integral-differential controller, the stepper motor is controlled and monitored in real time according to the first motor control parameter to obtain a real-time operation data set, and an operation error is calculated on the real-time operation data set to obtain an operation error data set; Based on the hybrid step-size release algorithm, the chaos control factor and step-size adjustment are performed on the operation error data set to obtain an adaptive step-size adjustment strategy; According to the adaptive step size adjustment strategy, the network weights and biases of the multi-layer perceptron network are tuned to obtain a motor drive control model; The second motor control parameter corresponding to the real-time operation data set is calculated by the motor drive control model, and the stepper motor is driven and controlled according to the second motor control parameter.

[0006] In a second aspect, the present application provides a high-precision stepper motor driving device based on AI optimization control, and the high-precision stepper motor driving device based on AI optimization control includes: The acquisition module is used to collect and preprocess the historical operation data of the speed, torque, current and voltage of the stepper motor to obtain a historical operation data set; An analysis module, used for inputting the historical operation data set into a preset multi-layer perceptron network to perform motor control parameter analysis to obtain initial motor control parameters, and optimizing the initial motor control parameters through a barnacle mating optimizer to obtain first motor control parameters; a calculation module, configured to perform real-time control and operation monitoring of the stepper motor according to the first motor control parameter through a multi-resolution proportional-integral-differential controller to obtain a real-time operation data set, and perform operation error calculation on the real-time operation data set to obtain an operation error data set; An adjustment module is used to adjust the chaos control factor and step size of the operation error data set based on a hybrid step size release algorithm to obtain an adaptive step size adjustment strategy; A tuning module, used to tune the network weights and biases of the multi-layer perceptron network according to the adaptive step size adjustment strategy to obtain a motor drive control model; A control module is used to calculate a second motor control parameter corresponding to the real-time operation data set through the motor drive control model, and drive and control the stepper motor according to the second motor control parameter.

[0007] In the technical solution provided by the present application, by collecting and preprocessing the historical operation data of the speed, torque, current and voltage of the stepper motor, Kalman filtering and data normalization technology are used to effectively remove noise and data deviation, ensure the accuracy and consistency of the input data, and analyze the motor control parameters by inputting the historical operation data set into the preset multi-layer perceptron network, and combining the barnacle mating optimizer, optimization is performed on the basis of the initial motor control parameters. The barnacle mating optimizer can quickly converge to the global optimal solution, overcome the problem that traditional optimization algorithms are prone to fall into local optimality, and significantly improve the optimization efficiency and accuracy of motor control parameters. A multi-resolution proportional integral differential controller is used to perform real-time control and operation monitoring according to the optimized first motor control parameters. The multi-resolution proportional integral differential controller has the characteristics of fast response and high-precision regulation, and can adjust the operating state of the stepper motor in real time. Based on the mixed step release algorithm, the chaos control factor and step size are adjusted for the operation error data set to generate an adaptive adjustment step size strategy. The hybrid step-release algorithm combines chaos theory and Armijo conditions, can dynamically adjust the step size and control factor, and adaptively optimize the control parameters, so that the control system can quickly respond to error changes and make effective adjustments. According to the adaptive step-size adjustment strategy, the network weights and biases of the multi-layer perceptron network are tuned to form a motor drive control model. The motor drive control model can accurately predict the operating state of the motor, and calculate the second motor control parameters based on the real-time operating data set to perform real-time drive control. This application can significantly improve the overall performance of the stepper motor control system, including control accuracy, response speed and anti-interference ability, thereby improving the drive control accuracy of the stepper motor. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0009] Figure 1 Schematic diagram of an embodiment of a high-precision stepper motor driving method based on AI optimization control in an embodiment of the present application; Figure 2 This is a schematic diagram of an embodiment of a high-precision stepper motor drive device based on AI optimization control in an embodiment of the present application. DETAILED DESCRIPTION

[0010] The embodiment of the present application provides a high-precision stepper motor driving method and device based on AI optimization control. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0011] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 In the embodiment of the present application, an embodiment of a high-precision stepper motor driving method based on AI optimization control includes: Step S101, collecting and preprocessing historical operation data of the speed, torque, current and voltage of the stepper motor to obtain a historical operation data set; It is understandable that the execution subject of the present application can be a high-precision stepper motor drive device based on AI optimization control, or a terminal or a server, which is not limited here. The embodiment of the present application is described by taking the server as the execution subject as an example.

[0012] Specifically, historical operation data of the speed, torque, current and voltage of the stepper motor are collected. Initial speed data, initial torque data, initial current data and initial voltage data are obtained through sensors or data acquisition equipment. These initial data may be affected by noise and other interference factors. In order to improve the accuracy of the data, the initial data is denoised. Kalman filtering technology is used to filter the initial speed data, initial torque data, initial current data and initial voltage data respectively to obtain denoised speed data, denoised torque data, denoised current data and denoised voltage data. Kalman filtering is a linear quadratic estimation method that can recursively predict and update input data, significantly reduce the impact of noise, and make the processed data more accurate and stable. The denoised speed, torque, current and voltage data are normalized to convert data of different dimensions into the same scale range. A normalization method of mapping data to the [0, 1] interval is usually used. After normalization, normalized speed data, normalized torque data, normalized current data and normalized voltage data are obtained. Normalization processing not only helps to eliminate the impact of different data dimensions on the results, but also speeds up the convergence speed of subsequent machine learning algorithms and improves the accuracy of the algorithms. After the normalization processing is completed, the processed data is subjected to data serialization conversion and data integration. Data serialization conversion is to uniformly format the originally discrete time series data so that the subsequent machine learning model can correctly understand and use these data. In this process, the normalized speed data, torque data, current data and voltage data are arranged in chronological order to form multidimensional time series data. These serialized data are integrated to obtain a complete historical operation data set. The historical operation data set contains detailed information on the speed, torque, current and voltage of the stepper motor at different time points, which can fully reflect the operating status of the stepper motor.

[0013] Step S102, inputting the historical operation data set into a preset multi-layer perceptron network to analyze the motor control parameters to obtain initial motor control parameters, and optimizing the initial motor control parameters through a barnacle mating optimizer to obtain first motor control parameters; Specifically, the multi-layer perceptron network structure consists of an input layer, a first hidden layer, a second hidden layer, and an output layer. The input layer includes 4 nodes, which are responsible for receiving the speed, torque, current, and voltage feature data of the stepper motor; the first hidden layer contains 10 nodes, which are used to perform deep nonlinear mapping and feature extraction on the input features; the second hidden layer contains 5 nodes, which perform higher-level abstraction and encoding on the features processed by the first hidden layer; the output layer contains 1 node, which is used to generate the final motor control parameters. In the data processing process, feature extraction is performed on the historical operation data set to obtain speed feature sets, torque feature sets, current feature sets, and voltage feature sets. By performing statistical analysis and signal processing on the original data, the representative and relevant parts of the data are extracted to ensure that the data input into the multi-layer perceptron network is valid and representative. The feature sets, namely the speed feature set, torque feature set, current feature set, and voltage feature set, are input into the input layer of the multi-layer perceptron network. The four nodes of the input layer correspond to the four feature sets respectively. Each node performs feature encoding mapping on the corresponding feature set, converts the original feature data into feature vectors that can be processed by the network, and obtains speed feature vectors, torque feature vectors, current feature vectors, and voltage feature vectors. Based on the forward propagation algorithm, the feature vector is input into the first hidden layer for processing. The 10 nodes of the first hidden layer calculate and map the input feature vector through a nonlinear activation function to generate multiple first output node values. Through the weight matrix and activation function of the multilayer perceptron network, the input data is nonlinearly transformed to capture the complex relationships and patterns in the data. The first output node value is used as input and passed to the second hidden layer. The five nodes of the second hidden layer further process and calculate the received first hidden layer output value to generate multiple second output node values. Further extracting higher-level features makes the network's understanding of the input data more profound and comprehensive. The second output node value is input into the output layer to calculate the motor control parameters. The output layer contains a node, which generates the final initial motor control parameters by weighted summation of the second hidden layer output and activation function processing.

[0014] Set the mating parameters and optimization goals of the barnacle mating optimizer. The barnacle mating optimizer is an optimization algorithm based on the reproductive behavior of barnacles in nature. It finds the optimal solution by simulating the mating and mutation process of barnacles. When setting the mating parameters, the population size, mating probability, mutation probability, etc. are included, and the optimization goal is also clarified, that is, to find the optimal motor control parameters by minimizing or maximizing certain performance indicators. The population of the barnacle mating optimizer is initialized according to the initial motor control parameters to generate an initial population. The initial population consists of multiple individuals, each of which represents a candidate motor control parameter. These individuals are generated randomly or based on certain distribution rules to ensure that the population has diversity. Calculate the fitness value of each individual separately. The fitness value is an indicator to measure the quality of each individual, which is calculated by the evaluation function. The higher the fitness value, the closer the motor control parameters of the individual are to the optimization target. Compare the fitness value with the preset first target value and the second target value, where the first target value is less than the second target value. According to the comparison results, the individuals are divided into different populations. If the fitness value of an individual is less than the first target value, the individual is classified into the first population; if the fitness value is between the first target value and the second target value, the individual is classified into the second population; if the fitness value is greater than the second target value, the individual is classified into the third population. The classification process is to perform different optimization operations on individuals of different categories in a targeted manner. Multiple individuals in the third population are mated to generate multiple new individuals. The mating operation simulates the reproductive behavior in nature by selecting two or more individuals for gene recombination to generate a new generation of candidate solutions, aiming to produce better individuals through the recombination of genes. After the new individuals are generated, mutation operations and population updates are performed. The mutation operation is to randomly modify the genes of the new individuals to introduce new genetic diversity and avoid the population from falling into the local optimum. The population update is to merge the mutated new individuals with the original population, and select the best individuals according to the fitness value to form a new population to ensure the overall quality of the population. The target population is iteratively optimized and optimally solved. Through multiple iterations, the population is continuously mated, mutated and updated. After each iteration, the fitness value of the population will be improved and gradually approach the optimal solution. During the iteration process, the change of the fitness value is monitored. When the fitness value converges or reaches the preset optimization goal, the iteration is stopped.

[0015] Step S103, using a multi-resolution proportional-integral-differential controller, performing real-time control and operation monitoring on the stepper motor according to the first motor control parameter to obtain a real-time operation data set, and performing operation error calculation on the real-time operation data set to obtain an operation error data set; Specifically, a corresponding first motor control signal is generated according to the first motor control parameter through a multi-resolution proportional integral differential controller. The optimized first motor control parameter is input into the multi-resolution proportional integral differential controller, and its multi-resolution characteristics and proportional integral differential adjustment algorithm are used to generate a control signal that can accurately control the stepper motor. The control signal includes parameters such as the speed and torque of the motor, and also takes into account the dynamic response characteristics of the system to ensure the stability and accuracy of the motor under different operating conditions. The stepper motor is controlled in real time through the first motor control signal, and the speed, torque, current and voltage data are collected in real time during the operation of the stepper motor to form a real-time operation data set. When the motor is running, the sensor monitors these key parameters in real time and feeds them back to the control system to ensure that the control system can be adjusted and optimized in real time according to the actual situation. The expected operation data set of the first motor control signal is obtained. The expected operation data set is a data set of the ideal operating state obtained according to the control model and theoretical calculation, and includes parameters such as speed, torque, current and voltage when the motor is running under ideal conditions. The real-time operation data set is aligned with the expected operation data set to ensure the consistency of the two in time and data format, so as to facilitate subsequent error calculation. The running error is calculated for the real-time running data set and the expected running data set to obtain the initial error data set. The running error is calculated by comparing the difference between the real-time data and the expected data. The principal component dimensionality reduction is performed on the initial error data set to obtain the running error data set. Principal component analysis is a commonly used dimensionality reduction technique that projects the original high-dimensional data into a low-dimensional space through linear transformation while retaining as much variance information as possible in the data.

[0016] The initial error data set is transformed into a matrix to obtain an initial error data matrix. The initial error data set is a set of error values ​​obtained by comparing the real-time running data set with the expected running data set. By arranging these error values ​​into a matrix form, subsequent data processing and analysis can be more convenient. The initial error data matrix is ​​mapped to a kernel matrix by the Gaussian kernel function to obtain an initial error data kernel matrix. The Gaussian kernel function is a commonly used kernel function that can map the original data into a high-dimensional space, so that the linear separability of the data in the high-dimensional space is enhanced. The kernel matrix mapping process calculates the similarity between each data point in the error data matrix to generate a kernel matrix, and the matrix retains the main information and characteristics of the original data. The initial error data kernel matrix is ​​centralized to eliminate the offset in the data, so that the data is symmetrically distributed with the origin as the center in the new feature space, and the target error data kernel matrix is ​​obtained. The target error data kernel matrix is ​​subjected to eigenvalue decomposition to obtain multiple eigenvalues ​​and eigenvectors corresponding to each eigenvalue. Eigenvalue decomposition is a basic operation in linear algebra. By decomposition, a complex matrix is ​​converted into a combination of several eigenvalues ​​and eigenvectors. Each eigenvalue represents the variance of the data in a certain feature direction, and the eigenvector represents the feature direction. According to the size of the eigenvalue, the corresponding principal component is selected, and the initial error data set is mapped to the new feature space according to the principal component to obtain the running error data set. When selecting the principal component, the first few principal components with larger eigenvalues ​​are usually selected. These principal components contain the largest variance information in the data and can represent the main characteristics of the data. After selecting the principal component, the data is mapped from the original high-dimensional space to the new low-dimensional feature space by projecting the initial error data set onto the eigenvectors corresponding to these principal components. The initial error data set is subjected to principal component dimensionality reduction to obtain the running error data set.

[0017] Step S104: Based on the hybrid step-size release algorithm, the chaos control factor and step-size adjustment are performed on the operation error data set to obtain an adaptive step-size adjustment strategy; Specifically, the error gradient is calculated for the running error data set to obtain the error gradient value. The error gradient value is an important indicator to measure the error change rate. By calculating the error gradient, the direction and amplitude of the error change in the current state are determined, providing a basis for the subsequent step size adjustment. Based on the hybrid step size release algorithm and the error gradient value, the initial step size and initial chaos control factor are set. The initial step size determines the step size of each adjustment, while the chaos control factor is used to introduce nonlinear perturbations to avoid falling into the local optimal solution. The chaotic sequence is generated by Logistic mapping, and the initial step size is adjusted to obtain the current step size. Logistic mapping is a typical chaotic mapping method, which generates a sequence with chaotic characteristics through a recursive formula. Applying the chaotic sequence to the step size adjustment can make the step size uncertain and diverse during the search process, improve the global search ability of the algorithm and avoid the local optimal trap. The Armijo condition is obtained, and it is checked whether the current step size meets the Armijo condition. The Armijo condition is a common criterion in the step size adjustment algorithm, which is used to ensure that each adjustment can reduce the error to some extent. Specifically, the Armijo condition determines whether the current step size is appropriate by comparing the error value after the current step size is adjusted with the error value before adjustment. If the current step size meets the Armijo condition, the current step size is output, indicating that the current step size can effectively reduce the error and meet the optimization requirements. If the current step size does not meet the Armijo condition, the current step size is adjusted until the Armijo condition is met, and the adjusted current step size is output. According to the adjustment result of the current step size, the initial chaos control factor is dynamically adjusted to obtain the target chaos control factor. The dynamic adjustment of the chaos control factor is to adapt to the optimization requirements of different stages. By adjusting the chaos control factor, a balance is achieved between global search and local search to ensure that the algorithm can effectively search and optimize at different stages. According to the current step size and the target chaos control factor, an adaptive step size adjustment strategy is generated. The adaptive step size adjustment strategy is the core of the entire algorithm. By combining the current step size and the target chaos control factor, the step size and chaos disturbance can be adaptively adjusted during the optimization process to ensure that the algorithm can be effectively adjusted and optimized under different error states, and finally achieve high-precision drive control of the stepper motor.

[0018] Step S105: According to the adaptive step size adjustment strategy, the network weights and biases of the multi-layer perceptron network are optimized to obtain a motor drive control model; Specifically, the weights and biases of the multilayer perceptron network are tuned based on the adaptive step size adjustment strategy. Initialize the weights and biases of the multilayer perceptron network. The random initialization method can be used for initialization, but it is necessary to pay attention to the appropriate initial value of the weight, otherwise the convergence speed of the network training may slow down or fall into the local optimum. After the network weights and biases are initialized, the network is trained. In each round of training, the input data set is passed to the output layer through the forward propagation algorithm to calculate the predicted output of the network. The loss function value is calculated by comparing the difference between the predicted output and the true label. Commonly used loss functions include mean square error and cross entropy loss, and the specific choice depends on the specific application scenario and data characteristics. Based on the loss function value, the gradients of the weights and biases of each layer of the network are calculated by the back propagation algorithm. The back propagation algorithm uses the chain rule to calculate the partial derivatives of the loss function for each weight and bias to form gradient information. These gradient information reflects the direction and amplitude of the current weight and bias adjustment, and is an important reference data in the optimization process. According to the adaptive step size adjustment strategy, the calculated gradient is weighted and adjusted. The adaptive step size adjustment strategy provides a dynamically changing step size and chaos control factor to adjust the step size of each weight and bias update. In this way, a larger step size can be used in the early stage of training to speed up the convergence speed, while a smaller step size can be used in the later stage of training to improve the accuracy and stability of training. At the same time, the chaos control factor introduces random perturbations, which can effectively prevent the network from falling into the local optimum, thereby enhancing the global search ability of the network. In each gradient update, the current step size value and chaos control factor are adjusted according to the adaptive step size adjustment strategy, and then the adjusted step size and chaos control factor are applied to update the network weights and biases. This process continues until the loss function value converges to a preset threshold or reaches the set maximum number of training rounds. Through the above steps, according to the adaptive step size adjustment strategy, the weights and biases of the multilayer perceptron network are fully tuned to obtain an optimized motor drive control model.

[0019] Step S106 , calculating the second motor control parameter corresponding to the real-time operation data set through the motor drive control model, and driving and controlling the stepper motor according to the second motor control parameter.

[0020] Specifically, the collected real-time operation data set is input into the optimized and tuned motor drive control model. The control model is trained based on a multi-layer perceptron network and an adaptive step size adjustment strategy, and can perform complex calculations and analyses based on the input real-time data. The model inputs the real-time operation data into the network through a forward propagation algorithm, and finally generates the corresponding second motor control parameters in the output layer through the weighted and nonlinear activation function calculation of each layer of nodes. This process is carried out in real time, and the calculation speed and accuracy of the model directly affect the drive control effect of the motor. After the second motor control parameters are generated, these parameters are interpreted and applied. The second motor control parameters include various key parameters for controlling the operation of the motor, such as target speed, torque setting, current adjustment value, and voltage adjustment value. Through these control parameters, the driving state of the motor is accurately controlled and adjusted to ensure that the motor is always in the best state during operation. According to the calculated second motor control parameters, the stepper motor is driven and controlled. After receiving these parameters, the control system sends a control signal to the motor driver through the drive circuit and control algorithm to adjust the running state of the motor. For example, the control system can adjust the pulse frequency of the motor according to the target speed, adjust the current of the motor according to the torque setting, and fine-tune the power supply of the motor according to the current adjustment value and the voltage adjustment value. During the operation of the motor, the control system needs to continuously monitor and adjust. The real-time operation data set is dynamically changing, and the motor drive control model needs to continuously receive new data, calculate new control parameters, and apply these parameters to motor control. This process is a closed-loop control system that ensures that the operating state of the motor is always accurately controlled and optimized through the feedback of real-time data and the calculation of the model. Through the above steps, based on the calculation of the motor drive control model, the second motor control parameters corresponding to the real-time operation data set are generated and applied to the drive control of the stepper motor.

[0021] In the embodiment of the present application, by collecting and preprocessing the historical operation data of the speed, torque, current and voltage of the stepper motor, Kalman filtering and data normalization technology are used to effectively remove noise and data deviation, ensure the accuracy and consistency of the input data, and analyze the motor control parameters by inputting the historical operation data set into the preset multi-layer perceptron network, and combining the barnacle mating optimizer, optimization is performed on the basis of the initial motor control parameters. The barnacle mating optimizer can quickly converge to the global optimal solution, overcome the problem that the traditional optimization algorithm is prone to fall into the local optimum, and significantly improve the optimization efficiency and accuracy of the motor control parameters. A multi-resolution proportional integral differential controller is used to perform real-time control and operation monitoring according to the optimized first motor control parameters. The multi-resolution proportional integral differential controller has the characteristics of fast response and high-precision regulation, and can adjust the operating state of the stepper motor in real time. Based on the hybrid step release algorithm, the chaos control factor and step size are adjusted for the operation error data set to generate an adaptive adjustment step size strategy. The hybrid step-release algorithm combines chaos theory and Armijo conditions, can dynamically adjust the step size and control factor, and adaptively optimize the control parameters, so that the control system can quickly respond to error changes and make effective adjustments. According to the adaptive step-size adjustment strategy, the network weights and biases of the multi-layer perceptron network are tuned to form a motor drive control model. The motor drive control model can accurately predict the operating state of the motor, and calculate the second motor control parameters based on the real-time operating data set to perform real-time drive control. This application can significantly improve the overall performance of the stepper motor control system, including control accuracy, response speed and anti-interference ability, thereby improving the drive control accuracy of the stepper motor.

[0022] In a specific embodiment, the process of executing step S101 may specifically include the following steps: (1) Collect historical operating data of the speed, torque, current and voltage of the stepper motor to obtain initial speed data, initial torque data, initial current data and initial voltage data; (2) performing Kalman filtering on the initial speed data, initial torque data, initial current data, and initial voltage data respectively to obtain denoised speed data, denoised torque data, denoised current data, and denoised voltage data; (3) performing data normalization processing on the denoised speed data, denoised torque data, denoised current data and denoised voltage data respectively to obtain normalized speed data, normalized torque data, normalized current data and normalized voltage data; (4) Perform data serialization conversion and data integration on the normalized speed data, normalized torque data, normalized current data, and normalized voltage data to obtain a historical operation data set.

[0023] Specifically, a high-precision sensor system is installed. These sensors include speed sensors, torque sensors, current sensors, and voltage sensors, which are used to collect speed, torque, current, and voltage data generated by the stepper motor during operation. Through these sensors, the initial speed data, initial torque data, initial current data, and initial voltage data of the stepper motor are obtained in real time. For example, an encoder is installed on the shaft of the motor to measure the speed, and a torque sensor is installed on the output shaft of the motor to measure the torque. At the same time, current and voltage sensors are installed at the power input end of the motor to measure the current and voltage. These sensors are connected to a data acquisition system, and the initial speed data, initial torque data, initial current data, and initial voltage data of the motor are recorded through high-frequency sampling (such as sampling 1000 times per second). In the actual acquisition process, the data may be interfered by noise, so it is necessary to denoise these initial data. Kalman filtering is an effective denoising method that can estimate the state of the system in the presence of noise. Kalman filtering predicts and updates the state variables of the system, continuously corrects the estimated value of the system state, thereby filtering out noise and obtaining a more accurate signal. For the initial speed data, initial torque data, initial current data and initial voltage data, Kalman filtering is performed respectively to obtain denoised speed data, denoised torque data, denoised current data and denoised voltage data. For example, suppose the measured value of the initial speed data at a certain moment is 3000RPM, but due to the influence of noise, the actual speed may fluctuate between 2900 and 3100RPM. Through Kalman filtering, these fluctuating data are smoothed to obtain denoised speed data that is closer to the actual value. Similarly, the initial torque data, initial current data and initial voltage data are Kalman filtered to obtain denoised torque data, current data and voltage data. The denoised data is normalized. Converting data of different dimensions to the same scale range usually maps the data to the interval of 0 to 1 or -1 to 1. Normalization helps to eliminate the influence of different dimensions on data analysis and improve the convergence speed of the algorithm. For the denoised speed data, denoised torque data, denoised current data and denoised voltage data, normalization is performed respectively. Assuming that the speed data ranges from 0 to 3000RPM, it can be converted to the range of 0 to 1 through normalization. Similarly, torque data, current data and voltage. These data are serialized and integrated. Data serialization conversion refers to arranging scattered data in chronological order to form continuous time series data. For normalized speed data, normalized torque data, normalized current data and normalized voltage data, serialization conversion is performed respectively to form continuous time series data. For example. Assume that within a certain period of time, the system collects 1000 data points, which record the speed, torque, current and voltage of the motor respectively.Through serialization conversion, these data are arranged in chronological order to form four time series, corresponding to the time series data of speed, torque, current and voltage. The normalized time series data are integrated to form a complete historical operation data set. Different types of data are merged together in chronological order to form a comprehensive data set containing multiple information.

[0024] In a specific embodiment, the execution step of inputting the historical operation data set into a preset multi-layer perceptron network to analyze the motor control parameters, and the process of obtaining the initial motor control parameters may specifically include the following steps: (1) The multilayer perceptron network includes: an input layer, a first hidden layer, a second hidden layer, and an output layer. The input layer includes 4 nodes, the first hidden layer includes 10 nodes, the second hidden layer includes 5 nodes, and the output layer includes 1 node. (2) Extract features from the historical operation data set to obtain speed feature sets, torque feature sets, current feature sets, and voltage feature sets; (3) Inputting the speed feature set, torque feature set, current feature set, and voltage feature set into the input layer for feature coding mapping to obtain a speed feature vector, a torque feature vector, a current feature vector, and a voltage feature vector; (4) Based on forward propagation, the speed feature vector, the torque feature vector, the current feature vector, and the voltage feature vector are input into the first hidden layer to calculate the output value, thereby obtaining a plurality of first output node values; (5) inputting the multiple first output node values ​​into the second hidden layer to calculate the output value, thereby obtaining multiple second output node values; (6) Inputting multiple second output node values ​​into the output layer to calculate the motor control parameters and obtain the initial motor control parameters.

[0025] Specifically, the network structure is designed. The multilayer perceptron network includes an input layer, a first hidden layer, a second hidden layer, and an output layer. The input layer contains 4 nodes, corresponding to the four characteristic data of the stepper motor: speed, torque, current, and voltage. The first hidden layer has 10 nodes for preliminary extraction and conversion of characteristic information, the second hidden layer has 5 nodes for further compression and refinement of characteristic information, and the output layer has 1 node for generating the final motor control parameters. Feature extraction is performed on the historical operation data set to extract useful characteristic information. The feature set is input into the input layer of the multilayer perceptron network for feature encoding mapping. The 4 nodes of the input layer receive the speed feature set, torque feature set, current feature set, and voltage feature set, respectively, and convert them into feature vectors that the network can process. The speed feature set is mapped to a speed feature vector, the torque feature set is mapped to a torque feature vector, the current feature set is mapped to a current feature vector, and the voltage feature set is mapped to a voltage feature vector. The feature vector is input into the first hidden layer through the forward propagation algorithm. The 10 nodes of the first hidden layer perform weighted summation of the input feature vector and process it through a nonlinear activation function to obtain multiple first output node values. The first output node value is input into the second hidden layer. The 5 nodes of the second hidden layer perform weighted summation and nonlinear activation processing on the input value again to generate multiple second output node values. The second output node value is input into the output layer. One node of the output layer performs a final weighted summation and activation processing on the output value of the second hidden layer to generate the final initial motor control parameters. In this process, the weights and biases of each layer are learned through the training process. The training process usually uses the back propagation algorithm to adjust the weights and biases by minimizing the loss function (such as mean square error). During the training process, the feature vector of the actual running data is input into the network, the error between the predicted output and the actual output is calculated, and then the gradient of the error relative to the weight and bias is calculated through the back propagation algorithm. The weight and bias are updated using the gradient descent algorithm to gradually reduce the error and improve the prediction accuracy of the model.

[0026] In a specific embodiment, the execution step optimizes the initial motor control parameters through the barnacle mating optimizer to obtain the first motor control parameters, which may specifically include the following steps: (1) Setting the mating parameters and optimization objectives of the barnacle mating optimizer; (2) Initializing the population of the barnacle mating optimizer according to the initial motor control parameters to generate an initial population, where the initial population includes multiple individuals, each of which represents a candidate motor control parameter; (3) Calculate the fitness value of each individual respectively, and compare the fitness value with the first target value and the second target value, where the first target value is less than the second target value; (4) If the fitness value is less than the first target value, the corresponding individual is divided into the first population; if the first target value is less than the fitness value and less than the second target value, the corresponding individual is divided into the second population; if the second target value is less than the fitness value, the corresponding individual is divided into the third population; (5) Performing mating operations on multiple individuals in the third population to generate multiple new individuals; (6) Perform mutation operations and population updates on the multiple new individuals to obtain a target population, and perform iterative optimization and optimal solution on the target population to obtain the first motor control parameters.

[0027] Specifically, the mating parameters and optimization objectives of the barnacle mating optimizer are set. The barnacle mating optimizer is a bionic algorithm, and the mating parameters include population size, mating probability, mutation probability, etc. The optimization objective is usually to minimize or maximize a certain performance indicator. In the application of stepper motor control, the optimization objective may be to minimize the motor operation error or maximize the control accuracy. The population of the barnacle mating optimizer is initialized according to the initial motor control parameters. The initial population consists of multiple individuals, each of which represents a candidate motor control parameter. The population initialization can be generated by random generation or based on a certain distribution rule to ensure that the population is diverse and representative. For example, assuming that the initialization population size is 50, each individual represents a set of motor control parameters, such as the set values ​​of speed, torque, current and voltage. The fitness value of each individual is calculated separately. The fitness value is an important indicator to measure the quality of each individual, reflecting the effect of the individual in solving the optimization target. The calculation of the fitness value is usually based on a loss function or a performance indicator. For example, in stepper motor control, the error between the actual operation data and the target data is used as the fitness value. The smaller the error, the higher the fitness value. The fitness value is compared with the preset first target value and the second target value. The first target value and the second target value are two thresholds of the fitness value, which are used to divide individuals into different populations. Specifically, if the fitness value of an individual is less than the first target value, the individual is divided into the first population; if the fitness value is between the first target value and the second target value, the individual is divided into the second population; if the fitness value is greater than the second target value, the individual is divided into the third population. The classification method helps to carry out optimization operations in a targeted manner and improve the optimization efficiency. For multiple individuals in the third population, mating operations are performed to generate multiple new individuals. The mating operation generates a new generation of candidate solutions by selecting two or more individuals for genetic recombination. For example, suppose two individuals A and B are selected from the third population, and the control parameters of A are [0.3, 0.6, 0.2, 0.5], and the control parameters of B are [0.7, 0.4, 0.8, 0.3]. Through mating operations, new individuals C and D are generated, and the control parameters of C are [0.3, 0.4, 0.2, 0.3], and the control parameters of D are [0.7, 0.6, 0.8, 0.5]. After the new individuals are generated, mutation operations and population updates are performed on the new individuals. The mutation operation is to randomly modify the genes of the new individuals, introduce new gene diversity, and avoid the population from falling into the local optimum. For example, the control parameters of the new individual C are mutated, and [0.3, 0.4, 0.2, 0.3] is mutated to [0.35, 0.45, 0.25, 0.35]. Population update is to merge the mutated new individuals with the original population, and select the best individuals according to the fitness value to form a new population. Iterative optimization and optimal solution are performed on the new population. Iterative optimization means that through multiple mating, mutation and population update operations, the fitness value of the population is continuously improved, and the optimal solution is gradually approached.In each iteration, the changes in the fitness value of the population are monitored. When the fitness value converges or reaches the preset optimization target, the iteration is stopped. For example, after multiple iterations of optimization, the fitness value of an individual in the population reaches 0.95, which is higher than the highest value of 0.7 in the initial population, indicating that the control parameters of this individual are the best solution. Through the above steps, the optimized control parameters of the first motor are finally obtained. These parameters can achieve high-precision drive control of the stepper motor after multiple iterations and optimizations of the barnacle mating optimizer.

[0028] In a specific embodiment, the process of executing step S103 may specifically include the following steps: (1) generating a corresponding first motor control signal according to a first motor control parameter by a multi-resolution proportional-integral-derivative controller; (2) controlling the stepper motor in real time through the first motor control signal, and collecting speed, torque, current and voltage in real time during the operation of the stepper motor to obtain a real-time operation data set; (3) obtaining an expected operation data set of a first motor control signal; (4) Align the real-time operation data set and the expected operation data set, and calculate the operation error between the real-time operation data set and the expected operation data set to obtain an initial error data set; (5) Perform principal component dimensionality reduction on the initial error data set to obtain the operating error data set.

[0029] Specifically, a first motor control signal corresponding to the first motor control parameter is generated by a multi-resolution proportional integral differential controller. The multi-resolution PID controller is an improved PID controller that combines the characteristics of multi-resolution analysis and can better cope with complex and changing control systems. Assuming that the first motor control parameter includes set speed, torque, current and voltage values, the PID controller will calculate the corresponding control signal using these parameters. Specifically, the output signal of the PID controller is It can be expressed as: ; in, is the error between the set value and the actual value, is the proportional gain, is the integral gain, is the differential gain. The multi-resolution PID controller performs multi-scale analysis on the error signal, extracts the error characteristics at different scales, and then optimizes the generation of the control signal. The stepper motor is controlled in real time by the generated first motor control signal. During the operation of the stepper motor, the speed, torque, current and voltage data are collected in real time to form a real-time operation data set. These data are collected by various sensors installed on the stepper motor and transmitted to the data acquisition system for recording. Assume that at a certain moment, the real-time collected data are: speed is 1500RPM, torque is 1.2 Nm, current is 4.5 amps, and voltage is 24 volts. These data will become part of the real-time operation data set. At the same time, the expected operation data set of the first motor control signal is obtained. The expected operation data set is a data set of the theoretical operation state calculated according to the first motor control parameters. Assume that according to the first motor control parameters, the expected speed is 1600RPM, the torque is 1.1 Nm, the current is 4.3 amps, and the voltage is 25 volts. These data represent the operation state that the stepper motor should achieve under ideal conditions. The real-time operation data set and the expected operation data set are aligned to ensure the consistency of the two data sets in time and data format, so as to facilitate the subsequent error calculation. Assuming that the timestamps of the real-time operation data set and the expected operation data set are the same, the speed, torque, current and voltage data of the two data sets are matched through data alignment. The operation error calculation is performed on the real-time operation data set and the expected operation data set to obtain the initial error data set. The error calculation can be achieved by calculating the difference between the actual value and the expected value at each moment. For example, assuming that at a certain moment, the speed of the real-time operation data set is 1500RPM and the speed of the expected operation data set is 1600RPM, then the speed error is -100RPM. Similarly, the errors of torque, current and voltage are calculated to obtain the initial error data set. Assuming that at a certain moment, the values ​​of the initial error data set are: speed error is -100RPM, torque error is 0.1Nm, current error is 0.2A, and voltage error is -1V. The initial error data set is subjected to principal component dimensionality reduction to obtain the operation error data set. Principal component analysis is a commonly used dimensionality reduction technique that projects the original high-dimensional data into a low-dimensional space through linear transformation while retaining as much variance information as possible in the data.

[0030] In a specific embodiment, the execution step performs principal component dimensionality reduction on the initial error data set to obtain the running error data set, which may specifically include the following steps: (1) Perform matrix transformation on the initial error data set to obtain the initial error data matrix; (2) Perform kernel matrix mapping on the initial error data matrix through the Gaussian kernel function to obtain the initial error data kernel matrix; (3) Centralize the initial error data kernel matrix to obtain the target error data kernel matrix; (4) Perform eigenvalue decomposition on the target error data kernel matrix to obtain multiple eigenvalues ​​and the eigenvector corresponding to each eigenvalue; (5) According to the size of the eigenvalue, the corresponding principal component is selected, and the initial error data set is mapped to the new feature space according to the principal component to obtain the running error data set.

[0031] Specifically, the initial error data set is transformed into a matrix to obtain an initial error data matrix. Assume that the initial error data set contains n samples, and each sample contains m features. Taking stepper motor control as an example, the initial error data set includes four features: speed error, torque error, current error, and voltage error. These error data are arranged into a matrix with n rows and m columns, recorded as For example, if n=3, m=4, the initial error data matrix It can be expressed as: ; The initial error data matrix is ​​mapped to a kernel matrix using the Gaussian kernel function to obtain the initial error data kernel matrix. The Gaussian kernel function is a commonly used kernel function and is defined as: ; in, and is the data matrix The two lines in is the bandwidth parameter of the Gaussian kernel. The initial error data kernel matrix is ​​obtained by calculating the kernel function value between all data point pairs in the data matrix Assumptions , then the initial error data kernel matrix It can be expressed as: ; The initial error data kernel matrix is ​​centralized to obtain the target error data kernel matrix. The offset in the data is eliminated so that the data is symmetrically distributed around the origin in the new feature space. The mean of each row and column is subtracted from each element of the initial error data kernel matrix, and then the mean of the entire matrix is ​​added. The target error data kernel matrix after centering is It can be expressed as: ; in, is an n-dimensional vector whose elements are all 1. Perform eigenvalue decomposition on the target error data kernel matrix to obtain multiple eigenvalues ​​and the eigenvectors corresponding to each eigenvalue. Eigenvalue decomposition is the process of decomposing a matrix into eigenvalues ​​and eigenvectors. For the target error data kernel matrix , the eigenvalue decomposition can be expressed as: ; in, is the eigenvector matrix, It is a diagonal eigenvalue matrix, which contains all eigenvalues ​​of the target error data kernel matrix. The corresponding principal component is selected according to the size of the eigenvalue. The larger the eigenvalue, the greater the variance contribution of the corresponding principal component in the data. Usually, the principal component corresponding to the first k largest eigenvalues ​​is selected as the new feature space. For example, assuming that the eigenvalue of the target error data kernel matrix is ,in , select the principal components corresponding to the first two largest eigenvalues, then the new feature space consists of the eigenvectors and According to the principal components, the initial error data set is mapped to the new feature space to obtain the running error data set. The mapping process is to convert the initial error data matrix Project onto the selected principal component. Assume that the selected principal component is and , then the running error data set after mapping It can be expressed as: ; in, is a matrix containing the first k principal components. Depend on and By converting the initial error data matrix Project to On the above, we get the running error data set after dimensionality reduction .

[0032] For example, suppose the initial error data matrix for: ; After Gaussian kernel function mapping and centralization processing, the target error data kernel matrix is ​​obtained Through eigenvalue decomposition, the first two principal components are selected and Project to the new feature space to get the running error data set Assuming that the selected principal components and for: ; Then run the error data set for: ; In a specific embodiment, the process of executing step S104 may specifically include the following steps: (1) Calculate the error gradient of the running error data set to obtain the error gradient value; (2) Based on the hybrid step-release algorithm and the error gradient value, set the initial step size and initial chaos control factor; (3) Generate a chaotic sequence through Logistic mapping and adjust the initial step size to obtain the current step size; (4) Get the Armijo condition and check whether the current step size meets the Armijo condition; (5) If the current step length satisfies the Armijo condition, the current step length is output; if the current step length does not satisfy the Armijo condition, the current step length is adjusted until the Armijo condition is satisfied, and the adjusted current step length is output; (6) According to the adjustment result of the current step size, the initial chaos control factor is dynamically adjusted to obtain the target chaos control factor; (7) Generate an adaptive step size adjustment strategy based on the current step size and the target chaos control factor.

[0033] Specifically, the error gradient is calculated for the running error data set to obtain the error gradient value. The error gradient value is an important parameter used to indicate the direction and magnitude in the optimization process. Assume that there is a running error data set , which contains n samples, each sample has m features. The gradient descent algorithm is used to calculate the error gradient. For each sample (where i ranges from 1 to n), the error gradient It can be calculated by the following formula: ; in, represents the error gradient, represents the error data set, is the loss function, such as mean square error. Assume the loss function is: ; in, , , , By taking the derivative of the loss function, we get the error gradient . Based on the hybrid step release algorithm and the error gradient value, set the initial step size and initial chaos control factor. The hybrid step release algorithm is an optimization method that combines fixed step size and dynamically adjusted step size, aiming to improve the convergence speed and avoid local optimum. Set the initial step size and the initial chaos control factor The initial step size determines the size of each update, and the chaos control factor is used to introduce randomness and increase the search space. The chaotic sequence is generated by Logistic mapping, and the initial step size is adjusted to obtain the current step size. Logistic mapping is a simple chaotic mapping method that can generate a sequence with chaotic characteristics. The Logistic mapping formula is as follows: ; in, is the chaos parameter, usually set to 4. is the value of the kth iteration. By iterating the Logistic map multiple times, a chaotic sequence is generated. This chaotic sequence is used to adjust the initial step size to obtain the current step size For example, let the initial step size be , the first value of the chaotic sequence is 0.7, then the current step length . Get the Armijo condition and check whether the current step size satisfies the Armijo condition. The Armijo condition is a criterion commonly used for step size adjustment, ensuring that each step size adjustment can reduce the loss function value to a certain extent. The Armijo condition formula is as follows: ; in, is the loss function value of the current error data set, is the step length, is the error gradient, is a constant, usually set to 0.5. If the Armijo condition is met, the current step size is output, otherwise the current step size is adjusted until the Armijo condition is met. If the current step size does not meet the Armijo condition, recalculate by reducing the step size value until the condition is met. For example, if the initial step size If the conditions are not met, you can try Continue checking until a step size that meets the conditions is found. According to the adjustment result of the current step size, dynamically adjust the initial chaos control factor to obtain the target chaos control factor. By adjusting the chaos control factor, a balance is achieved between global search and local search. If the current step size meets the Armijo condition, it means that the current search direction and pace are reasonable, and the chaos control factor can be appropriately increased to make the next search more random; if the current step size does not meet the Armijo condition, it is necessary to reduce the chaos control factor to increase the locality of the search. Assume is the current chaos control factor, To adjust the ratio, the new chaos control factor It can be expressed as: For example, if ,but According to the current step size and the target chaos control factor, an adaptive step size adjustment strategy is generated. The adaptive step size adjustment strategy combines the current step size and the target chaos control factor, so that the step size can be dynamically adjusted during the optimization process, which not only ensures the convergence speed but also avoids the local optimum.

[0034] The above describes the high-precision stepper motor driving method based on AI optimization control in the embodiment of the present application. The following describes the high-precision stepper motor driving device based on AI optimization control in the embodiment of the present application. Figure 2 In the embodiment of the present application, an embodiment of a high-precision stepper motor driving device based on AI optimization control includes: The acquisition module 201 is used to collect and preprocess the historical operation data of the speed, torque, current and voltage of the stepper motor to obtain a historical operation data set; The analysis module 202 is used to input the historical operation data set into a preset multi-layer perceptron network to analyze the motor control parameters to obtain initial motor control parameters, and optimize the initial motor control parameters through a barnacle mating optimizer to obtain first motor control parameters; The calculation module 203 is used to perform real-time control and operation monitoring on the stepper motor according to the first motor control parameter through a multi-resolution proportional integral differential controller to obtain a real-time operation data set, and perform operation error calculation on the real-time operation data set to obtain an operation error data set; An adjustment module 204 is used to adjust the chaos control factor and step size of the operation error data set based on a hybrid step size release algorithm to obtain an adaptive step size adjustment strategy; The tuning module 205 is used to tune the network weights and biases of the multi-layer perceptron network according to the adaptive step size adjustment strategy to obtain a motor drive control model; The control module 206 is used to calculate the second motor control parameter corresponding to the real-time operation data set through the motor drive control model, and drive and control the stepper motor according to the second motor control parameter.

[0035] Through the cooperation of the above components, the historical operation data of the speed, torque, current and voltage of the stepper motor are collected and preprocessed, and Kalman filtering and data normalization technology are used to effectively remove noise and data deviation, ensure the accuracy and consistency of the input data, and analyze the motor control parameters by inputting the historical operation data set into the preset multi-layer perceptron network. Combined with the barnacle mating optimizer, the optimization is performed on the basis of the initial motor control parameters. The barnacle mating optimizer can quickly converge to the global optimal solution, overcome the problem that traditional optimization algorithms are prone to fall into local optimality, and significantly improve the optimization efficiency and accuracy of motor control parameters. A multi-resolution proportional integral differential controller is used to perform real-time control and operation monitoring according to the optimized first motor control parameters. The multi-resolution proportional integral differential controller has the characteristics of fast response and high-precision regulation, and can adjust the operating state of the stepper motor in real time. Based on the hybrid step release algorithm, the chaos control factor and step size are adjusted for the operation error data set to generate an adaptive adjustment step size strategy. The hybrid step-release algorithm combines chaos theory and Armijo conditions, can dynamically adjust the step size and control factor, and adaptively optimize the control parameters, so that the control system can quickly respond to error changes and make effective adjustments. According to the adaptive step-size adjustment strategy, the network weights and biases of the multi-layer perceptron network are tuned to form a motor drive control model. The motor drive control model can accurately predict the operating state of the motor, and calculate the second motor control parameters based on the real-time operating data set to perform real-time drive control. This application can significantly improve the overall performance of the stepper motor control system, including control accuracy, response speed and anti-interference ability, thereby improving the drive control accuracy of the stepper motor.

[0036] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0037] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0038] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A high-precision stepper motor driving method based on AI optimization control, characterized in that: The method comprises: Collect and preprocess the historical operation data of the speed, torque, current and voltage of the stepper motor to obtain a historical operation data set; Inputting the historical operation data set into a preset multi-layer perceptron network to perform motor control parameter analysis to obtain initial motor control parameters, and optimizing the initial motor control parameters through a barnacle mating optimizer to obtain first motor control parameters; By using a multi-resolution proportional-integral-differential controller, the stepper motor is controlled and monitored in real time according to the first motor control parameter to obtain a real-time operation data set, and an operation error is calculated on the real-time operation data set to obtain an operation error data set; Based on the hybrid step-size release algorithm, the chaos control factor and step-size adjustment are performed on the operation error data set to obtain an adaptive step-size adjustment strategy; According to the adaptive step size adjustment strategy, the network weights and biases of the multi-layer perceptron network are tuned to obtain a motor drive control model; The second motor control parameter corresponding to the real-time operation data set is calculated by the motor drive control model, and the stepper motor is driven and controlled according to the second motor control parameter.

2. The high-precision stepper motor driving method based on AI optimization control according to claim 1 is characterized in that: The historical operation data of the speed, torque, current and voltage of the stepper motor are collected and preprocessed to obtain a historical operation data set, including: Collect historical operation data of the speed, torque, current and voltage of the stepper motor to obtain initial speed data, initial torque data, initial current data and initial voltage data; Performing Kalman filtering on the initial speed data, the initial torque data, the initial current data and the initial voltage data respectively to obtain denoised speed data, denoised torque data, denoised current data and denoised voltage data; Respectively performing data normalization processing on the denoised speed data, the denoised torque data, the denoised current data and the denoised voltage data to obtain normalized speed data, normalized torque data, normalized current data and normalized voltage data; The normalized speed data, the normalized torque data, the normalized current data, and the normalized voltage data are subjected to data serialization conversion and data integration to obtain a historical operation data set.

3. The high-precision stepper motor driving method based on AI optimization control according to claim 1 is characterized in that: The step of inputting the historical operation data set into a preset multi-layer perceptron network to analyze the motor control parameters to obtain the initial motor control parameters includes: The multilayer perceptron network comprises: an input layer, a first hidden layer, a second hidden layer and an output layer, wherein the input layer comprises 4 nodes, the first hidden layer comprises 10 nodes, the second hidden layer comprises 5 nodes, and the output layer comprises 1 node; Extracting features from the historical operation data set to obtain a speed feature set, a torque feature set, a current feature set, and a voltage feature set; Inputting the speed feature set, the torque feature set, the current feature set and the voltage feature set into the input layer for feature coding mapping to obtain a speed feature vector, a torque feature vector, a current feature vector and a voltage feature vector; Based on forward propagation, the speed characteristic vector, the torque characteristic vector, the current characteristic vector and the voltage characteristic vector are input into the first hidden layer to calculate the output value, so as to obtain a plurality of first output node values; Inputting the plurality of first output node values ​​into the second hidden layer to calculate output values, thereby obtaining a plurality of second output node values; The multiple second output node values ​​are input into the output layer to calculate the motor control parameters to obtain initial motor control parameters.

4. The high-precision stepper motor driving method based on AI optimization control according to claim 1 is characterized in that: The initial motor control parameters are optimized by the barnacle mating optimizer to obtain the first motor control parameters, including: Set the mating parameters and optimization goals of the barnacle mating optimizer; According to the initial motor control parameters, the barnacle mating optimizer is initialized to generate an initial population, wherein the initial population includes a plurality of individuals, each of which represents a candidate motor control parameter; Calculating the fitness value of each individual respectively, and comparing the fitness value with a first target value and a second target value, wherein the first target value is less than the second target value; If the fitness value is less than the first target value, the corresponding individual is divided into the first population; if the first target value is less than the fitness value and less than the second target value, the corresponding individual is divided into the second population; if the second target value is less than the fitness value, the corresponding individual is divided into the third population; Performing a mating operation on a plurality of individuals in the third population to generate a plurality of new individuals; The multiple new individuals are subjected to mutation operation and population update to obtain a target population, and the target population is subjected to iterative optimization and optimal solution to obtain a first motor control parameter.

5. The high-precision stepper motor driving method based on AI optimization control according to claim 1 is characterized in that: The method of controlling and monitoring the stepper motor in real time according to the first motor control parameter by using a multi-resolution proportional-integral-differential controller to obtain a real-time operation data set, and performing operation error calculation on the real-time operation data set to obtain an operation error data set includes: Generate a corresponding first motor control signal according to the first motor control parameter by a multi-resolution proportional-integral-differential controller; The stepper motor is controlled in real time by the first motor control signal, and speed, torque, current and voltage are collected in real time during the operation of the stepper motor to obtain a real-time operation data set; acquiring an expected operation data set of the first motor control signal; Performing data alignment on the real-time operation data set and the expected operation data set, and performing operation error calculation on the real-time operation data set and the expected operation data set to obtain an initial error data set; The initial error data set is subjected to principal component dimensionality reduction to obtain an operating error data set.

6. The high-precision stepper motor driving method based on AI optimization control according to claim 5 is characterized in that: The performing principal component dimensionality reduction on the initial error data set to obtain the running error data set includes: Performing matrix transformation on the initial error data set to obtain an initial error data matrix; Performing kernel matrix mapping on the initial error data matrix by using a Gaussian kernel function to obtain an initial error data kernel matrix; Centralizing the initial error data kernel matrix to obtain a target error data kernel matrix; Performing eigenvalue decomposition on the target error data kernel matrix to obtain multiple eigenvalues ​​and an eigenvector corresponding to each eigenvalue; The corresponding principal component is selected according to the size of the eigenvalue, and the initial error data set is mapped to a new feature space according to the principal component to obtain a running error data set.

7. The high-precision stepper motor driving method based on AI optimization control according to claim 1 is characterized in that: The hybrid step-release algorithm is based on which the chaos control factor and the step-size are adjusted for the operation error data set to obtain an adaptive step-size adjustment strategy, including: Performing error gradient calculation on the running error data set to obtain an error gradient value; Based on the hybrid step-release algorithm and the error gradient value, setting the initial step-size and the initial chaos control factor; Generate a chaotic sequence through Logistic mapping, and adjust the initial step size to obtain a current step size; Obtaining the Armijo condition, and checking whether the current step size satisfies the Armijo condition; If the current step length satisfies the Armijo condition, the current step length is output; if the current step length does not satisfy the Armijo condition, the current step length is adjusted until the Armijo condition is satisfied, and the adjusted current step length is output; According to the adjustment result of the current step length, the initial chaos control factor is dynamically adjusted to obtain a target chaos control factor; An adaptive step size adjustment strategy is generated according to the current step size and the target chaos control factor.

8. A high-precision stepper motor drive device based on AI optimization control, characterized in that: The device comprises: The acquisition module is used to collect and preprocess the historical operation data of the speed, torque, current and voltage of the stepper motor to obtain a historical operation data set; An analysis module, used for inputting the historical operation data set into a preset multi-layer perceptron network to perform motor control parameter analysis to obtain initial motor control parameters, and optimizing the initial motor control parameters through a barnacle mating optimizer to obtain first motor control parameters; a calculation module, configured to perform real-time control and operation monitoring of the stepper motor according to the first motor control parameter through a multi-resolution proportional-integral-differential controller to obtain a real-time operation data set, and perform operation error calculation on the real-time operation data set to obtain an operation error data set; An adjustment module is used to adjust the chaos control factor and step size of the operation error data set based on a hybrid step size release algorithm to obtain an adaptive step size adjustment strategy; A tuning module, used to tune the network weights and biases of the multi-layer perceptron network according to the adaptive step size adjustment strategy to obtain a motor drive control model; A control module is used to calculate a second motor control parameter corresponding to the real-time operation data set through the motor drive control model, and drive and control the stepper motor according to the second motor control parameter.

Citation Information

Cited By

  • Flow adjusting system and method for anesthesia bomb

    CN119405958A