Stepper motor drive control method and system
Through real-time monitoring and deep learning technology, the stepper motor control mode is dynamically adjusted, and the driving signal is optimized by combining wavelet transformation and resonance demodulation, which solves the problems of stepper motor vibration and noise, improves control accuracy and efficiency, and reduces costs.
Patent Information
- Application Number
- CN202411010940.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-26
AI Technical Summary
Stepper motors are prone to vibration and noise when running at high speed or high load, and the control accuracy is insufficient. The traditional control mode is costly or complex and cannot fully utilize the motor control potential, resulting in low operating efficiency and high energy consumption.
Through real-time monitoring of the operating status and load conditions of the stepper motor, the control mode is dynamically adjusted, deep learning is used to establish a vibration prediction model for real-time compensation control, and the drive signal is optimized using wavelet transform and multi-scale resonance demodulation technology to achieve vibration suppression and fine positioning. control.
It significantly improves the control accuracy and stability of the motor, reduces vibration and noise, optimizes the drive signal, improves operating efficiency and energy consumption performance, extends the life of the motor, and reduces system costs.
Smart Images

Figure CN118573058B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor control, and in particular to a control method and system for stepper motor drive. Background Art
[0002] As a precision-controlled motor, stepper motors are widely used in automation equipment, robots, precision instruments and other fields. However, in actual operation, stepper motors often encounter some problems, such as vibration, noise, and insufficient positioning accuracy, due to the influence of their control methods and load characteristics. These problems not only affect the performance of the motor, but also limit its application in situations with higher precision requirements.
[0003] First of all, the vibration problem of stepper motors is a common technical problem. When running at high speed or high load, the motor is prone to resonance, resulting in large vibration and noise, which not only affects the working environment, but also damages the life and stability of the motor. In addition, vibration will also cause the control accuracy of the motor to decrease, affecting the operation effect of the entire system.
[0004] Secondly, the control modes of stepper motors are usually divided into open-loop and closed-loop. Although open-loop control has a simple structure and low cost, it cannot monitor the actual operating status of the motor in real time, resulting in limited control accuracy and stability. Although closed-loop control systems can provide more precise control, they are more expensive and increase system complexity, which is not conducive to use in cost-sensitive or space-constrained applications.
[0005] Furthermore, the optimization of the drive signal for stepper motors is also a key technical issue. Traditional drive signal generation methods fail to fully utilize the control potential of the motor, resulting in low motor efficiency and high energy consumption. In addition, the motor's micro-step subdivision control accuracy is insufficient, which also affects its performance in applications that require fine position control. Summary of the invention
[0006] Based on this, it is necessary for the present invention to provide a control method and system for stepper motor drive to solve at least one of the above technical problems.
[0007] To achieve the above object, a stepper motor drive control method comprises the following steps:
[0008] Step S1: monitor the running state and load condition of the stepper motor in real time to obtain the motor running state data and the motor load condition data; switch the control mode of the stepper motor based on the motor running state data and the motor load condition data to obtain the motor control mode parameters;
[0009] Step S2: extracting dynamic features of the motor running state data based on the motor control mode parameters to obtain a motor dynamic feature vector; performing deep learning modeling based on the motor dynamic feature vector to obtain a motor vibration prediction model; performing real-time compensation control on the stepper motor according to the motor vibration prediction model to obtain a motor vibration suppression control strategy and a compensated motor control signal;
[0010] Step S3: Control the stepper motor according to the motor control mode parameters and the compensated motor control signal, and perform synchronous data acquisition to obtain the motor real-time position feedback data and motor speed feedback data; calculate the position error of the stepper motor based on the motor real-time position feedback data and motor speed feedback data to obtain the motor real-time position error data;
[0011] Step S4: performing wavelet transform analysis on the motor operation status data to obtain the motor instantaneous frequency characteristic data; performing multi-scale resonance demodulation according to the motor real-time position error data and the motor instantaneous frequency characteristic data to obtain the optimal micro-step subdivision ratio data; modulating the stepper motor based on the optimal micro-step subdivision ratio data to obtain the optimized motor drive signal;
[0012] Step S5: controlling the stepper motor according to the motor vibration suppression control strategy and the optimized motor drive signal.
[0013] The present invention can dynamically adjust the control mode and adapt to different working conditions by real-time monitoring of the running state and load condition of the stepper motor, thereby significantly improving the control accuracy and running stability of the motor. By using deep learning technology to establish a motor vibration prediction model, real-time prediction and compensation control of motor vibration are realized, effectively reducing the resonance phenomenon of the motor under high speed or high load, reducing vibration and noise, and improving the working environment. By intelligently selecting an open-loop or closed-loop control mode according to the actual running state of the motor, the limitations of the traditional control mode selection are overcome, and the balance between cost-effectiveness and control accuracy is achieved. Through wavelet transform analysis and multi-scale resonance demodulation technology, the drive signal of the motor is optimized, the running efficiency and energy consumption performance of the motor are improved, and the accuracy of micro-step subdivision control is enhanced, meeting the needs of fine position control. By combining real-time monitoring data and deep learning models, the present invention realizes the intelligence of the motor control strategy, can automatically adapt to different operating conditions, reduces manual intervention, and improves the automation level of the system. By reducing vibration and optimizing control, the present invention reduces the mechanical stress in the operation of the motor, helps to extend the service life of the motor, and improves the reliability of the entire system. While ensuring control accuracy, the present invention reduces dependence on high-cost closed-loop control systems through intelligent control mode selection and optimized drive signal generation, which helps to reduce the cost of the overall system.
[0014] Preferably, the present invention further provides a stepper motor driven control system for executing the stepper motor driven control method as described above, the stepper motor driven control system comprising:
[0015] The control mode switching module is used to monitor the running state and load condition of the stepper motor in real time, and obtain the motor running state data and the motor load condition data; based on the motor running state data and the motor load condition data, the control mode of the stepper motor is switched to obtain the motor control mode parameters;
[0016] The compensation signal calculation module is used to extract dynamic features of the motor operation status data based on the motor control mode parameters to obtain the motor dynamic feature vector; perform deep learning modeling based on the motor dynamic feature vector to obtain the motor vibration prediction model; perform real-time compensation control on the stepper motor according to the motor vibration prediction model to obtain the motor vibration suppression control strategy and the compensated motor control signal;
[0017] The position error calculation module is used to control the stepper motor according to the motor control mode parameters and the compensated motor control signal, and perform synchronous data acquisition to obtain the motor real-time position feedback data and motor speed feedback data; based on the motor real-time position feedback data and motor speed feedback data, the position error of the stepper motor is calculated to obtain the motor real-time position error data;
[0018] The drive signal optimization module is used to perform wavelet transform analysis on the motor operation status data to obtain the motor instantaneous frequency characteristic data; perform multi-scale resonance demodulation based on the motor real-time position error data and the motor instantaneous frequency characteristic data to obtain the optimal micro-step subdivision ratio data; modulate the stepper motor based on the optimal micro-step subdivision ratio data to obtain the optimized motor drive signal;
[0019] The control operation module is used to control the stepper motor according to the motor vibration suppression control strategy and the optimized motor drive signal.
[0020] In the present invention, through the adaptability of real-time monitoring and intelligent control mode, the accurate grasp of the motor operating state and load conditions, as well as the rapid response to different working conditions are ensured. Through the application of deep learning technology, accurate prediction and real-time compensation control of vibration are achieved, which significantly reduces the vibration and noise of the stepper motor during operation, and directly improves the working performance of the motor. Through the precise feedback of the position error calculation module, the accuracy and reliability of the control are further enhanced. Through the application of wavelet transform and wavelet packet decomposition technology, the drive signal is optimized, and the response speed and control accuracy of the motor are improved. In addition, the micro-step subdivision control accuracy of the system is improved, which meets the market demand for high-precision positioning. On the whole, the intelligent control operation execution of the system reduces human intervention and improves the consistency and reliability of operation. At the same time, the optimized control strategy and the reduction of dependence on high-cost closed-loop systems achieve maximum cost-effectiveness. The reliability and durability of the system are also enhanced by reduced mechanical stress and optimized control signals. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments thereof made with reference to the following drawings:
[0022] Figure 1 A schematic flow chart of the steps of a stepper motor drive control method according to an embodiment is shown.
[0023] Figure 2 A detailed flow chart of step S3 of an embodiment is shown.
[0024] Figure 3 A detailed flow chart of step S4 of an embodiment is shown. DETAILED DESCRIPTION
[0025] The technical method of the present invention is described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by technicians in this field without creative work are within the scope of protection of the present invention.
[0026] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor methods and / or microcontroller methods.
[0027] It should be understood that, although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another unit. For example, without departing from the scope of the exemplary embodiments, the first unit may be referred to as the second unit, and similarly the second unit may be referred to as the first unit. The term "and / or" used herein includes any and all combinations of one or more of the listed associated items.
[0028] To achieve this, please refer to Figures 1 to 3 The present invention provides a stepper motor drive control method, comprising the following steps:
[0029] Step S1: monitor the running state and load condition of the stepper motor in real time to obtain the motor running state data and the motor load condition data; switch the control mode of the stepper motor based on the motor running state data and the motor load condition data to obtain the motor control mode parameters;
[0030] Step S2: extracting dynamic features of the motor running state data based on the motor control mode parameters to obtain a motor dynamic feature vector; performing deep learning modeling based on the motor dynamic feature vector to obtain a motor vibration prediction model; performing real-time compensation control on the stepper motor according to the motor vibration prediction model to obtain a motor vibration suppression control strategy and a compensated motor control signal;
[0031] Step S3: Control the stepper motor according to the motor control mode parameters and the compensated motor control signal, and perform synchronous data acquisition to obtain the motor real-time position feedback data and motor speed feedback data; calculate the position error of the stepper motor based on the motor real-time position feedback data and motor speed feedback data to obtain the motor real-time position error data;
[0032] Step S4: performing wavelet transform analysis on the motor operation status data to obtain the motor instantaneous frequency characteristic data; performing multi-scale resonance demodulation according to the motor real-time position error data and the motor instantaneous frequency characteristic data to obtain the optimal micro-step subdivision ratio data; modulating the stepper motor based on the optimal micro-step subdivision ratio data to obtain the optimized motor drive signal;
[0033] Step S5: controlling the stepper motor according to the motor vibration suppression control strategy and the optimized motor drive signal.
[0034] The present invention can dynamically adjust the control mode and adapt to different working conditions by real-time monitoring of the running state and load condition of the stepper motor, thereby significantly improving the control accuracy and running stability of the motor. By using deep learning technology to establish a motor vibration prediction model, real-time prediction and compensation control of motor vibration are realized, effectively reducing the resonance phenomenon of the motor under high speed or high load, reducing vibration and noise, and improving the working environment. By intelligently selecting an open-loop or closed-loop control mode according to the actual running state of the motor, the limitations of the traditional control mode selection are overcome, and the balance between cost-effectiveness and control accuracy is achieved. Through wavelet transform analysis and multi-scale resonance demodulation technology, the drive signal of the motor is optimized, the running efficiency and energy consumption performance of the motor are improved, and the accuracy of micro-step subdivision control is enhanced, meeting the needs of fine position control. By combining real-time monitoring data and deep learning models, the present invention realizes the intelligence of the motor control strategy, can automatically adapt to different operating conditions, reduces manual intervention, and improves the automation level of the system. By reducing vibration and optimizing control, the present invention reduces the mechanical stress in the operation of the motor, helps to extend the service life of the motor, and improves the reliability of the entire system. While ensuring control accuracy, the present invention reduces dependence on high-cost closed-loop control systems through intelligent control mode selection and optimized drive signal generation, which helps to reduce the cost of the overall system.
[0035] In this embodiment, the motor operation state and load condition are monitored in real time by a variety of sensors (including temperature sensors, vibration sensors and torque sensors) integrated on the motor, and the collected motor operation state data and motor load condition data are transmitted to the central processing unit. Based on these data, the control system automatically identifies whether the motor is currently in a fixed location working state or a mobile location working state, and switches to an appropriate control mode accordingly, and adjusts the motor control mode parameters, such as current limit and acceleration slope, to adapt to different load conditions. Next, by analyzing the motor operation state data under the motor control mode parameters, the key features reflecting the dynamic characteristics of the motor, such as current fluctuations, vibration amplitude and speed changes, are extracted to form a motor dynamic feature vector. Based on this vector, a motor vibration prediction model is established using deep learning technology, which can predict the vibration generated by the motor under different control parameters, thereby formulating a motor vibration suppression control strategy. Combined with the vibration prediction model and the motor control mode parameters, the compensated motor control signal is generated in real time. At the same time, the motor real-time position feedback data and motor speed feedback data are collected by the motor real-time position encoder and speed sensor, and the position error is calculated based on these data to obtain the motor real-time position error data. In addition, the motor running status data is analyzed by wavelet transform to reveal the instantaneous frequency characteristic data of the motor. Combining the real-time position error data of the motor with the instantaneous frequency characteristic data of the motor, a multi-scale resonance demodulation method is used to identify the optimal micro-step subdivision ratio. Finally, the motor is modulated according to the optimal micro-step subdivision ratio data to generate an optimized motor drive signal, which is combined with the motor vibration suppression control strategy to act on the stepper motor to achieve fine control of the motor.
[0036] Preferably, step S1 comprises the following steps:
[0037] Step S11: monitoring the stepper motor with a multi-dimensional sensor array to obtain motor operation status data;
[0038] Specifically, a multi-dimensional sensor array can be installed, including but not limited to acceleration sensors, temperature sensors, current sensors and voltage sensors. These sensors are evenly distributed in key positions of the stepper motor, such as motor bearings, motor housings and next to the controller. After starting the motor, a high-precision data acquisition system, such as NI (NationalInstruments) data acquisition card, is used to transmit the signals of each sensor to the data processing terminal in real time. The data acquisition terminal runs LabVIEW software, and through the preset acquisition program, the output data of each sensor is collected and stored in real time, and finally a comprehensive motor operation status data is obtained, including but not limited to the vibration, temperature, current and voltage operation parameters of the motor.
[0039] Step S12: extracting current and voltage data from the motor running status data to obtain motor driving current data and motor driving voltage data;
[0040] Specifically, the data analysis tool in MATLAB can be used to convert the motor operation status data into a processable matrix form. Then, a MATLAB script is written to extract the current and voltage data from the motor operation status data through screening and extraction functions. The specific operation is to read the output channel data of the current sensor and the voltage sensor to finally obtain the motor drive current data and the motor drive voltage data.
[0041] Step S13: segmenting the motor driving current data and the motor driving voltage data according to a preset time window to obtain instantaneous current segment data and instantaneous voltage segment data;
[0042] Specifically, a preset time window, such as 100 milliseconds, can be set in MATLAB. Write a script to segment the motor drive current data and the motor drive voltage data through a for loop. The specific method is to divide the continuous motor drive current data and the motor drive voltage data according to the time window, and the data in each time window is stored as an independent array. Finally, the instantaneous current segment data and the instantaneous voltage segment data are obtained.
[0043] Step S14: performing Hilbert-Huang transform on the instantaneous current segment data and the instantaneous voltage segment data to obtain motor operation characteristic spectrum data;
[0044] Specifically, the instantaneous current segment data and the instantaneous voltage segment data can be imported into the workspace using the MATLAB software environment. The Hilbert transform function is called through the signal processing toolbox provided by MATLAB to transform each instantaneous segment data. The Hilbert transform is a mathematical tool widely used in signal processing that can convert time domain signals into frequency domains while retaining the amplitude and phase information of the signal. After processing, the motor operation characteristic spectrum data in each time window is obtained.
[0045] Step S15: performing reverse modeling based on the motor operation characteristic spectrum data to obtain motor load condition data;
[0046] Specifically, the MATLAB software environment can be used to import and process the motor operation characteristic spectrum data. First, write a MATLAB script to parse and fit the characteristic spectrum data through the reverse analysis method. This includes using statistical modeling functions in the spectrum analysis toolbox, such as autocorrelation function and power spectrum density estimation, to identify and analyze the main characteristics and frequency distribution of the motor load state. During the reverse modeling process, machine learning algorithms, such as support vector machines (SVM) or artificial neural networks (ANN), can also be used to train and predict the motor operation characteristic spectrum data to optimize the model fitting accuracy of the load condition. Finally, the motor load condition data is obtained.
[0047] Step S16: Switching the control mode of the stepper motor based on the motor operation characteristic spectrum data and the motor load condition data to obtain motor control mode parameters.
[0048] Specifically, please refer to the sub-steps of step S16 for the specific implementation process of this embodiment.
[0049] The present invention realizes comprehensive operation status monitoring through a multi-dimensional sensor array, ensuring the accurate capture of the real-time operation status of the stepper motor. Through the accurate extraction and analysis of current and voltage data, an in-depth understanding of the electrical characteristics of the motor is provided. Through efficient data segmentation processing, the current and voltage data are instantly segmented according to the preset time window, and the instantaneous changes of the motor state are captured, providing an opportunity to implement a fast-response dynamic control strategy. Through the application of the Hilbert-Huang transform, the ability to extract signal features is further enhanced, so that the dynamic behavior of the motor operation is scientifically and accurately analyzed. Through the introduction of inverse modeling technology, the accuracy of load identification is significantly improved, providing an important basis for realizing load adaptive control. Through the switching of intelligent control modes, based on real-time data analysis, the optimal control of the stepper motor under different load conditions is achieved, ensuring the high efficiency of the motor operation. Finally, through the acquisition of control mode parameters, the adaptability and effectiveness of the control strategy are ensured, providing solid parameter support for the precise control of the motor.
[0050] Preferably, step S16 comprises the following steps:
[0051] Step S161: performing threshold segmentation on the motor load condition data to obtain motor load segmentation data;
[0052] Specifically, the Python programming language and its data processing libraries (such as Pandas and NumPy) can be used to import the motor load condition data. Then, a threshold segmentation algorithm, such as a segmentation method based on a fixed threshold or an adaptive threshold, is applied to divide the motor load data into several stages or states. This method can effectively divide the continuous motor load data sequence into discrete load segments, each of which has a clear motor working state or load level. Finally, the motor load segmented data is obtained.
[0053] Step S162: Acquire motor task instruction data;
[0054] Specifically, it can be obtained through real-time sensors or sent through the host computer system. Taking sensor acquisition as an example, common sensor devices in modern industrial automation systems, such as encoders or position sensors, are used to monitor the movement and position of the motor in real time. These sensors provide the monitored data (such as the current position, speed, and acceleration of the motor) as task instruction data to the control system.
[0055] Step S163: performing task type identification on the motor task instruction data to obtain motor task type data;
[0056] Specifically, machine learning or pattern recognition algorithms, such as support vector machines (SVM) or deep learning models (such as neural networks), can be used to extract features and classify motor task instruction data. By training the model, the motor task instruction data is mapped to predefined task type categories, such as fixed-point work tasks or mobile tasks. The algorithm will analyze the motion pattern, speed change, and position change characteristics in the task instruction data to accurately identify the type of task the motor is currently performing. The final motor task type data is obtained.
[0057] Step S164: performing speed fluctuation analysis on the motor operation characteristic spectrum data to obtain motor speed stability data;
[0058] Specifically, the data analysis library in Python programming language (such as NumPy and Pandas) can be used to import the motor operation characteristic spectrum data. For the motor operation characteristic spectrum data, frequency domain analysis methods such as fast Fourier transform (FFT) are applied to convert the time domain data into frequency domain data. By analyzing the frequency components and power spectrum density in the spectrum, the change and stability of the motor speed can be evaluated. Further, statistical analysis tools such as mean, standard deviation and spectrum peak detection algorithms are used to identify and quantify the fluctuation of the motor speed. The final motor speed stability data is obtained.
[0059] Step S165: if the motor task type data indicates a fixed-point work type task, extracting load extreme values from the motor load segmentation data to obtain motor load peak value data;
[0060] Specifically, if the motor task type data is displayed as a fixed-point work task, the data processing libraries and algorithms in Python, such as Pandas and Scikit-Learn, can be used to import and preprocess the motor load segment data. By analyzing the current or voltage data in each load segment, the load extreme point in each segment, that is, the load peak, is detected and extracted, thereby obtaining the motor load peak data. These peak data reflect the maximum load level that the motor bears in the fixed-point work task.
[0061] Step S166: performing parameter matching on the motor speed stability data and the motor load peak data based on a preset multi-dimensional parameter decision matrix to obtain motor control parameters, and marking the motor control parameters with an open-loop control identifier to obtain motor control mode parameters;
[0062] Specifically, the preset multidimensional parameter decision matrix includes multiple important dimensions, such as motor speed stability, load peak and current consumption key parameters, and also includes control parameters corresponding to specific quantitative data of speed stability and load peak. The motor speed stability data and load peak data can be imported into a multidimensional parameter decision matrix analysis tool, such as a professional data analysis library in MATLAB or Python. By setting and adjusting the weights and conditions in the decision matrix, matching and evaluation are performed according to the quantitative data of speed stability and load peak. Finally, the optimal motor control parameter combination is determined according to the evaluation output of the preset multidimensional parameter decision matrix. These control parameters are marked as "open-loop control" to indicate their motor operating characteristics and behaviors in the open-loop control mode, thereby obtaining the motor control mode parameters. In the process of constructing the preset multidimensional parameter decision matrix, the weight and evaluation conditions of each parameter are set according to the actual operating environment and performance requirements of the motor. For example, speed stability can be measured by the main frequency or standard deviation in spectrum analysis, while the load peak reflects the stability and responsiveness of the motor when working under high load.
[0063] Step S167: If the motor task type data indicates a mobile task, the motor task instruction data is subjected to maximum displacement identification to obtain the motor maximum displacement trajectory data;
[0064] Specifically, if the motor task type data is displayed as a mobile task, the motor task instruction data will be subjected to maximum displacement identification to obtain the motor maximum displacement trajectory data. First, the motor task instruction data is imported using data processing libraries in the Python programming language, such as Pandas and NumPy. By analyzing the position change or displacement data in each task instruction, the maximum displacement value actually reached by the motor in each movement is identified. These maximum displacement values reflect the range of motion and maximum working distance of the motor in a mobile task. The identified maximum displacement value will be used as the motor maximum displacement trajectory data.
[0065] Step S168: Based on a preset multi-dimensional parameter decision matrix, the motor speed stability data is matched with the motor maximum displacement trajectory data to obtain motor control parameters, and the motor control parameters are marked with closed-loop control identifiers to obtain motor control mode parameters.
[0066] Specifically, the motor speed stability data and maximum displacement trajectory data can be imported into professional data analysis tools, such as data analysis libraries in MATLAB or Python. By setting and adjusting the weights and conditions in the preset multi-dimensional parameter decision matrix, matching and evaluation are performed based on the quantitative data of speed stability and maximum displacement. Based on the output results of the decision matrix, the optimal motor control parameters are determined. Finally, the obtained motor control parameters are marked with the identifier "closed-loop control" to finally obtain the motor control mode parameters.
[0067] The present invention realizes precise load management through threshold segmentation, provides detailed load distribution information for the control strategy, and ensures accurate identification of the motor state under different load conditions. Secondly, the intelligent identification function of the task type can distinguish the task type according to the motor task instruction data. In addition, the in-depth analysis of the speed stability provides an important basis for the selection of the control mode, and the effective identification of the load peak value provides key extreme value information for load adaptive control. By utilizing the multi-dimensional parameter decision matrix, the optimal matching of the speed stability data and the load peak or maximum displacement trajectory data is achieved, and the setting of the motor control parameters is further optimized. Through the function of intelligently switching the control mode, according to the task type and load characteristics, the optimal control of the motor under different working conditions is ensured.
[0068] Preferably, step S2 comprises the following steps:
[0069] Step S21: performing wavelet packet decomposition on the motor operation status data to obtain the operation status time-frequency characteristic data;
[0070] Specifically, the wavelet packet analysis tool library in MATLAB or Python, such as the PyWavelets library, can be used. First, the motor operating status data is loaded into the data analysis environment, and the wavelet packet decomposition algorithm is applied. The algorithm decomposes the motor operating status data into wavelet packet coefficients of different levels, each coefficient corresponding to a signal component of a different frequency. By selecting appropriate wavelet basis functions and decomposition levels, the time-frequency characteristics of the motor operating status data can be effectively captured. These characteristics include but are not limited to the distribution of frequency components, changes in signal intensity, and local characteristics in time. The final operating status time-frequency characteristic data provides the spectrum information of the motor under different operating states.
[0071] Step S22: if the motor control mode parameter shows that the control mode of the stepper motor is open-loop control, threshold filtering is performed on the operating state time-frequency characteristic data to obtain open-loop mode operating characteristic data;
[0072] Specifically, if the motor control mode parameters show that the control mode of the stepper motor is open-loop control, the signal processing toolbox in MATLAB or Python, such as the threshold function in MATLAB or the scipy.signal.threshold function in Python, can be used. First, determine the appropriate threshold value, then compare the operating state time-frequency feature data with the threshold, and filter out feature data above the threshold. These data reflect the key operating characteristics of the motor in the open-loop control mode, and finally obtain the open-loop mode operating feature data.
[0073] Step S23: if the motor control mode parameter shows that the control mode of the stepper motor is closed-loop control, Kalman filtering is performed on the time-frequency characteristic data of the operating state to obtain closed-loop mode operating characteristic data;
[0074] Specifically, if the motor control mode parameters show that the control mode of the stepper motor is closed-loop control, the Kalman filter function library in MATLAB or Python can be used, such as the kalman function in MATLAB or the filterpy.kalman.KalmanFilter class in Python. First, set the parameters of the Kalman filter according to the dynamic model of the motor system and the measurement noise characteristics, and then input the operating state time-frequency characteristic data into the filter. The Kalman filter will optimize the operating state based on the measurement value and the dynamic model, output stable and accurate operating characteristic data in the closed-loop mode, and finally obtain the closed-loop mode operating characteristic data.
[0075] Step S24: performing principal component analysis on the open-loop mode operation characteristic data or the closed-loop mode operation characteristic data to obtain reduced-dimensionality characteristic data of the operation state;
[0076] Specifically, professional data analysis tools can be used to perform principal component analysis. In this embodiment, scientific computing libraries such as NumPy and scikit-learn in Python language are selected. The collected operating characteristic data in open-loop or closed-loop mode are loaded into the Python environment. Data is usually stored in the form of arrays or matrices, where each row represents a sample point (such as operating status data within a time window) and each column represents a feature (such as a spectral component). The PCA class in the scikit-learn library is used to perform principal component analysis. First, a PCA object is created and the required parameters, such as the number of principal components or the threshold value of the explained variance, are set. Then, the fit_transform method of the PCA object is called to fit and transform the data. This method converts the original high-dimensional data into a low-dimensional principal component representation, and each principal component represents a significant change pattern in the data. The output results of PCA are analyzed, including the variance contribution rate and the principal component load (i.e., the relationship between the original feature and the principal component) of each principal component. According to actual needs and application scenarios, the number of principal components retained is selected or the principal components are further interpreted and utilized, and finally the running state dimensionality reduction feature data is obtained.
[0077] Step S25: performing nonlinear time series analysis on the dimension reduction feature data of the running state to obtain a motor dynamic feature vector;
[0078] Specifically, you can use libraries in Python that are specifically used for time series analysis, such as statsmodels and PyTorch. First, load the reduced-dimensional feature data of the operating state into the Python environment. Then, apply nonlinear time series analysis methods, such as Fourier transform, wavelet transform, or nonlinear dynamic models. These methods can reveal the complex time dynamics and nonlinear relationships in the data, and then extract feature vectors that describe the dynamic changes in the motor's operating state. The dynamic feature vectors obtained are analyzed and interpreted. These vectors will reflect the dynamic behavior and nonlinear characteristics of the motor during operation, such as periodicity and complex waveforms, and finally obtain the motor dynamic feature vector.
[0079] Step S26: obtaining a motor historical vibration data set, and performing autoencoder pre-training based on the motor historical vibration data set to obtain an initial motor vibration learning model;
[0080] Specifically, a motor historical vibration dataset can be prepared. This data can include vibration signals recorded by the motor under different operating conditions, usually stored in the form of time series. Data can be collected in real time by sensors or extracted from historical records. Second, select appropriate tools or libraries to implement pre-training of the autoencoder. In this example, deep learning frameworks in Python, such as TensorFlow or PyTorch, can be used. The following are the specific steps: Load the motor historical vibration dataset into a data analysis environment, such as NumPy or Pandas libraries in Python. Ensure that the data format is correct and perform necessary preprocessing, such as normalization or standardization. Build an autoencoder model, which consists of two parts: an encoder and a decoder. The encoder compresses the vibration data into a latent space representation, and the decoder reconstructs the original vibration data from the latent representation. A simple fully connected neural network structure or a more complex convolutional neural network structure can be selected and adjusted according to the data characteristics and task requirements. The autoencoder is trained using the motor historical vibration dataset. The model parameters are optimized by minimizing the reconstruction error (i.e., the difference between the input and the output). Appropriate optimizers (such as the Adam optimizer) and loss functions (such as the mean square error) can be selected during training. Through these steps, an initial motor vibration learning model can be obtained, which can capture the important features and patterns in the vibration data.
[0081] Step S27: using the motor dynamic feature vector to perform transfer learning and fine-tune the initial motor vibration learning model to obtain a motor vibration prediction model;
[0082] Specifically, the motor dynamic feature vector can be integrated into the motor real-time vibration dataset. Based on the initial motor vibration learning model, the motor dynamic feature vector is used as input for transfer learning. Transfer learning can be performed by freezing part or all of the layers of the model and retraining the model. Here, the bottom layer weights of the autoencoder are kept unchanged, and only the top fully connected layer or other specific layers are adjusted to adapt to the requirements of the new task (i.e., vibration prediction). The entire dataset is fine-tuned using the model after transfer learning. During the fine-tuning process, a smaller learning rate and a larger batch size can be used to further optimize the performance of the model, and finally a motor vibration prediction model is obtained.
[0083] Step S28: performing real-time compensation control on the stepper motor according to the motor dynamic characteristic vector and the motor vibration prediction model to obtain a motor vibration suppression control strategy and a compensated motor control signal.
[0084] Specifically, please refer to the sub-steps of step S28 for the specific implementation process of this embodiment.
[0085] The present invention can accurately obtain the time-frequency characteristics of the motor operation state through the application of wavelet packet decomposition technology. According to different control modes, threshold filtering or Kalman filtering can be intelligently selected to effectively remove noise and redundant information and extract more accurate operation feature data. The operation state data is subjected to dimensionality reduction processing by the application of principal component analysis, key features are extracted, the data structure is simplified, and the most important information is retained. The understanding of the dynamic characteristics of the motor is further deepened through nonlinear time series analysis, providing strong data support for the precise control and state prediction of the motor. The initial motor vibration learning model is constructed by obtaining the motor historical vibration data set and performing autoencoder pre-training. The motor vibration prediction model is made more accurate through the application of transfer learning and fine-tuning, and can be dynamically adjusted according to real-time data, thereby improving the accuracy of vibration prediction. Based on the motor dynamic feature vector and the vibration prediction model, real-time compensation control of the stepper motor is realized, a vibration suppression control strategy and a compensated motor control signal are generated, and the vibration during motor operation is effectively reduced.
[0086] Preferably, step S28 comprises the following steps:
[0087] Step S281: performing time domain vibration prediction based on the motor dynamic feature vector using the motor vibration prediction model to obtain motor predicted vibration time domain data;
[0088] Specifically, the motor dynamic feature vector can be used as input and predicted using the motor vibration prediction model. Secondly, select the appropriate tool or library to implement time domain vibration prediction. Typically, you can use machine learning libraries in Python, such as Scikit-learn or TensorFlow, and select the appropriate tool based on the type of motor vibration prediction model. The following are the specific steps: Load the motor dynamic feature vector into the Python environment. Use the motor vibration prediction model to predict the dynamic feature vector. Depending on the architecture and type of the motor vibration prediction model, you can obtain the motor predicted vibration time domain data by calling the model's prediction method.
[0089] Step S282: performing fast Fourier transform on the motor predicted vibration time domain data to obtain motor predicted vibration spectrum data;
[0090] Specifically, appropriate tools or libraries can be selected to implement the Fast Fourier Transform (FFT). In Python, the FFT function in the NumPy library can be used for implementation. The following are the specific steps: Load the time domain data of the motor prediction vibration into the Python environment and perform necessary data format conversion for FFT processing. Use the FFT function in the NumPy library to perform a Fast Fourier Transform on the motor prediction vibration time domain data. FFT converts the time domain signal into a frequency domain signal to obtain the motor prediction vibration spectrum data. The effect of the transformation can be optimized by adjusting the parameters of the FFT (such as sampling frequency and window function).
[0091] Step S283: performing resonance peak identification on the motor predicted vibration spectrum data to obtain motor vibration resonance peak characteristic data, and performing adaptive filter design based on the motor vibration resonance peak characteristic data to obtain an adaptive filter parameter set;
[0092] Specifically, a signal processing library in Python (such as SciPy) can be used to apply peak detection algorithms or spectrum smoothing techniques to identify the resonant peaks in the motor's predicted vibration spectrum data, thereby obtaining the motor vibration resonant peak feature data. The identified resonant peak reflects the resonance or important frequency components of the motor at a specific frequency. Next, based on the identified resonant peak characteristics, an adaptive filter is designed, which can enhance or weaken the vibration signal within a specific frequency range by adjusting the filter parameters. The design of the adaptive filter can use digital signal processing methods to ensure that the key information in the motor vibration signal is retained during the filtering process, thereby obtaining the optimal adaptive filter parameter set.
[0093] Step S284: using the motor predicted vibration spectrum data as a constraint condition, constructing an MPC optimizer with minimizing the predicted vibration amplitude as the objective function, and obtaining an initial MPC optimization model; adjusting the parameters of the initial MPC optimization model according to the adaptive filter parameter set, and obtaining an optimized MPC objective function;
[0094] Specifically, the motor predicted vibration spectrum data is used as a constraint condition, and the objective function is to minimize the predicted vibration amplitude. The adaptive filter parameter set and the motor predicted vibration spectrum data can be loaded into the Python or MATLAB environment. Using professional MPC tools, such as cvxpy or MATLAB's MPC toolbox, an initial MPC optimization model is constructed based on the constraints and objective functions. During the model construction process, the parameters of the MPC controller, including weights, constraints, and prediction time windows, are adjusted to optimize the control effect and response speed of the motor vibration. The optimized MPC objective function is verified and adjusted through simulation or experimental data, and finally the optimized MPC objective function is obtained.
[0095] Step S285: Calculate the optimal control sequence for the motor predicted vibration spectrum data using the MPC optimization objective function to obtain the motor vibration suppression control strategy;
[0096] Specifically, the MPC optimization objective function and the real-time collected motor predicted vibration spectrum data can be loaded into the MPC controller, for example, using the MPC toolbox in MATLAB or the control library in Python. In these tools, the sampling time and prediction time domain of the controller are set. The controller determines the motor control action to be applied in the current time period through the calculated optimal control sequence to minimize the resonance peaks or frequency components identified in the predicted vibration spectrum data, and finally obtains the motor vibration suppression control strategy.
[0097] Step S286: collecting real-time control signals of the stepper motor to obtain original control signals of the motor;
[0098] Specifically, a real-time data acquisition system, such as NI DAQ devices or dedicated controller interfaces, can be used to transmit motor control signals to a data acquisition environment in real time. By configuring the sampling frequency and channel configuration of the data acquisition system, it is ensured that all control signal changes generated by the motor during operation can be accurately captured, and the original motor control signal can be finally obtained.
[0099] Step S287: performing signal compensation on the original motor control signal according to the motor vibration suppression control strategy to obtain a compensated motor control signal.
[0100] Specifically, a high-performance real-time control system can be used, such as a motor controller built on a digital signal processor (DSP) or a field programmable gate array (FPGA). This controller has efficient data processing capabilities and can quickly process and respond to real-time data on the motor status. The motor vibration suppression control strategy is then integrated into the controller. This strategy is based on the motor dynamic model obtained through system identification technology, such as a transfer function or state space model, which can predict the vibration behavior of the motor under different control signals and calculate the required compensation amount. The algorithm inside the controller then performs real-time analysis on the original control signal, converts the signal from the time domain to the frequency domain through a fast Fourier transform (FFT), and identifies and determines the main frequency components of the vibration. Based on the results of the FFT analysis, the compensation algorithm calculates the necessary compensation signal, which is designed to offset or attenuate the undesirable vibration frequency. The compensation signal is converted back to the time domain through an inverse Fourier transform (IFFT) and then combined with the original control signal. Finally, this control signal combined with the compensation signal becomes the compensated motor control signal.
[0101] The present invention can accurately predict the time domain vibration of the motor by utilizing the motor dynamic characteristic vector and the vibration prediction model, and provide accurate prediction data for subsequent vibration control. The motor vibration can be analyzed from the frequency domain perspective by applying the fast Fourier transform, and the key vibration frequency components can be identified. The resonance peak in the motor vibration spectrum can be effectively identified by accurately identifying the resonance peak, and the main vibration characteristics affecting the motor performance can be extracted, providing key parameters for the design of the adaptive filter. According to the identified resonance peak characteristics, an adaptive filter can be designed, and the filter parameters can be adjusted in real time to meet the vibration control requirements under different working conditions. By constructing an MPC optimizer and adjusting the parameters, the optimal control sequence can be calculated to achieve effective suppression of the motor vibration. By collecting the control signal of the stepper motor in real time, the real-time and accuracy of the control strategy are ensured. According to the vibration suppression control strategy, the original control signal is intelligently compensated to generate the compensated motor control signal, which effectively reduces the vibration of the motor. In summary, the present invention can dynamically adjust the control parameters according to the actual operating state and vibration characteristics of the motor to adapt to different working conditions.
[0102] Preferably, step S3 comprises the following steps:
[0103] Step S31: converting the compensated motor control signal into a micro-step drive signal to obtain a motor micro-step drive pulse sequence;
[0104] Specifically, a digital signal processor (DSP) or a field programmable gate array (FPGA) can be used to implement microstep drive signal conversion. First, the compensated motor control signal is input into the DSP or FPGA, which has built-in dedicated algorithms that can generate higher frequency pulse sequences based on the amplitude and frequency of the input signal. These pulse sequences control the microstep motion of the motor by adjusting the duty cycle of the pulse width modulation (PWM) signal. For example, if an FPGA from Xilinx or Altera is used, a customized microstep drive logic is implemented on the FPGA, which receives the original control signal and outputs a pulse sequence suitable for the stepper motor driver. In this way, motor microstep drive pulse sequences are obtained, which can accurately control each tiny step of the motor.
[0105] Step S32: controlling the stepper motor according to the motor control mode parameters and the motor micro-step drive pulse sequence, and performing synchronous data acquisition to obtain the motor real-time position feedback data and motor speed feedback data;
[0106] Specifically, a motor motion controller can be used, which can be a dedicated hardware device, such as a motion control card from Galil or Parker, or a PC-based control software, such as MATLAB / Simulink. These controllers can generate corresponding control instructions according to preset control mode parameters, such as speed, acceleration, and position settings. According to the motor control mode parameters combined with the motor microstep drive pulse sequence, it is sent to the stepper motor through the motor driver to achieve precise motion control. At the same time, the controller synchronously collects the position and speed feedback data of the motor. These data are usually provided by an encoder, which is installed on the motor shaft and can monitor the rotation position and speed of the motor in real time, and finally obtain the real-time position feedback data and motor speed feedback data of the motor.
[0107] Step S33: collecting the running time of the stepper motor to obtain the actual running time data of the motor;
[0108] Specifically, you can use high-precision time measurement tools such as oscilloscopes or time interval counters. In the motor control process, record the exact time points when the motor starts and stops. These time points can be determined by the pulse signal of the encoder or the specific output signal of the motor driver. For example, you can use a Tektronix or Agilent oscilloscope to monitor these signals and record the start and stop moments of the motor. By calculating the difference between these time points, you can get the actual running time data of the motor.
[0109] Step S34: obtaining the motor target position data and the motor target speed data, and performing theoretical position calculation on the stepper motor according to the motor actual running time data, the motor target position data and the motor target speed data to obtain the motor theoretical position data;
[0110] Specifically, the target position and target speed data of the motor can be obtained through the motion control software or hardware interface. These data can be input by the operator through the human-machine interface (HMI), or automatically set by the automation control system according to the task requirements. In order to perform theoretical position calculations, it is necessary to know the number of turns of the motor rotor, which can be achieved by counting the pulses of the encoder. The encoder is installed on the motor shaft. Use a motion controller, such as BECKHOFF's TwinCAT automation software, to perform the necessary calculations. The controller receives the feedback signal from the encoder in real time and converts it into the actual position data of the motor. At the same time, the controller calculates the theoretical position of the motor at the time point corresponding to the actual running time data of the motor based on the preset target position and speed, as well as the known acceleration and deceleration curves, and finally obtains the theoretical position data of the motor;
[0111] Step S35: Calculate the position error between the motor's real-time position feedback data and the motor's theoretical position data to obtain the motor's real-time position error data.
[0112] Specifically, the real-time position feedback data of the motor can be compared with the theoretical position data of the motor. This comparison process can be implemented by programming, such as using a data processing script written in C++ or Python. The script reads the actual position data from the data acquisition system, matches it with the theoretical position data, calculates the difference between the two, that is, the position error, and finally obtains the real-time position error data of the motor.
[0113] The present invention improves the resolution and smoothness of motor control and ensures fine adjustment of motor operation through the precise generation of micro-step drive signals. Accurate monitoring of the real-time position and speed of the motor is guaranteed by a synchronous data acquisition mechanism. Through the accuracy of real-time position feedback and real-time monitoring of motor speed, the control strategy can be adjusted in time to optimize the motor operating performance. By accurately recording the running time, not only a detailed record of the motor usage is provided, but also necessary data is provided for regular maintenance and performance analysis. By accurately calculating the theoretical position and calculating the position error in real time, accurate correction of the motor positioning can be achieved, significantly improving the control accuracy. In summary, the present invention makes the motor control more precise and the response more rapid, while enhancing the adaptability and reliability of the system.
[0114] Preferably, step S4 comprises the following steps:
[0115] Step S41: performing continuous wavelet transform on the motor running state data to obtain a time-frequency distribution diagram of the motor running state;
[0116] Specifically, for example, using the signal processing toolbox of MATLAB, it provides a CWT function to perform this transformation. First, the operating status data of the motor, such as current, voltage or vibration signal, is imported into the MATLAB environment. Then, the CWT function is applied and a suitable wavelet basis function and transformation scale are selected to analyze the characteristics of the signal at different times and frequencies. In this way, the time-frequency distribution diagram of the motor operating status can be obtained.
[0117] Step S42: performing adaptive ridge extraction on the time-frequency distribution diagram of the motor running state to obtain instantaneous frequency characteristic data of the motor;
[0118] Specifically, for example, in MATLAB, a script can be written that traverses the time-frequency distribution diagram of the motor's operating state and identifies ridges that represent frequency changes. These ridges correspond to the instantaneous frequencies of the frequency components in the signal. By setting thresholds and search conditions, these ridges can be automatically detected and tracked, thereby extracting the motor's instantaneous frequency feature data. These data reflect the frequency characteristics of the motor at different time points.
[0119] Step S43: using the instantaneous frequency characteristic data of the motor as a carrier signal and the real-time position error data of the motor as a modulation signal to input into a preset multi-scale resonance demodulation algorithm for multi-dimensional signal demodulation to obtain a multi-scale demodulation signal set of the operating state;
[0120] Specifically, a suitable multi-scale resonance demodulation algorithm can be designed or selected, which can handle the interaction between the carrier and the modulated signal and extract useful information from them. Through a custom algorithm or using a ready-made signal processing library, such as Python's scipy.signal library. Then, the motor instantaneous frequency characteristic data and the motor real-time position error data are used as inputs to the algorithm. By adjusting the algorithm parameters, such as the scale and frequency response of the filter, the demodulation process can be optimized to obtain the best signal demodulation results. Finally, a set of multi-scale demodulated signals of the operating state is obtained, which contains detailed information about the motor's operating state.
[0121] Step S44: performing empirical mode decomposition on the operating state multi-scale demodulation signal set to obtain an operating state intrinsic mode function set, wherein the operating state intrinsic mode function set includes a plurality of operating state intrinsic mode functions;
[0122] Specifically, the empirical mode decomposition (EMD) method can be used to process the multi-scale demodulated signal set of the operating state. EMD is an adaptive signal processing technology that can decompose complex signals into a series of inherent oscillation modes, called intrinsic mode functions (IMFs). First, the multi-scale demodulated signal set of the operating state is imported into data analysis software, such as MATLAB, which provides an implementation of the EMD algorithm. In MATLAB, the built-in EMD function is called to decompose each demodulated signal to obtain a set of intrinsic mode functions of the operating state. These IMFs reflect the different frequency components of the signal, and each IMF contains important information about the signal change. By setting a suitable decomposition stopping criterion, such as stopping the decomposition when the residual of the IMF reaches a preset threshold, the accuracy and reliability of the decomposition result can be ensured. Finally, the set of intrinsic mode functions of the operating state is obtained.
[0123] Step S45: selecting the optimal subset of the operating state intrinsic mode function set according to the preset mutual information entropy evaluation criterion to obtain the optimized operating state intrinsic mode function subset;
[0124] Specifically, the mutual information entropy evaluation criterion can be used, which is a method that can quantify the mutual dependence between different signals. First, the mutual information entropy between each pair of operating state intrinsic mode functions is calculated, which can be done by writing a custom calculation script or using a ready-made mutual information entropy calculation tool. The calculation result of the mutual information entropy will identify IMFs with redundant or complementary information. Then, a clustering algorithm or an optimization algorithm is used to select the optimal IMF subset. For example, in MATLAB, a genetic algorithm or a particle swarm optimization algorithm can be used to minimize the sum of mutual information entropy while ensuring that the selected IMFs can represent the information of the original signal to the greatest extent. The input of the algorithm includes the calculated mutual information entropy matrix and the size of the selected IMF subset. Through the iterative optimization of the algorithm, an optimized subset of operating state intrinsic mode functions is finally obtained.
[0125] Step S46: performing micro-step subdivision ratio analysis based on the optimized operating state intrinsic mode function subset to obtain optimal micro-step subdivision ratio data;
[0126] Specifically, please refer to the sub-steps of step S46 for the specific implementation process of this embodiment.
[0127] Step S47: modulate the stepper motor based on the optimal micro-step subdivision ratio data to obtain an optimized motor drive signal.
[0128] Specifically, modulation can be implemented using the Control System Toolbox in MATLAB or Python. First, import the optimal microstep subdivision ratio data into the control system environment. Assuming that MATLAB is used for operation, load the model of the stepper motor and use the optimal microstep subdivision ratio data as input parameters. By using the modulation function in the Control System Toolbox, such as the PWM Generator module in simulink or the control library in Python, the drive signal of the stepper motor can be modulated according to the optimal microstep subdivision ratio data. Finally, through simulation or actual operation, the optimized motor drive signal can be obtained.
[0129] The present invention can deeply analyze the motor operation state and obtain comprehensive time-frequency distribution characteristics through the application of continuous wavelet transform. The instantaneous frequency change of the motor is accurately captured by the adaptive ridge extraction technology, which provides the system with key frequency characteristics and helps precise control. By utilizing the multi-scale resonance demodulation algorithm, it is possible to effectively extract a valuable signal set from the complex motor operation state, thereby enhancing the signal processing capability. By performing empirical mode decomposition on the demodulated signal set, different modes of motor operation can be identified, providing a new perspective for in-depth understanding of motor behavior. Based on the mutual information entropy evaluation criterion, the optimal subset can be selected from a large number of modal functions, further improving the accuracy and efficiency of signal processing. The optimal micro-step subdivision ratio is obtained through optimization analysis, providing data support for the fine control of the motor and improving the control accuracy and resolution. The motor is modulated according to the optimal micro-step subdivision ratio data, generating an optimized motor drive signal, and improving the dynamic response and control performance of the motor. In summary, the present invention embodies the intelligence in signal processing and control strategies, reduces human intervention, and improves the degree of automation of control.
[0130] Preferably, step S46 includes the following steps:
[0131] Step S461: Perform fuzzy reasoning analysis on the subset of intrinsic mode functions of the optimized operating state to obtain motor micro-step subdivision ratio range data;
[0132] Specifically, the Fuzzy Logic Toolbox of MATLAB can be used to build a fuzzy inference system. First, fuzzy sets and membership functions are defined, which describe the relationship between the motor operating state and the microstep subdivision ratio based on expert knowledge and historical data. Then, a fuzzy rule base is constructed, which describes how different intrinsic mode function characteristics affect the selection of microstep subdivision ratio. Using these rules and the input optimized operating state intrinsic mode function subset data, the fuzzy inference system can output the ratio range of the motor microstep subdivision, and finally obtain the motor microstep subdivision ratio range data.
[0133] Step S462: performing a global search on the motor micro-step subdivision ratio range data to obtain an optimal micro-step subdivision ratio candidate set, wherein the optimal micro-step subdivision ratio candidate set includes a plurality of candidate optimal micro-step subdivision ratio data;
[0134] Specifically, genetic algorithms, particle swarm optimization (PSO), or simulated annealing methods can be used. For example, the genetic algorithm can be implemented using Python's DEAP library. First, a fitness function is defined that evaluates the performance of the microstep subdivision ratio, such as the smoothness, accuracy, and efficiency of the motor. Then, an initial population is generated, and the parameters of the algorithm, such as the crossover rate, mutation rate, and number of iterations, are set. The algorithm runs within a predefined range of microstep subdivision ratios, and through iterative search, the search range is gradually narrowed, and a set of candidate optimal microstep subdivision ratio data is finally obtained.
[0135] Step S463: Use a preset motor performance evaluation function to quantitatively evaluate and sort the optimal micro-step subdivision ratio candidate set to obtain priority sorting result data, and use the candidate optimal micro-step subdivision ratio data corresponding to the highest priority in the priority sorting result data as the optimal micro-step subdivision ratio data.
[0136] Specifically, this process can be implemented using the numerical computing tool library in MATLAB or Python. First, the optimal microstep subdivision ratio candidate set is imported into the data analysis environment, and the motor performance evaluation function is defined, which can include multiple performance indicators such as stability, accuracy, and energy consumption. Then, each ratio value in the candidate set is substituted into these evaluation functions to calculate the corresponding performance index score. Subsequently, a sorting algorithm (such as quick sort) is applied to sort all candidate solutions according to their performance index scores to form priority sorting result data. After the sorting is completed, the microstep subdivision ratio with the highest priority is officially confirmed as the optimal microstep subdivision ratio data.
[0137] The present invention can process uncertainty information through the application of fuzzy reasoning analysis, so as to more accurately determine the ratio range of motor microstep subdivision. Through global search, it is ensured that all candidate solutions are thoroughly explored within the entire microstep subdivision ratio range, thereby improving the probability of finding the optimal solution. Through the use of motor performance evaluation function, quantitative evaluation of candidate microstep subdivision ratios is achieved. Through priority sorting, the microstep subdivision ratio that best meets the current operating state and performance requirements can be identified, and the selection of control strategy is optimized. By determining the optimal microstep subdivision ratio, the motor control signal is made more refined, and the control accuracy and running smoothness of the motor are significantly improved. By dynamically adjusting the microstep subdivision ratio according to the real-time motor performance evaluation results, the adaptability and flexibility of the system are enhanced. By selecting the microstep subdivision ratio with the highest priority, the performance of the motor can be maximized, including reducing energy consumption, improving efficiency and increasing torque output.
[0138] Preferably, step S5 comprises the following steps:
[0139] Step S51: dynamically mapping and synchronizing the motor vibration suppression control strategy and the optimized motor drive signal to obtain a motor control instruction matrix;
[0140] Specifically, the model predictive control (MPC) toolbox in the MATLAB / Simulink environment can be used, combined with the event-driven mechanism of the real-time operating system (RTOS), to achieve dynamic mapping and synchronization between the motor vibration suppression control strategy and the optimized motor drive signal. Specifically, first, a motor control model based on model predictive control theory is constructed. The model takes into account the physical characteristics of the motor and the vibration suppression requirements, with the goal of minimizing vibration, while taking into account the motor efficiency and response speed. Then, the optimized motor drive signal (including the timing data of voltage and current) is used as input, and the signal conversion module is designed using the signal flow graph function of Simulink to convert the drive signal into a format that the MPC controller can understand. Then, by calling the mpcmove function in the MPC toolbox, the optimal control action is calculated based on the current motor state and the predicted future behavior. The event-driven mechanism of the RTOS is introduced, and whenever a new drive signal is received, an MPC control loop is triggered to update the control instructions. Finally, by repeatedly iterating this process, a series of control instructions that accurately map the motor vibration suppression control strategy and the drive signal are obtained, and these instructions are organized into a matrix form, namely the motor control instruction matrix.
[0141] Step S52: Intelligently compile and generate instructions for the motor control instruction matrix to obtain a motor dynamic control instruction sequence, and control the stepper motor according to the motor dynamic control instruction sequence.
[0142] Specifically, the Python language can be combined with a custom motor control instruction compiler to intelligently compile and generate instructions for the motor control instruction matrix. First, the control instruction matrix is converted into a multidimensional array in Python. Then, each line of control instructions is parsed and compiled using a custom instruction compiler, and converted into a low-level instruction sequence suitable for direct execution by the motor hardware. The compiler uses a state machine-based algorithm that can identify different control modes (such as position control, speed control, and torque control) and automatically select the most appropriate control instruction format based on the current motor state. Finally, the compiler outputs a series of motor dynamic control instruction sequences, including start instructions, end instructions, and continuous control instructions in the middle. These instruction sequences are sent to the motor driver, which is responsible for decoding the instruction sequence and converting it into actual motor drive signals, thereby achieving precise control of the stepper motor.
[0143] The present invention realizes efficient generation of control instructions through dynamic mapping and synchronization, and converts the vibration suppression control strategy and the optimized motor drive signal into an accurate motor control instruction matrix. The instruction sequence is further optimized through the application of intelligent compilation technology, and the processing efficiency and execution speed are improved. This series of control instructions ensures that the stepper motor operates according to precise logic, improves the accuracy of response and the consistency of action. At the same time, the precise control instructions reduce unexpected vibrations, enhance the stability and reliability of the system, and provide a strong guarantee for the high-performance operation and long-term stable use of the stepper motor.
[0144] Preferably, the present invention further provides a stepper motor driven control system for executing the stepper motor driven control method as described above, the stepper motor driven control system comprising:
[0145] The control mode switching module is used to monitor the running state and load condition of the stepper motor in real time, and obtain the motor running state data and the motor load condition data; based on the motor running state data and the motor load condition data, the control mode of the stepper motor is switched to obtain the motor control mode parameters;
[0146] The compensation signal calculation module is used to extract dynamic features of the motor operation status data based on the motor control mode parameters to obtain the motor dynamic feature vector; perform deep learning modeling based on the motor dynamic feature vector to obtain the motor vibration prediction model; perform real-time compensation control on the stepper motor according to the motor vibration prediction model to obtain the motor vibration suppression control strategy and the compensated motor control signal;
[0147] The position error calculation module is used to control the stepper motor according to the motor control mode parameters and the compensated motor control signal, and perform synchronous data acquisition to obtain the motor real-time position feedback data and motor speed feedback data; based on the motor real-time position feedback data and motor speed feedback data, the position error of the stepper motor is calculated to obtain the motor real-time position error data;
[0148] The drive signal optimization module is used to perform wavelet transform analysis on the motor operation status data to obtain the motor instantaneous frequency characteristic data; perform multi-scale resonance demodulation based on the motor real-time position error data and the motor instantaneous frequency characteristic data to obtain the optimal micro-step subdivision ratio data; modulate the stepper motor based on the optimal micro-step subdivision ratio data to obtain the optimized motor drive signal;
[0149] The control operation module is used to control the stepper motor according to the motor vibration suppression control strategy and the optimized motor drive signal.
[0150] In the present invention, through the adaptability of real-time monitoring and intelligent control mode, the accurate grasp of the motor operating state and load conditions, as well as the rapid response to different working conditions are ensured. Through the application of deep learning technology, accurate prediction and real-time compensation control of vibration are achieved, which significantly reduces the vibration and noise of the stepper motor during operation, and directly improves the working performance of the motor. Through the precise feedback of the position error calculation module, the accuracy and reliability of the control are further enhanced. Through the application of wavelet transform and wavelet packet decomposition technology, the drive signal is optimized, and the response speed and control accuracy of the motor are improved. In addition, the micro-step subdivision control accuracy of the system is improved, which meets the market demand for high-precision positioning. On the whole, the intelligent control operation execution of the system reduces human intervention and improves the consistency and reliability of operation. At the same time, the optimized control strategy and the reduction of dependence on high-cost closed-loop systems achieve maximum cost-effectiveness. The reliability and durability of the system are also enhanced by reduced mechanical stress and optimized control signals.
[0151] Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.
[0152] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.
Claims
1. A stepper motor drive control method, characterized in that: The following steps are involved: Step S1: monitor the running state and load condition of the stepper motor in real time to obtain the motor running state data and the motor load condition data; The control mode of the stepper motor is switched based on the motor operation state data and the motor load condition data to obtain the motor control mode parameters; wherein step S1 specifically includes: Step S11: monitoring the stepper motor with a multi-dimensional sensor array to obtain motor operation status data; Step S12: extracting current and voltage data from the motor running status data to obtain motor driving current data and motor driving voltage data; Step S13: segmenting the motor driving current data and the motor driving voltage data according to a preset time window to obtain instantaneous current segment data and instantaneous voltage segment data; Step S14: performing Hilbert-Huang transform on the instantaneous current segment data and the instantaneous voltage segment data to obtain motor operation characteristic spectrum data; Step S15: performing reverse modeling based on the motor operation characteristic spectrum data to obtain motor load condition data; Step S16: switching the control mode of the stepper motor based on the motor operation characteristic spectrum data and the motor load condition data to obtain motor control mode parameters; wherein step S16 specifically includes: Step S161: performing threshold segmentation on the motor load condition data to obtain motor load segmentation data; Step S162: Acquire motor task instruction data; Step S163: performing task type identification on the motor task instruction data to obtain motor task type data; Step S164: performing speed fluctuation analysis on the motor operation characteristic spectrum data to obtain motor speed stability data; Step S165: if the motor task type data indicates a fixed-point work type task, extracting the load extreme value of the motor load segmentation data to obtain the motor load peak value data; Step S166: performing parameter matching on the motor speed stability data and the motor load peak data based on a preset multi-dimensional parameter decision matrix to obtain motor control parameters, wherein the motor control parameters include current control parameters, speed configuration parameters and acceleration limit parameters, and marking the motor control parameters with an open-loop control identifier to obtain motor control mode parameters, wherein the motor control mode parameters include control mode identifier parameters, current control parameters, speed configuration parameters and acceleration limit parameters; Step S167: If the motor task type data indicates a mobile task, the motor task instruction data is subjected to maximum displacement identification to obtain the motor maximum displacement trajectory data; Step S168: performing parameter matching on the motor speed stability data and the motor maximum displacement trajectory data based on a preset multi-dimensional parameter decision matrix to obtain motor control parameters, wherein the motor control parameters include current control parameters, speed configuration parameters and acceleration limit parameters, and marking the motor control parameters with a closed-loop control identifier to obtain motor control mode parameters, wherein the motor control mode parameters include control mode identifier parameters, current control parameters, speed configuration parameters and acceleration limit parameters; Step S2: extracting dynamic features of the motor running state data based on the motor control mode parameters to obtain a motor dynamic feature vector; performing deep learning modeling based on the motor dynamic feature vector to obtain a motor vibration prediction model; performing real-time compensation control on the stepper motor according to the motor vibration prediction model to obtain a motor vibration suppression control strategy and a compensated motor control signal; Step S3: Control the stepper motor according to the motor control mode parameters and the compensated motor control signal, and perform synchronous data acquisition to obtain the motor real-time position feedback data and motor speed feedback data; calculate the position error of the stepper motor based on the motor real-time position feedback data and motor speed feedback data to obtain the motor real-time position error data; Step S4: performing wavelet transform analysis on the motor operation status data to obtain the motor instantaneous frequency characteristic data; performing multi-scale resonance demodulation according to the motor real-time position error data and the motor instantaneous frequency characteristic data to obtain the optimal micro-step subdivision ratio data; modulating the stepper motor based on the optimal micro-step subdivision ratio data to obtain the optimized motor drive signal; wherein step S4 specifically includes: Step S41: performing continuous wavelet transform on the motor running state data to obtain a time-frequency distribution diagram of the motor running state; Step S42: performing adaptive ridge extraction on the time-frequency distribution diagram of the motor running state to obtain instantaneous frequency characteristic data of the motor; Step S43: using the instantaneous frequency characteristic data of the motor as a carrier signal and the real-time position error data of the motor as a modulation signal to input into a preset multi-scale resonance demodulation algorithm for multi-dimensional signal demodulation to obtain a multi-scale demodulation signal set of the operating state; Step S44: performing empirical mode decomposition on the operating state multi-scale demodulation signal set to obtain an operating state intrinsic mode function set, wherein the operating state intrinsic mode function set includes a plurality of operating state intrinsic mode functions; Step S45: selecting the optimal subset of the operating state intrinsic mode function set according to the preset mutual information entropy evaluation criterion to obtain the optimized operating state intrinsic mode function subset; Step S46: performing micro-step subdivision ratio analysis based on the optimized operating state intrinsic mode function subset to obtain optimal micro-step subdivision ratio data; wherein step S46 specifically includes: Step S461: Perform fuzzy reasoning analysis on the subset of intrinsic mode functions of the optimized operating state to obtain motor micro-step subdivision ratio range data; Step S462: performing a global search on the motor micro-step subdivision ratio range data to obtain an optimal micro-step subdivision ratio candidate set, wherein the optimal micro-step subdivision ratio candidate set includes a plurality of candidate optimal micro-step subdivision ratio data; Step S463: quantitatively evaluate and sort the optimal micro-step subdivision ratio candidate set using a preset motor performance evaluation function to obtain priority sorting result data, and use the candidate optimal micro-step subdivision ratio data corresponding to the highest priority in the priority sorting result data as the optimal micro-step subdivision ratio data; Step S47: modulating the stepper motor based on the optimal micro-step subdivision ratio data to obtain an optimized motor drive signal; Step S5: controlling the stepper motor according to the motor vibration suppression control strategy and the optimized motor drive signal.
2. The stepper motor drive control method according to claim 1, characterized in that: Step S2 includes the following steps: Step S21: performing wavelet packet decomposition on the motor operation status data to obtain the operation status time-frequency characteristic data; Step S22: if the motor control mode parameter shows that the control mode of the stepper motor is open-loop control, threshold filtering is performed on the operating state time-frequency characteristic data to obtain open-loop mode operating characteristic data; Step S23: if the motor control mode parameter shows that the control mode of the stepper motor is closed-loop control, Kalman filtering is performed on the time-frequency characteristic data of the operating state to obtain closed-loop mode operating characteristic data; Step S24: performing principal component analysis on the open-loop mode operation characteristic data or the closed-loop mode operation characteristic data to obtain reduced-dimensionality characteristic data of the operation state; Step S25: performing nonlinear time series analysis on the dimension reduction feature data of the running state to obtain a motor dynamic feature vector; Step S26: obtaining a motor historical vibration data set, and performing autoencoder pre-training based on the motor historical vibration data set to obtain an initial motor vibration learning model; Step S27: using the motor dynamic feature vector to perform transfer learning and fine-tuning on the initial motor vibration learning model to obtain a motor vibration prediction model; Step S28: performing real-time compensation control on the stepper motor according to the motor dynamic characteristic vector and the motor vibration prediction model to obtain a motor vibration suppression control strategy and a compensated motor control signal.
3. The stepper motor drive control method according to claim 2, characterized in that: Step S28 includes the following steps: Step S281: performing time domain vibration prediction based on the motor dynamic feature vector using the motor vibration prediction model to obtain motor predicted vibration time domain data; Step S282: performing fast Fourier transform on the motor predicted vibration time domain data to obtain motor predicted vibration spectrum data; Step S283: performing resonance peak identification on the motor predicted vibration spectrum data to obtain motor vibration resonance peak characteristic data, and performing adaptive filter design based on the motor vibration resonance peak characteristic data to obtain an adaptive filter parameter set; Step S284: using the motor predicted vibration spectrum data as a constraint condition, constructing an MPC optimizer with minimizing the predicted vibration amplitude as the objective function, and obtaining an initial MPC optimization model; adjusting the parameters of the initial MPC optimization model according to the adaptive filter parameter set, and obtaining an optimized MPC objective function; Step S285: Calculate the optimal control sequence for the motor predicted vibration spectrum data using the MPC optimization objective function to obtain the motor vibration suppression control strategy; Step S286: collecting real-time control signals of the stepper motor to obtain original control signals of the motor; Step S287: performing signal compensation on the original motor control signal according to the motor vibration suppression control strategy to obtain a compensated motor control signal.
4. The stepper motor drive control method according to claim 1, characterized in that: Step S3 includes the following steps: Step S31: converting the compensated motor control signal into a micro-step drive signal to obtain a motor micro-step drive pulse sequence; Step S32: controlling the stepper motor according to the motor control mode parameters and the motor micro-step drive pulse sequence, and performing synchronous data acquisition to obtain the motor real-time position feedback data and motor speed feedback data; Step S33: collecting the running time of the stepper motor to obtain the actual running time data of the motor; Step S34: obtaining the motor target position data and the motor target speed data, and performing theoretical position calculation on the stepper motor according to the motor actual running time data, the motor target position data and the motor target speed data to obtain the motor theoretical position data; Step S35: Calculate the position error between the motor's real-time position feedback data and the motor's theoretical position data to obtain the motor's real-time position error data.
5. The stepper motor drive control method according to claim 1, characterized in that: Step S5 includes the following steps: Step S51: dynamically mapping and synchronizing the motor vibration suppression control strategy and the optimized motor drive signal to obtain a motor control instruction matrix; Step S52: Intelligently compile and generate instructions for the motor control instruction matrix to obtain a motor dynamic control instruction sequence, and control the stepper motor according to the motor dynamic control instruction sequence.
6. A control system driven by a stepper motor, characterized in that: For executing the control method of stepper motor drive according to claim 1, the control system of stepper motor drive comprises: The control mode switching module is used to monitor the running state and load condition of the stepper motor in real time, and obtain the motor running state data and the motor load condition data; based on the motor running state data and the motor load condition data, the control mode of the stepper motor is switched to obtain the motor control mode parameters; The compensation signal calculation module is used to extract dynamic features of the motor operation status data based on the motor control mode parameters to obtain the motor dynamic feature vector; perform deep learning modeling based on the motor dynamic feature vector to obtain the motor vibration prediction model; perform real-time compensation control on the stepper motor according to the motor vibration prediction model to obtain the motor vibration suppression control strategy and the compensated motor control signal; The position error calculation module is used to control the stepper motor according to the motor control mode parameters and the compensated motor control signal, and perform synchronous data acquisition to obtain the motor real-time position feedback data and motor speed feedback data; based on the motor real-time position feedback data and motor speed feedback data, the position error of the stepper motor is calculated to obtain the motor real-time position error data; The drive signal optimization module is used to perform wavelet transform analysis on the motor operation status data to obtain the motor instantaneous frequency characteristic data; perform multi-scale resonance demodulation based on the motor real-time position error data and the motor instantaneous frequency characteristic data to obtain the optimal micro-step subdivision ratio data; modulate the stepper motor based on the optimal micro-step subdivision ratio data to obtain the optimized motor drive signal; The control operation module is used to control the stepper motor according to the motor vibration suppression control strategy and the optimized motor drive signal.
Citation Information
Patent Citations
Interference torque measuring method and low-speed vibration restraining method of stepping motor
CN104539204A
Motor control method based on vibration signal, motor and storage medium
CN114070136A
