Stepping motor subdivision compensation method and device based on vector feedback
Through the stepper motor subdivision compensation method based on vector feedback, the problem of difficulty in compensation of position errors in stepper motors in the prior art under non-stationary working conditions is solved, real-time detection of position deviations and high-precision compensation are realized, and the positioning accuracy and operating stability of the motor are improved.
Patent Information
- Application Number
- CN202411910322.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-03-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing stepper motor control methods are difficult to effectively deal with the position error problem in the subdivided driving process. Especially in non-stationary operating conditions, the diagnosis and compensation of position deviations become difficult, resulting in the motor being lost or the positioning accuracy is reduced.
A stepper motor subdivision compensation method based on vector feedback is adopted, and a mathematical model of the vector feedback network is established by collecting the current signal of the stator winding and the rotor position pulse signal, so as to realize real-time detection and compensation of position deviations. The method includes multi-stage signal processing, dual-loop PID control structure and adaptive parameter adjustment strategy, which enhances the system's dynamic response capability and anti-interference performance.
Real-time detection and high-precision compensation of stepper motor position deviation are realized, effectively avoiding motor stepping, improving positioning accuracy and operating stability, and enhancing the system's adaptability and control accuracy under complex working conditions.
Smart Images

Figure CN119696424A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of stepper motors, and in particular to a stepper motor subdivision compensation method and device based on vector feedback. Background Art
[0002] Stepper motors usually operate in harsh environments such as high temperature and strong vibration, which may lead to reduced subdivision compensation accuracy or uniform position deviation failure, affecting the positioning accuracy and operation stability of the motor. Traditional stepper motor subdivision compensation methods are mainly based on open-loop control technology, which requires repeated adjustment of compensation parameters under different working conditions, which is not only time-consuming but also limited in practicality.
[0003] Existing stepper motor control methods often cannot effectively deal with the position error problem in the subdivision drive process, especially under non-stationary conditions, where the diagnosis and compensation of position deviation becomes more difficult. In addition, due to the lack of an effective feedback mechanism, traditional methods are difficult to detect and compensate for position deviation in real time, which can easily lead to step loss or reduced positioning accuracy of the stepper motor. Summary of the invention
[0004] The present invention provides a stepping motor subdivision compensation method and device based on vector feedback, which are used to realize real-time detection and compensation of position deviation and effectively avoid the motor out-of-step phenomenon.
[0005] In a first aspect, the present invention provides a stepper motor subdivision compensation method based on vector feedback, and the stepper motor subdivision compensation method based on vector feedback comprises: Collect the stator winding current signal and rotor position pulse signal of the stepper motor, and establish a vector feedback network mathematical model; Collecting the original operating parameter set of the stepper motor under rated working conditions, and performing preprocessing to obtain standardized processing data; Calculating a theoretical position value according to the standardized processing data and the vector feedback network mathematical model, and performing a deviation analysis between the measured position value and the theoretical position value to obtain position deviation characteristic data; The position deviation characteristic data is 2 M Divide into equal parts to obtain multiple subdivision points, and calculate the subdivision compensation standard data set; Inputting the subdivision compensation standard data set into the dual-loop PID controller, calculating the initial control parameters of the position loop and the speed loop according to the position deviation characteristic data, and outputting a first closed-loop control signal; The position deviation root mean square value is calculated based on the first closed-loop control signal, the target control parameter is calculated by the position deviation root mean square value in N consecutive control cycles, and is updated to the dual-loop PID controller to output a second closed-loop control signal.
[0006] In a second aspect, the present invention provides a stepper motor subdivision compensation device based on vector feedback, the stepper motor subdivision compensation device based on vector feedback comprising: Establish a module for collecting the stator winding current signal and rotor position pulse signal of the stepper motor, and establish a vector feedback network mathematical model; A preprocessing module, used for collecting the original operating parameter set of the stepper motor under rated working conditions, and performing preprocessing to obtain standardized processing data; An analysis module, used for calculating a theoretical position value according to the standardized processing data and the vector feedback network mathematical model, and performing a deviation analysis between the measured position value and the theoretical position value to obtain position deviation characteristic data; A division module is used to divide the position deviation characteristic data into two parts within a subdivision cycle. M Divide into equal parts to obtain multiple subdivision points, and calculate the subdivision compensation standard data set; A calculation module, used for inputting the subdivision compensation standard data set into a dual-loop PID controller, calculating initial control parameters of a position loop and a speed loop according to the position deviation characteristic data, and outputting a first closed-loop control signal; An output module is used to calculate the RMS value of the position deviation based on the first closed-loop control signal, obtain the target control parameter by calculating the RMS value of the position deviation within N consecutive control cycles, and update it to the dual-loop PID controller to output a second closed-loop control signal.
[0007] The third aspect of the present invention provides a stepper motor subdivision compensation device based on vector feedback, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the stepper motor subdivision compensation device based on vector feedback executes the above-mentioned stepper motor subdivision compensation method based on vector feedback.
[0008] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned vector feedback-based stepper motor subdivision compensation method.
[0009] In the technical solution provided by the present invention, a unified description of the electrical and mechanical characteristics of the stepper motor is achieved by establishing a vector feedback network mathematical model, thereby improving the accuracy and reliability of the model; a multi-level signal processing method is adopted, including wavelet noise reduction, digital low-pass filtering and normalization processing, which effectively reduces the impact of signal noise on system performance; a compensation mechanism based on subdivision points is introduced, through 2 MEqual division and nonlinear optimization algorithm realize high-precision position compensation; a dual-loop PID control structure is designed, combined with an adaptive parameter adjustment strategy to enhance the system's dynamic response capability and anti-interference performance; a gradient descent-based optimization algorithm and a dynamic learning rate adjustment mechanism are adopted to ensure real-time optimization of control parameters and stable operation of the system; through the combination of vector feedback and closed-loop control, real-time detection and compensation of position deviation are realized, effectively avoiding the motor out-of-step phenomenon; multi-level data processing and parameter optimization strategies are adopted to improve the system's adaptability and control accuracy under complex working conditions.
[0010] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0011] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 Schematic diagram of an embodiment of a stepping motor subdivision compensation method based on vector feedback in an embodiment of the present invention; Figure 2 It is a schematic diagram of an embodiment of a stepping motor subdivision compensation device based on vector feedback in an embodiment of the present invention; Figure 3 It is a schematic diagram of an embodiment of a stepper motor subdivision compensation device based on vector feedback in an embodiment of the present invention. DETAILED DESCRIPTION
[0013] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0014] The terms "including" and "having" and any variations thereof mentioned in the embodiments of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device end including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products, or device ends.
[0015] To facilitate understanding of this embodiment, a stepping motor subdivision compensation method based on vector feedback disclosed in an embodiment of the present invention is first described in detail. Figure 1 As shown, the method comprises the following steps: 101. Collect the stator winding current signal and rotor position pulse signal of the stepper motor, and establish a vector feedback network mathematical model; It is understandable that the execution subject of the present invention may be a stepper motor subdivision compensation device based on vector feedback, or a terminal or a server, which is not specifically limited here. The embodiment of the present invention is described by taking a server as the execution subject as an example.
[0016] Specifically, the A-phase and B-phase current signals of the stator winding in the stepper motor are synchronously sampled to ensure accurate capture of different phases in the current waveform and avoid errors caused by asynchronous sampling. The sampled A-phase and B-phase current signals are digitized by a 16-bit AD converter to achieve high-precision current signal capture and obtain the stator winding current signal, including current amplitude and phase information. At the same time, an encoder is installed on the rotor shaft of the stepper motor, and the output signal of the encoder is quadrupled by an orthogonal decoding circuit to extract accurate rotor position information. By quadrupling the encoder output signal, the resolution of the pulse signal is improved to provide more accurate rotor position information. Clark transformation is performed on the collected stator winding current signal. Clark transformation is to convert the three-phase AC current signal into components in the α-β coordinate system, thereby simplifying the analysis of the motor system. The current vector in the α-β coordinate system is more intuitive and suitable for subsequent control. Through Clark transformation, the current signals of phases A and B are converted into current components of the α-axis and β-axis to obtain the α-β axis current vector, which represents the distribution of the current in the stationary coordinate system. At the same time, by collecting the rising and falling edges of the rotor position pulse signal, the time interval between two adjacent pulse edges is calculated to obtain the rotor angle increment data. Using the rotor angle increment data, the angle is calculated by the inverse tangent function to obtain the rotor electrical angle value. By performing Park transformation on the α-β axis current vector and the rotor electrical angle value, the signal is converted from the stationary coordinate system to the rotating coordinate system. The current vector is converted into the dq axis current vector. The dq axis is the standard axis in the rotating coordinate system and can effectively reflect the magnetic field distribution state of the motor. The electromagnetic mathematical model of the motor is established. According to the electromagnetic characteristics of the stepper motor, the stator voltage equation is established, which describes the relationship between the stator current and voltage in the motor. The dq axis current vector and the electrical parameters of the motor are substituted into the stator voltage equation to obtain the electromagnetic mathematical model of the motor. On the basis of the electromagnetic mathematical model, the mechanical characteristics of the motor are considered and the mechanical rotation equation is added. This equation describes the rotation of the rotor under the action of external load or friction. By inputting parameters such as the rotor moment of inertia, friction coefficient and load torque, a complete mechanical rotation equation is established to obtain the electromechanical coupling model. The electromagnetic mathematical model and the mechanical rotation equation are combined to form an electromechanical coupling model, which is then associated and mapped with the dq axis current vector and the rotor position pulse signal. Through the association mapping, an accurate vector feedback network mathematical model is obtained. This model can dynamically adjust the motor control strategy so that the motor can adaptively compensate for the subdivision error during operation, thereby improving positioning accuracy and response speed.
[0017] 102. Collect the original operating parameter set of the stepper motor under rated working conditions, and perform preprocessing to obtain standardized processing data; Specifically, a standard load test is performed on the stepper motor under rated working conditions, and the phase current, phase voltage, speed and position signals of the stepper motor at rated speed are collected by sensors to obtain the original operating parameter set. The original operating parameter set is subjected to wavelet decomposition. Wavelet transform is a signal processing method that can effectively analyze the characteristics of signals in different frequency bands. Through wavelet decomposition, the original signal is decomposed into sub-signals of different frequency bands to obtain wavelet coefficients, which can reflect the energy distribution of the signal in different frequency bands. The wavelet coefficients are denoised by a soft threshold processing method based on a threshold function. The soft threshold method adjusts the wavelet coefficients to remove noise components while retaining useful information in the signal to obtain the denoised wavelet coefficients. The denoised wavelet coefficients are subjected to wavelet reconstruction operation. The denoised wavelet coefficients of each frequency band are recombined to restore the signal after preliminary denoising. The preliminary denoised signal is input into a Chebyshev II digital low-pass filter. The Chebyshev II filter is a filter with high performance and is suitable for situations where there is strong low-frequency noise in the signal. By setting the cutoff frequency to 1 / 10 of the sampling frequency, most of the high-frequency components are effectively filtered out, and the low-frequency part of the signal is retained to obtain the filtered signal. The filtered signal is normalized to adjust the amplitude of the signal to a uniform scale so that the signals under different experimental conditions can be compared under the same standard to obtain standardized data. The signal-to-noise ratio and mean square error are calculated based on the standardized data, and the quality of the processed data is evaluated. The signal-to-noise ratio is an important indicator for measuring signal quality. A higher signal-to-noise ratio means that there is more effective information in the signal, which is larger than the noise ratio; the mean square error is used to measure the difference between the signal and the real signal. A smaller mean square error indicates that the error in the signal processing process is smaller and the data quality is higher. Based on the calculation of these two indicators, the effect of the data processing process is evaluated to ensure the accuracy and reliability of the data. The time series is rearranged to ensure that the order of the data is consistent with the time relationship to obtain standardized data.
[0018] 103. Calculate the theoretical position value according to the standardized processing data and the vector feedback network mathematical model, and perform deviation analysis between the measured position value and the theoretical position value to obtain position deviation characteristic data; Specifically, the standardized data is input into the mathematical model of the vector feedback network. The vector feedback network generates an ideal theoretical position value according to the electromagnetic characteristics, mechanical characteristics and motion state of the motor. The Runge-Kutta fourth-order algorithm is used for numerical solution. The Runge-Kutta fourth-order algorithm is an accurate numerical integration method that can effectively solve the state quantity in a multi-dimensional nonlinear system. Through this algorithm, the theoretical state quantity is obtained, and the coordinate transformation of these state quantities is performed to convert the current and position data in the dq axis coordinate system into the theoretical position value. The dq axis coordinate system is a rotating reference system that can better match the electromagnetic characteristics and motion behavior of the motor. After obtaining the theoretical position value, the measured position value is compared with the theoretical position value and the deviation is analyzed. Due to the existence of noise and error in the actual system, the measured data is filtered to improve its accuracy. The Kalman filter is used to estimate the state and filter the noise of the measured position value. The Kalman filter is an optimal estimator that can effectively estimate the system state and remove the noise component. The smoothed position value after filtering is obtained by processing the measured position value with the Kalman filter. The position deviation is obtained by calculating the difference between the filtered measured position value and the theoretical position value. Fourier transform is performed on the position deviation sequence to extract frequency domain feature data. Fourier transform is a signal processing technology that can convert time domain signals into frequency domain signals, thereby revealing the spectral characteristics of the signal. In the position deviation sequence, frequency domain analysis can help identify the periodic components and noise components in the error signal. Through Fourier transform, the frequency domain feature data of the deviation sequence is extracted. The position deviation distribution characteristics are combined with the frequency domain feature data to construct the main feature vector. Cluster analysis is performed on the main feature vector. Cluster analysis is a data mining technology that can classify data with similar characteristics into the same category. Cluster analysis divides the position deviation pattern into multiple categories, each category representing a typical deviation pattern. This process helps to identify various error patterns that occur in the motor under different working conditions, thereby providing targeted solutions for subsequent compensation. The deviation pattern classification results are combined with the main feature vector to construct the position deviation feature data.
[0019] 104. Perform 2 on the position deviation feature data within the subdivision cycle. M Divide into equal parts to obtain multiple subdivision points, and calculate the subdivision compensation standard data set; Specifically, the periodicity of the position deviation characteristic data is identified. The periodicity characteristics in the signal are identified through the autocorrelation function, so as to calculate the basic period of the signal. The basic period reflects the repetitive law of the position deviation of the motor under certain working conditions. The basic period is used as the subdivision period to obtain the subdivision reference period. The subdivision reference period defines the regularity of the position change in unit time. The subdivision reference period is divided according to the set subdivision level M. According to the set subdivision level M, the subdivision reference period is divided into two M Divide the subdivision cycle into 2M Evenly distributed sampling points, each sampling point represents a position change point within the subdivision period. In this way, a M The sampling point sequence of subdivision points. For the generated subdivision point position data, the actual position curve corresponding to each subdivision point is calculated by the cubic spline interpolation method. Cubic spline interpolation is a smooth interpolation method that constructs a smooth curve between known data points to ensure the continuity and smoothness of the interpolation result. Through interpolation, the actual position interpolation function is obtained to describe the position change of the motor within the subdivision cycle. The actual position curve reflects the actual position deviation caused by factors such as load change and control error during the operation of the motor. The actual position interpolation function is interpolated with the theoretical position curve to obtain the deviation sequence of the subdivision point position. The theoretical position curve is the ideal position calculated by the control algorithm and mathematical model. The difference operation can reveal the deviation between the actual position and the theoretical position, reflecting the error in the system. The least squares optimization equation is established according to the subdivision point deviation sequence. The least squares method finds the optimal solution by minimizing the sum of squares of the deviations. The optimization equation is established by the least squares method to calculate the compensation weight coefficients of each subdivision point. These compensation weight coefficients represent the contribution of each subdivision point to the compensation. The calculated initial compensation parameters reflect the overall compensation requirements of the motor within the subdivision cycle. The initial compensation parameters are nonlinearly optimized. According to the actual operation situation, the compensation parameters are adjusted to minimize the position deviation. Through iterative optimization, the optimized compensation coefficient can more accurately reflect the compensation requirements of the motor in actual operation, thereby improving the accuracy of position control. The process of optimizing the compensation coefficient uses gradient descent, Newton's method or other suitable optimization algorithms to gradually adjust the compensation coefficient until the error is minimized. The compensation position of the subdivision point is calculated according to the optimized compensation coefficient, and the position compensation value is generated for each subdivision point. The position compensation value is calculated based on the deviation between the optimized compensation coefficient and the subdivision point position, effectively correcting the actual position of the motor to make it closer to the theoretical position. Generate a subdivision compensation standard data set containing position compensation values and compensation coefficients.
[0020] 105. Input the subdivision compensation standard data set into the dual-loop PID controller, calculate the initial control parameters of the position loop and the speed loop according to the position deviation characteristic data, and output the first closed-loop control signal; Specifically, the subdivided compensation standard data set is input into the dual-loop PID controller. The controller adjusts the control parameters according to the actual system feedback to optimize the operating performance of the stepper motor. The parameter search range of the position loop and the speed loop is determined based on the statistical characteristics of the position deviation characteristic data to obtain the initial interval of the control parameters. By analyzing the position deviation data, the distribution characteristics of the error are extracted to help the system determine a reasonable parameter range for each link of the PID controller to avoid excessive or too small control quantities, thereby ensuring the stability and response speed of the controller. The position loop and the speed loop are parameterized. The core goal of the position loop control is to make the actual position of the motor match the theoretical position as much as possible. When performing the position loop parameter tuning, the proportional coefficient Kp, integral coefficient Ki and differential coefficient Kd of the position loop are calculated. The proportional coefficient Kp is responsible for adjusting the rapid response of the system, the integral coefficient Ki is used to eliminate steady-state errors, and the differential coefficient Kd can reduce the overshoot and oscillation of the system. By adjusting these three parameters, the control effect of the position loop is optimized to make it more accurate when tracking the target position. In the process of speed loop parameter tuning, the speed response of the motor is concerned, so the proportional coefficient Kv, integral time constant Ti and differential time constant Td of the speed loop are calculated. Similar to the position loop, the proportional coefficient Kv determines the speed response amplitude, the integral time constant Ti helps to eliminate static errors, and the differential time constant Td is used to improve the response of speed changes and make it more stable. These control parameters of the position loop and speed loop can achieve efficient and accurate control of the stepper motor through reasonable tuning. According to the control parameters obtained by tuning, the transfer function of the controller is constructed. The transfer function can describe the relationship between the input and output of the system. In digital control, the transfer function of the continuous domain is converted into a Z-domain differential equation for implementation in a discrete time system. Through conversion, the continuous control algorithm is converted into an algorithm suitable for digital computers, so as to realize PID control on a microprocessor or digital controller. In this process, the coefficients of the differential equation are determined by the previously tuned PID parameters to ensure that the controller can maintain good control performance in discrete time. In order to prevent the motor from overloading or damage during operation, the control output of the position loop and speed loop is limited to a preset range of the motor rated current. The purpose of current limiting is to prevent the control signal from exceeding the range of the motor drive capability and ensure that the motor operates within a safe operating range. After calculating the digital PID control equation, its output is limited to obtain the limiting control parameters. The limiting process ensures that the control signal is within the set maximum current range, thereby avoiding motor current overload due to excessive control signals and ensuring the stability of the system. An anti-saturation corrector is constructed based on the limiting control parameters. The anti-saturation corrector corrects the controller output through integral separation and dead zone compensation methods, thereby improving the impact of saturation effects on the control signal. The integral separation method can maintain the normal operation of the integrator in the saturated state, while the dead zone compensation corrects the error caused by limiting.These correction methods can effectively improve the accuracy and stability of the control system under limiting conditions and avoid error accumulation caused by saturation. Substitute the control parameters after anti-saturation correction into the digital PID control equation to calculate the real-time control quantity of the position loop and speed loop. Through real-time calculation, the controller can dynamically adjust the control signal according to the feedback of the actual system and output the first closed-loop control signal.
[0021] 106. Calculate the RMS value of the position deviation based on the first closed-loop control signal, obtain the target control parameter by calculating the RMS value of the position deviation in N consecutive control cycles, and update it to the dual-loop PID controller to output the second closed-loop control signal.
[0022] Specifically, actual position data within N control cycles are collected according to the first closed-loop control signal. The deviation sequence between the actual position data and the given position instruction is calculated to obtain real-time position deviation data. The real-time position deviation data is subjected to a root mean square operation to effectively remove short-term fluctuations, extract the long-term trend of the position error, reflect the overall performance of the system within multiple cycles, and obtain the root mean square value of the position deviation. By performing a root mean square operation on the position deviation of each control cycle, a performance evaluation sequence containing N sampling points is constructed. Based on the performance evaluation sequence, an optimization objective function is constructed to improve the control accuracy by minimizing the root mean square value of the position deviation. In the optimization objective function, the weighted sum of the root mean square values of the position deviation is used as the objective function value, which reflects the overall control accuracy of the system. The goal is to minimize this value by adjusting the parameters of the PID controller. By analyzing the relationship between the objective function and the control parameters, a sensitivity analysis is performed on the control parameters to determine the optimization direction of the parameters. According to the results of the sensitivity analysis, a stochastic gradient descent model is established. Stochastic gradient descent is an optimization algorithm that gradually approaches the optimal solution by calculating the gradient of the objective function in each iteration and adjusting the parameters along the negative gradient direction. In order to improve the convergence speed and avoid oscillation, the stochastic gradient descent is set with a suitable learning rate and iteration step size. The learning rate determines the amplitude of each update, while the iteration step size controls the frequency of updates. By setting these two parameters reasonably, it is ensured that the optimization process neither converges too slowly nor oscillates too much, thereby achieving stable parameter adjustment. In order to improve the optimization effect, a dynamic learning rate adjustment function is introduced. Dynamic learning rate adjustment can adaptively adjust the learning rate according to the changing trend of the objective function value to avoid the situation where the learning rate is too large or too small during the optimization process. When the objective function value changes greatly, the learning rate is appropriately increased to accelerate convergence; when the objective function value changes tend to be stable, the learning rate should be reduced to improve the stability of optimization. Through the dynamic adjustment mechanism, the optimization process is made more efficient and stable. In the optimization process, Momentum correction is introduced. Momentum correction corrects the parameter update direction by introducing historical gradient information, makes full use of historical information in the control parameter update process, and avoids oscillation caused by too fast gradient changes, especially when the gradient is small or changes slowly. Momentum correction can accelerate the convergence process and make the optimization process smoother, thereby improving the stability and accuracy of the final control parameters. After dynamic learning rate adjustment and Momentum correction, the target control parameters are obtained. These control parameters represent the optimal control parameters that minimize the root mean square value of the position deviation under the current working conditions. The target control parameters are input into the dual-loop PID controller to update the control parameters of the position loop and the speed loop. With the updated control parameters, the dual-loop PID controller can perform closed-loop control operations based on real-time feedback, thereby adjusting the motion state of the motor to minimize the error between the actual position of the motor and the theoretical position.After the closed-loop control operation, the controller output signal is adjusted through PWM modulation. PWM modulation can adjust the motor drive current according to the amplitude and frequency of the control signal to achieve precise speed and position control. Current feedback compensation is performed. Current feedback compensation can effectively eliminate the influence of motor current fluctuations on control accuracy, thereby improving the stability and reliability of the control system. Through PWM modulation and current feedback compensation, the control system outputs a second closed-loop control signal, which is used to drive the precise movement of the stepper motor.
[0023] In the embodiment of the present invention, by establishing a vector feedback network mathematical model, a unified description of the electrical and mechanical characteristics of the stepper motor is achieved, and the accuracy and reliability of the model are improved; a multi-level signal processing method is adopted, including wavelet noise reduction, digital low-pass filtering and normalization processing, which effectively reduces the impact of signal noise on system performance; a compensation mechanism based on subdivision points is introduced, and through 2 M Equal division and nonlinear optimization algorithm realize high-precision position compensation; a dual-loop PID control structure is designed, combined with an adaptive parameter adjustment strategy to enhance the system's dynamic response capability and anti-interference performance; a gradient descent-based optimization algorithm and a dynamic learning rate adjustment mechanism are adopted to ensure real-time optimization of control parameters and stable operation of the system; through the combination of vector feedback and closed-loop control, real-time detection and compensation of position deviation are realized, effectively avoiding the motor out-of-step phenomenon; multi-level data processing and parameter optimization strategies are adopted to improve the system's adaptability and control accuracy under complex working conditions.
[0024] In a specific embodiment, the process of executing step 101 may specifically include the following steps: The A-phase and B-phase current signals of the stator winding in the stepper motor are synchronously sampled, and the A-phase and B-phase current signals are digitized through a 16-bit AD converter to obtain the stator winding current signal; An encoder is installed on the rotor shaft of the stepper motor, and the output signal of the encoder is processed by quadruple frequency through an orthogonal decoding circuit to obtain a rotor position pulse signal; Clark transformation is performed on the stator winding current signal to convert the A-phase and B-phase current signals into current components in the α-β coordinate system to obtain the α-β axis current vector. The rising and falling edges of the rotor position pulse signal are collected to calculate the time interval between two adjacent pulse edges to obtain the rotor angle increment data. Substitute the rotor angle increment data into the inverse tangent function for calculation to obtain the rotor electrical angle value, and perform Park transformation on the α-β axis current vector and the rotor electrical angle value to obtain the dq axis current vector; According to the electromagnetic characteristics of the stepper motor, a stator voltage equation is established, and the dq axis current vector and motor parameters are substituted into the stator voltage equation to obtain an electromagnetic mathematical model. A mechanical rotation equation is added to the electromagnetic mathematical model, and the rotor moment of inertia, friction coefficient and load torque parameters are input into the mechanical rotation equation to obtain an electromechanical coupling model. The electromechanical coupling model is associated and mapped with the dq axis current vector and the rotor position pulse signal to construct a mathematical model of the vector feedback network.
[0025] Specifically, the A-phase and B-phase current signals of the stator winding of the stepper motor are synchronously sampled. The movement of the stepper motor is determined by the current flowing through the stator winding, and the change of the current will directly affect the rotation state of the rotor. The purpose of synchronous sampling is to ensure that the A-phase and B-phase current signals are captured at the same time point to avoid signal distortion caused by inconsistent sampling. In order to perform synchronous sampling, a 16-bit analog-to-digital converter is used to convert the analog current signal into a digital signal to facilitate subsequent digital processing and analysis. In this way, the obtained stator winding current signal includes the A-phase and B-phase current data at each moment. The angle of the rotor is measured by installing an encoder on the rotor shaft of the stepper motor. The encoder outputs a pulse signal, which is directly related to the position and motion state of the rotor. In order to improve the accuracy of position detection, an orthogonal decoding circuit is used to perform quadruple frequency processing on the output signal of the encoder. The quadruple frequency processing can increase the resolution of the encoder pulse signal by four times and obtain more accurate rotor position data. After quadruple frequency processing, a rotor position pulse signal is obtained, in which each pulse represents a small change in the rotor position. Clark transformation is performed on the current signal of the stator winding to convert the A-phase and B-phase current signals from the traditional rectangular coordinate system to the α-β coordinate system. The formula for Clark transformation is as follows: ; in, and are the A phase and B phase currents respectively, and is the converted current component. This transformation can convert the current signal originally existing in two phases into the current component in the symmetrical coordinate system, making the subsequent motor control more concise and efficient. In order to calculate the position and angle of the rotor, the rising and falling edges of the rotor position pulse signal are collected, and the time interval between two adjacent pulse edges is calculated. The time interval calculation formula is: ; in, is the falling edge moment, is the rising edge moment, is the time interval between two pulse edges. Based on this time interval, the rotor angle increment data is obtained. Since each pulse represents a fixed angle of rotor movement, the current position of the rotor is calculated by calculating the angle increment corresponding to each time interval. Substitute the rotor angle increment data into the inverse tangent function for calculation to obtain the rotor electrical angle value. The calculation formula for the electrical angle is as follows: ; in, is the electrical angle of the rotor, and is the current component after Clark transformation. Through this step, the electrical angle value of the rotor in the α-β coordinate system is calculated. The α-β axis current vector is converted to the dq axis current vector using Park transformation. The formula of Park transformation is as follows: ; in, and are the current components of the d-axis and q-axis respectively, is the rotor electrical angle. Through transformation, the current vector in the α-β coordinate system is converted into the synchronously rotating dq coordinate system. The d-axis represents the current component consistent with the direction of the rotor magnetic field, and the q-axis represents the current component perpendicular to the direction of the rotor magnetic field. After completing the transformation of the current signal, the stator voltage equation is established according to the electromagnetic characteristics of the stepper motor. The stator voltage equation describes the relationship between the motor stator voltage and current in the following form: ; ; in, and are the voltages of the d-axis and q-axis respectively, and are the currents of the d-axis and q-axis, is the stator resistance, is the stator inductance, is the angular velocity of the rotor. Substituting the dq axis current vector and the motor parameters into the stator voltage equation, we get the electromagnetic mathematical model, which describes the electromagnetic behavior of the motor. In order to consider the mechanical dynamics of the motor, the mechanical rotation equation is added. The mechanical rotation equation describes the relationship between the angular acceleration of the rotor and the rotor moment of inertia, friction coefficient and load torque. The form of the mechanical rotation equation is: ; in, is the moment of inertia of the rotor, is the coefficient of rotational friction, is the electromagnetic torque, is the load torque, is the angle of the rotor. By inputting the rotor moment of inertia, friction coefficient and load torque parameters into the equation, an electromechanical coupling model is obtained, which integrates the electromagnetic and mechanical characteristics of the motor. The electromechanical coupling model is associated and mapped with the dq axis current vector and the rotor position pulse signal to construct a vector feedback network mathematical model. The model can reflect the operating status of the stepper motor in real time and provide necessary feedback information for subsequent control strategies. By continuously adjusting the control parameters, the system can optimize the operating performance of the motor and improve the positioning accuracy and stability of the stepper motor.
[0026] In a specific embodiment, the process of executing step 102 may specifically include the following steps: Perform a standard load test on the stepper motor, collect the phase current, phase voltage, speed and position signals of the stepper motor at rated speed through sensors, and obtain the original operating parameter set; Perform wavelet decomposition on the original operating parameter set to obtain wavelet coefficients of different frequency bands, and perform soft threshold processing on the wavelet coefficients based on the threshold function to obtain the denoised wavelet coefficients; Perform wavelet reconstruction operation on the denoised wavelet coefficients to obtain a preliminary denoised signal, and input the preliminary denoised signal into a Chebyshev II digital low-pass filter, set the cutoff frequency to 1 / 10 of the sampling frequency, and obtain a filtered signal; The filtered signal is normalized to obtain standardized data, and the signal-to-noise ratio and mean square error are calculated based on the standardized data. Data quality assessment and time series rearrangement are performed to obtain standardized processed data.
[0027] Specifically, a standard load test is performed on the stepper motor, and the operating parameters of the stepper motor at the rated speed are collected, including phase current, phase voltage, speed and position signals, to obtain the original operating parameter set, which reflects the behavior of the motor under standard working conditions. The collection of the original operating parameter set is achieved through a set of sensors that can capture various key data of the motor in real time. For example, phase current and voltage are measured by current transformers and voltage sensors, and speed and position signals are obtained by tachometers and encoders. The original operating data is subjected to wavelet decomposition. Wavelet decomposition is a technology that can effectively analyze components in different frequency bands in a signal. Through wavelet transform, the original signal is decomposed into multiple frequency bands, each of which represents the local characteristics of the signal at different scales. Wavelet transform converts the original signal Decomposed into a set of detail components and approximation components of different scales, namely: ; in, are the wavelet coefficients, is the wavelet basis function, and Represent the parameters of scale and position respectively. Wavelet transform enables the system to analyze the signal characteristics of different frequency bands. Soft threshold processing is performed on the wavelet coefficients to reduce the influence of noise. The wavelet coefficients are screened and the coefficients below a certain threshold are removed to achieve the denoising effect. The expression of the soft threshold function is: ; in, are the wavelet coefficients, is the threshold, sign represents the sign of the coefficient, It represents the result after subtracting the threshold from the coefficient size, and if the result is less than 0, it is taken as 0. This method can effectively remove the components with noise less than the threshold while retaining the important features in the signal. Perform wavelet reconstruction operation to resynthesize the denoised coefficients into a preliminary denoised signal. Wavelet reconstruction operation is the inverse process of wavelet transform, which reconstructs the detail component and approximation component back to the approximate form of the original signal. The formula is expressed as: ; The reconstructed signal is a preliminary signal after denoising, which is input into the Chebyshev II digital low-pass filter for filtering. The Chebyshev II filter is a digital filter with low ripple and fast decay characteristics, which can effectively remove high-frequency noise. Its transfer function is: ; in, is the attenuation coefficient of the filter, is the cutoff frequency, is the order of the filter. Setting the cutoff frequency to 1 / 10 of the sampling frequency ensures that high-frequency noise exceeding this frequency is filtered out. Through the processing of the filter, the high-frequency components of the signal are effectively suppressed to obtain the filtered signal. The filtered signal is normalized. The amplitude of the signal is adjusted to a standard range, the maximum value of the signal is adjusted to 1, or the signal is adjusted to a fixed standardized range. The formula for normalization is: ; in, is the filtered signal, is the maximum absolute value of the signal, is the normalized signal. Calculate the signal-to-noise ratio (SNR) and mean square error (MSE) of the signal. The signal-to-noise ratio is the ratio of the signal strength to the noise strength and is calculated using the following formula: ; in, is the useful component of the signal, is the noise component. The mean square error is the average of the squares of the differences between the signal and the actual value, and is calculated as: ; in, is the total number of data points, is the actual collected signal value, is the expected true signal value. The signal-to-noise ratio and mean square error can effectively reflect the noise level and error in the signal processing process and help evaluate the effect of data processing. The time series is rearranged so that the order of the signal is more in line with the needs of analysis and processing. By reordering the time series, the data processing efficiency and the accuracy of the analysis are improved. Standardized processed data is obtained.
[0028] In a specific embodiment, the process of executing step 103 may specifically include the following steps: The standardized processed data is input into the vector feedback network mathematical model, and the Runge-Kutta fourth-order algorithm is used to perform numerical solution to obtain the theoretical state quantity, and the coordinate transformation of the theoretical state quantity is performed to convert the current and position data in the dq axis coordinate system into the theoretical position value; A Kalman filter is constructed based on the theoretical position value, and the state estimation and noise filtering are performed on the measured position value to obtain the filtered position value, and the difference between the filtered position value and the theoretical position value is calculated to obtain the deviation distribution characteristics; Perform Fourier transform on the position deviation sequence to obtain frequency domain feature data, and construct the main feature vector according to the deviation distribution characteristics and the frequency domain feature data; Cluster analysis is performed on the main feature vector to classify the position deviation pattern into multiple categories to obtain the deviation pattern classification result, which is then combined with the main feature vector to construct the position deviation feature data.
[0029] Specifically, the standardized processed data is input into the mathematical model of the vector feedback network. The model describes the relationship between the stator current and the rotor position based on the physical and electrical characteristics of the motor. In order to calculate the theoretical state quantity of the system, the Runge-Kutta fourth-order algorithm is used for numerical solution. The Runge-Kutta method is a method for solving ordinary differential equations numerically, and its fourth-order format has high accuracy. Assume that the state equation of the system is: ; in, is the state vector of the system, is the dynamic equation of the system, which expresses the rate of change of the system state with respect to time. When using the Runge-Kutta fourth-order algorithm, the state variables are discretized to obtain the state estimate for each time step. The calculation steps of the fourth-order Runge-Kutta method are: ; ; ; ; ; in, is the intermediate value calculated in different ways, is the step length, is the current time. Update the state vector by iteration , get the theoretical state quantity of the system. Perform coordinate transformation on the theoretical state quantity. Since the stepper motor uses the dq axis coordinate system, the theoretical current and position data are represented on the dq axis. In order to compare with the actual rotor position data, the current and position data in the dq axis coordinate system are converted to theoretical position values. This process involves Park transformation and inverse Park transformation. Park transformation converts the three-phase current signal ( ) is converted into the current components of the direct axis d and the quadrature axis q. The conversion formula is: ; in, is the electrical angle of the motor rotor, and are the current components of the d-axis and q-axis respectively. After obtaining the theoretical position value, a Kalman filter is constructed to perform state estimation and noise filtering on the measured position value. The Kalman filter is a recursive filtering algorithm that can estimate the state of the system by continuously updating the measured data. The state estimation equation of the Kalman filter is: ; in, is the predicted state estimate, is the measured value at the current moment, is the measurement matrix, is the Kalman gain, which determines the trade-off between system prediction and measurement. The calculation formula of Kalman gain is: ; in, is the predicted error covariance matrix, is the measurement noise covariance matrix. The filtered position value is obtained by weighting the current measurement value and the previous estimate value, which effectively suppresses the influence of noise and obtains a more accurate position estimate. The difference between the filtered position signal and the theoretical position value is calculated to obtain the position deviation sequence. The position deviation sequence is the difference between the actual position and the theoretical position, revealing the error between the motor control accuracy and the theoretical control. For each time point , the position deviation calculation formula is: ; in, is the measured position, is the theoretical position. By analyzing the deviations at all times, the distribution characteristics of the deviations are obtained. Fourier transform is performed on the position deviation sequence to convert the position deviation from the time domain to the frequency domain in order to analyze the frequency characteristics of the deviation. The formula for Fourier transform is: ; in, is the frequency domain representation, is the time domain signal, is the frequency, is an imaginary unit. Fourier transform converts the position deviation signal into the amplitude spectrum and phase spectrum in the frequency domain, revealing the contribution of different frequency components to the position error, and helping to identify periodic errors or other frequency characteristics in the control system. According to the deviation distribution characteristics and frequency domain feature data, the main eigenvector is constructed. By analyzing the main features in the deviation signal, the eigenvalues that can represent the system error pattern are extracted. For example, the main direction and change pattern are extracted from the deviation sequence through principal component analysis. These main eigenvectors reflect the main components of the position error in the control system. Cluster analysis is performed on the main eigenvectors. Similar error patterns are grouped together for pattern recognition and classification. Different deviation patterns are divided into multiple categories through clustering algorithms (such as K-means clustering, hierarchical clustering, etc.), each category represents an error feature or control deviation pattern. The results of cluster analysis help identify the source of errors in the control system. The deviation pattern classification results are combined with the main eigenvector to construct the position deviation feature data.
[0030] In a specific embodiment, the process of executing step 104 may specifically include the following steps: Perform period recognition on the position deviation feature data, calculate the basic period of the signal based on the autocorrelation function, and use the basic period as the subdivision period to obtain the subdivision reference period; According to the set subdivision level M, the subdivision base cycle is 2 M Divide equally, generate 2 M A sequence of subdivision sampling points evenly distributed at different angles is obtained to obtain the subdivision point position data; Perform cubic spline interpolation on the subdivision point position data, calculate the actual position curve corresponding to each subdivision point, obtain the actual position interpolation function, and perform difference operation between the actual position interpolation function and the theoretical position curve at each subdivision point to obtain the subdivision point deviation sequence; According to the deviation sequence of subdivision points, the least square optimization equation is established, the compensation weight coefficient of each subdivision point is calculated, the initial compensation parameters are obtained, and the initial compensation parameters are nonlinearly optimized to obtain the optimized compensation coefficients; The compensation position of the subdivision points is calculated according to the optimized compensation coefficient, and a subdivision compensation standard data set including position compensation values and compensation coefficients is generated.
[0031] Specifically, the periodicity of the position deviation feature data is identified to extract the periodic error pattern in the motor control process. The basic period of the signal is calculated through the autocorrelation function. The autocorrelation function is a tool to measure the similarity between a signal and itself at different time delays. The periodicity of the signal is detected by calculating the inner product of the signal and itself. The definition of the autocorrelation function is: ; in, is the autocorrelation function, is the original signal, is the time delay. By analyzing the autocorrelation function, we can find the position of its maximum value. , which is the basic cycle of the signal. This basic cycle represents the periodic error of the motor during operation. The basic cycle is used as the subdivision cycle to obtain the subdivision reference cycle. According to the set subdivision level , for the subdivided benchmark period Equally divide, generate The subdivision sampling points are evenly distributed at different angles. The subdivision sampling points are equally divided according to the angle of the subdivision period, that is, the angular interval between each sampling point is: ; in, is the angular spacing between each subdivision point, The number of subdivision points determined by the subdivision level. for: ; These subdivision point position data are evenly distributed in each subdivision cycle of the motor rotor angle to form a new sampling point sequence. The subdivision point position data is interpolated with cubic spline to calculate the actual position curve corresponding to each subdivision point. Cubic spline interpolation is a commonly used smooth interpolation method used to calculate the continuity and smoothness of the curve between discrete data points. The form of the cubic spline interpolation function is: ; in, is the interpolation function, is the coefficient to be determined, are known data points, is the interpolation point. By solving a set of linear equations, the coefficients of each interpolation interval are determined, and the interpolation function is obtained. . Using this interpolation function, interpolation calculation is performed between the subdivision point position data to obtain the actual position value of each subdivision point. The actual position interpolation function is interpolated with the theoretical position curve to obtain the subdivision point deviation sequence. The theoretical position curve is the ideal position data calculated based on the motor theoretical model, while the actual position curve is obtained through experiments or measurements. The formula for the difference operation is: ; in, It is in The actual position calculated on the subdivision points, is the corresponding theoretical position. The deviation between the actual position and the theoretical position at each subdivision point is reflected, and then the subdivision point deviation sequence is formed. According to the subdivision point deviation sequence, the least squares optimization equation is established to calculate the compensation weight coefficient of each subdivision point. The least squares method is a method used to solve parameter estimation problems, and the best fitting parameters are obtained by minimizing the sum of squares of deviations. The least squares optimization equation is expressed as: ; in, It is The deviation of the subdivision points, is the compensation coefficient to be optimized. By solving the optimization equation, the initial compensation parameters of each subdivision point are obtained. These initial compensation parameters provide a preliminary estimate of the compensation for the position deviation. Nonlinear optimization is performed on the initial parameters. Nonlinear optimization methods such as Newton's method or gradient descent method further improve the compensation effect through iterative optimization. The goal of nonlinear optimization is to minimize the sum of squares of the deviations of the subdivision points to obtain a more accurate compensation coefficient. The nonlinear optimization process iteratively adjusts the compensation coefficient until the minimum deviation value is reached. The optimized compensation coefficient This is the final compensation coefficient. According to the optimized compensation coefficient , calculate the compensation position of the subdivision points, and generate a subdivision compensation standard data set containing position compensation values and compensation coefficients. This data set provides compensation parameters based on actual measurements for subsequent motor control, thereby improving the accuracy and stability of motor operation. The compensation position calculation formula is: ; Through the above steps, a complete subdivision compensation method is constructed to ensure that the position accuracy of the stepper motor during operation reaches the expected level, thereby improving the control performance and response speed of the motor system.
[0032] In a specific embodiment, the process of executing step 105 may specifically include the following steps: PID parameter optimization is performed based on the subdivided compensation standard data set, and the parameter search range of the position loop and the speed loop is determined according to the statistical characteristics of the position deviation characteristic data to obtain the initial range of the control parameters; The position loop is parameterized, the proportional coefficient Kp, integral coefficient Ki and differential coefficient Kd of the position loop are calculated, and the position loop control parameters are obtained. The speed loop is parameterized, the proportional coefficient Kv, integral time constant Ti and differential time constant Td of the speed loop are calculated, and the speed loop control parameters are obtained. The controller transfer function is established according to the position loop control parameters and the speed loop control parameters, and the continuous domain transfer function is converted into a Z domain differential equation to obtain a digital PID control equation; The control output of the position loop and the speed loop is limited within the preset range of the motor rated current, and the output of the digital PID control equation is limited to obtain the limiting control parameters; An anti-saturation corrector is constructed based on the limiting control parameters. The controller output is corrected by integral separation and dead zone compensation methods to obtain corrected control parameters. The corrected control parameters are substituted into the digital PID control equation, the real-time control quantities of the position loop and the speed loop are calculated, and the first closed-loop control signal is output.
[0033] Specifically, PID parameter optimization is performed based on the subdivided compensation standard data set. The parameter search range of the position loop and the speed loop is determined according to the statistical characteristics of the position deviation characteristic data, and the initial parameter interval of the controller is constructed. The statistical characteristics of the position deviation are analyzed, especially the distribution and change trend of the deviation. By calculating the statistical indicators such as the variance, mean and maximum value of the deviation sequence, effective guidance is provided for the parameter optimization of the PID controller. Assume that the position deviation characteristic data set is , then the mean of the position deviations and standard deviation Calculated by the following formula: ; ; in, is the number of deviation data points, It is Position deviation, and are the mean and standard deviation of the position deviation data set, respectively. Based on these statistical characteristics, the initial search range of the control parameters of the position loop and the speed loop is estimated. After the search range is determined, the parameters of the position loop and the speed loop are adjusted. The PID controller parameters of the position loop include the proportional coefficient , integral coefficient and the differential coefficient These parameters control the effect of position error on the response of the motor control system. The PID controller parameters of the speed loop include the proportional coefficient , integration time constant and the differential time constant , which determine the impact of speed error on control output. The PID control equations of position loop and speed loop are expressed as: ; ; in, and They are the control outputs of the position loop and the speed loop, is the position error, is the speed error, are the control parameters of the position loop and the speed loop respectively. By adjusting these control parameters, the motion error of the motor can be effectively controlled, thereby optimizing the operating performance of the stepper motor. In order to optimize the parameters, the transfer functions of the PID controllers of the position loop and the speed loop are converted into digital control equations. The transfer functions of the controllers of the position loop and the speed loop in the continuous domain are respectively expressed as: ; ; in, is a complex frequency variable in the Laplace domain. By performing Z-transform on these transfer functions, they can be converted into digital control equations, which are easy to implement in digital computers. Transformation is a tool to convert the transfer function of a continuous-time system into a discrete-time system. The transformation process is obtained by solving the discretization equation. The form of the digital PID control equation is: ; ; After these control equations are converted into digital control equations, the stepper motor is controlled in real time by a computer. In order to prevent the current from exceeding the rated current range of the motor, the control output is limited. Assume that the rated current range of the motor is , then the formula for limiting the controller output is: ; ; Through limiting processing, it is ensured that the control signal of the motor does not exceed the current range, thereby avoiding motor damage and system instability. In order to deal with the saturation phenomenon of the PID controller during long-term operation, an anti-saturation corrector is introduced to correct the controller output. The anti-saturation corrector eliminates the saturation effect through integral separation and dead zone compensation methods. Integral separation is to adjust the calculation method of the integral term when the control signal is close to saturation, thereby avoiding the integrator from accumulating too much error; and dead zone compensation is to set a dead zone range. When the control signal is less than this range, the controller will not generate output. The corrected control signal is expressed as: ; ; in, and They are the correction values of the position loop and the speed loop respectively. By introducing the anti-saturation corrector, the stability and accuracy of the PID controller can be effectively improved, and the saturation and oscillation of the controller in practical applications can be avoided.
[0034] In a specific embodiment, the process of executing step 106 may specifically include the following steps: According to the first closed-loop control signal, actual position data within N control cycles are collected, and a deviation sequence between the actual position data and a given position instruction is calculated to obtain real-time position deviation data; Perform RMS operation on the real-time position deviation data, calculate the RMS value of the position deviation in each control cycle, construct a data sequence containing N sampling points, and obtain a performance evaluation sequence; An optimization objective function is constructed based on the performance evaluation sequence. The weighted sum of the root mean square value of the position deviation is used as the objective function value. A sensitivity analysis is performed on the control parameters to obtain the parameter optimization direction. A stochastic gradient descent model is established based on the parameter optimization direction. The learning rate and iteration step size are set. The gradient of the control parameters is calculated to obtain the parameter update amount. Substitute the parameter update amount into the dynamic learning rate adjustment function, adaptively adjust the learning rate according to the changing trend of the objective function value, obtain the optimization step size, and perform momentum correction on the optimization step size, introduce historical gradient information to correct the parameter update direction, and obtain the target control parameter; The target control parameters are input into the dual-loop PID controller, the control parameters of the position loop and the speed loop are updated, a closed-loop control operation is performed, the controller output signal is obtained, and PWM modulation and current feedback compensation are performed on the controller output signal to output a second closed-loop control signal.
[0035] Specifically, by collecting the actual position data in N control cycles, the deviation between the actual position and the given position command is analyzed. Assume that in each control cycle, the actual position data of the stepper motor is , and the given position instruction is , then the deviation of each control cycle is calculated by the following formula: ; By calculating the deviation of each cycle, we can get the real-time position deviation data set In order to evaluate the performance of the system, the real-time position deviation data is subjected to RMS calculation. The RMS value of the position deviation is an important indicator for measuring the control accuracy of the system. The calculation formula is as follows: ; in, is the number of sampling points, It is Through this process, the RMSE value of each control cycle is obtained, and a performance evaluation sequence containing N sampling points is constructed. RMSE The RMSE value reflects the accuracy and stability of position control. The optimization objective function is constructed based on the performance evaluation sequence. Assuming that the goal is to minimize the weighted sum of the root mean square value of the position deviation, the objective function is expressed as: ; in, is the weight coefficient of each RMSE value. The objective function of the weighted sum is to balance the impact of position deviation in different cycles on the performance of the control system. By minimizing the objective function , optimize the control parameters and improve the motion accuracy of the stepper motor. In the optimization process, sensitivity analysis is used to analyze the influence of control parameters on the objective function. By calculating the gradient of the objective function to each control parameter, the direction of parameter optimization is obtained. If the control parameter vector is assumed to be ,in is the proportionality factor of the position loop, is the integration coefficient, is the differential coefficient, is the proportional coefficient of the speed loop, and is the integral time constant and differential time constant of the speed loop, then the gradient is expressed as: ; These gradient values describe the sensitivity of the objective function to each control parameter. Through gradient calculation, we can determine which parameters have the greatest impact on system performance, and thus decide which parameters need to be optimized. After obtaining the gradient, we use the stochastic gradient descent algorithm to optimize and adjust the control parameters through iteration. The formula is as follows: ; in, It is The control parameter vector at the iteration, is the learning rate, is the gradient of the current control parameter, indicating the direction and step size of the control parameter update. During the optimization process, the learning rate It plays a key role and determines the step size of each update. If the learning rate is too large, the optimization process will be unstable; if the learning rate is too small, the convergence speed will be too slow. In order to improve the optimization effect, a dynamic learning rate adjustment function is used to adaptively adjust the learning rate based on the changing trend of the objective function value. The dynamic learning rate adjustment function is: ; This function dynamically adjusts the learning rate according to the ratio of the previous objective function value to the current objective function value to ensure that the optimization process is stable and efficient. In practical applications, the optimization process may encounter problems with gradient oscillation or local minima. To solve these problems, Momentum correction is used. The Momentum method introduces historical gradient information to correct the current gradient update direction, thereby smoothing the gradient update process. The Momentum correction formula is as follows: ; ; in, It is The historical weighted average of the gradients of iterations, is the Momentum factor, which is usually close to 1. Momentum correction is used to accelerate convergence and reduce oscillation during the optimization process. After several iterations, the optimized control parameters are obtained. . Input the target control parameters into the dual-loop PID controller, update the control parameters of the position loop and speed loop, and perform closed-loop control operations. The updated PID controller adjusts the control output signals of the position loop and speed loop in real-time operation, thereby accurately controlling the position and speed of the stepper motor. In order to ultimately achieve high-precision control, the controller output signal undergoes PWM modulation and current feedback compensation. PWM modulation is used to control the output signal of the motor drive to ensure that the motor runs within a reasonable current range, while current feedback compensation adjusts the output of the motor driver to compensate for current fluctuations caused by load changes or other factors, and finally outputs a second closed-loop control signal.
[0036] The above describes the stepper motor subdivision compensation method based on vector feedback in the embodiment of the present invention. The following describes the stepper motor subdivision compensation device based on vector feedback in the embodiment of the present invention. Figure 2 In one embodiment of the present invention, a stepping motor subdivision compensation device based on vector feedback includes: Establishing module 201, for collecting stator winding current signal and rotor position pulse signal of stepper motor, and establishing vector feedback network mathematical model; The preprocessing module 202 is used to collect the original operating parameter set of the stepper motor under rated working conditions and perform preprocessing to obtain standardized processing data; The analysis module 203 is used to calculate the theoretical position value according to the standardized processing data and the vector feedback network mathematical model, and to perform deviation analysis between the measured position value and the theoretical position value to obtain position deviation characteristic data; The division module 204 is used to divide the position deviation feature data into two subdivision cycles. M Divide into equal parts to obtain multiple subdivision points, and calculate the subdivision compensation standard data set; The calculation module 205 is used to input the subdivision compensation standard data set into the dual-loop PID controller, calculate the initial control parameters of the position loop and the speed loop according to the position deviation characteristic data, and output a first closed-loop control signal; The output module 206 is used to calculate the RMS value of the position deviation based on the first closed-loop control signal, obtain the target control parameter by calculating the RMS value of the position deviation in N consecutive control cycles, and update it to the dual-loop PID controller to output the second closed-loop control signal.
[0037] Through the cooperation of the above components and the establishment of a vector feedback network mathematical model, a unified description of the electrical and mechanical characteristics of the stepper motor is achieved, which improves the accuracy and reliability of the model; a multi-level signal processing method, including wavelet noise reduction, digital low-pass filtering and normalization processing, is adopted to effectively reduce the impact of signal noise on system performance; a compensation mechanism based on subdivision points is introduced, through 2 M Equal division and nonlinear optimization algorithm realize high-precision position compensation; a dual-loop PID control structure is designed, combined with an adaptive parameter adjustment strategy to enhance the system's dynamic response capability and anti-interference performance; a gradient descent-based optimization algorithm and a dynamic learning rate adjustment mechanism are adopted to ensure real-time optimization of control parameters and stable operation of the system; through the combination of vector feedback and closed-loop control, real-time detection and compensation of position deviation are realized, effectively avoiding the motor out-of-step phenomenon; multi-level data processing and parameter optimization strategies are adopted to improve the system's adaptability and control accuracy under complex working conditions.
[0038] above Figure 2 The stepper motor subdivision compensation device based on vector feedback in the embodiment of the present invention is described in detail from the perspective of modular functional entity. The stepper motor subdivision compensation device based on vector feedback in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0039] Figure 33 is a schematic diagram of the structure of a stepper motor subdivision compensation device based on vector feedback provided by an embodiment of the present invention. The stepper motor subdivision compensation device 300 based on vector feedback may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 310 (for example, one or more processors) and a memory 320, and one or more storage media 330 (for example, one or more mass storage device terminals) storing application programs 333 or data 332. Among them, the memory 320 and the storage medium 330 can be short-term storage or permanent storage. The program stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the stepper motor subdivision compensation device 300 based on vector feedback. Furthermore, the processor 310 may be configured to communicate with the storage medium 330, and execute a series of instruction operations in the storage medium 330 on the stepper motor subdivision compensation device 300 based on vector feedback to implement the steps of the above-mentioned stepper motor subdivision compensation method based on vector feedback.
[0040] The stepper motor subdivision compensation device 300 based on vector feedback may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input and output interfaces 360, and / or one or more operating systems 331, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that Figure 3 The structure of the stepper motor subdivision compensation device based on vector feedback shown does not constitute a limitation of the stepper motor subdivision compensation device based on vector feedback provided by the present invention, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0041] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the stepper motor subdivision compensation method based on vector feedback.
[0042] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0043] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0044] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A stepper motor subdivision compensation method based on vector feedback, characterized in that: The method comprises: Collect the stator winding current signal and rotor position pulse signal of the stepper motor, and establish a vector feedback network mathematical model; Collecting the original operating parameter set of the stepper motor under rated working conditions, and performing preprocessing to obtain standardized processing data; Calculating a theoretical position value according to the standardized processing data and the vector feedback network mathematical model, and performing a deviation analysis between the measured position value and the theoretical position value to obtain position deviation characteristic data; The position deviation characteristic data is 2 M Divide into equal parts to obtain multiple subdivision points, and calculate the subdivision compensation standard data set; Inputting the subdivision compensation standard data set into the dual-loop PID controller, calculating the initial control parameters of the position loop and the speed loop according to the position deviation characteristic data, and outputting a first closed-loop control signal; The position deviation root mean square value is calculated based on the first closed-loop control signal, the target control parameter is calculated by the position deviation root mean square value in N consecutive control cycles, and is updated to the dual-loop PID controller to output a second closed-loop control signal.
2. The stepper motor subdivision compensation method based on vector feedback according to claim 1 is characterized in that: The stepping motor stator winding current signal and rotor position pulse signal are collected, and a vector feedback network mathematical model is established, including: The A-phase and B-phase current signals of the stator winding in the stepper motor are synchronously sampled, and the A-phase and B-phase current signals are digitized through a 16-bit AD converter to obtain the stator winding current signal; An encoder is installed on the rotor shaft of the stepper motor, and an output signal of the encoder is subjected to quadruple frequency processing by an orthogonal decoding circuit to obtain a rotor position pulse signal; Performing Clark transformation on the stator winding current signal, converting the A-phase and B-phase current signals into current components in the α-β coordinate system, obtaining the α-β axis current vector, and collecting the rising edge and falling edge of the rotor position pulse signal, calculating the time interval between two adjacent pulse edges, and obtaining the rotor angle increment data; Substituting the rotor angle increment data into an inverse tangent function for calculation to obtain a rotor electrical angle value, and performing Park transformation on the α-β axis current vector and the rotor electrical angle value to obtain a dq axis current vector; A stator voltage equation is established according to the electromagnetic characteristics of the stepper motor, the dq axis current vector and the motor parameters are substituted into the stator voltage equation to obtain an electromagnetic mathematical model, and a mechanical rotation equation is added to the electromagnetic mathematical model, and the rotor moment of inertia, friction coefficient and load torque parameters are input into the mechanical rotation equation to obtain an electromechanical coupling model; The electromechanical coupling model is associated and mapped with the dq axis current vector and the rotor position pulse signal to construct a vector feedback network mathematical model.
3. The stepper motor subdivision compensation method based on vector feedback according to claim 2 is characterized in that: The collecting of the original operating parameter set of the stepper motor under rated working conditions and preprocessing to obtain standardized processing data includes: Performing a standard load test on the stepper motor, collecting phase current, phase voltage, speed and position signals of the stepper motor at rated speed through sensors, and obtaining an original operating parameter set; Performing wavelet decomposition on the original operating parameter set to obtain wavelet coefficients of different frequency bands, and performing soft threshold processing on the wavelet coefficients based on a threshold function to obtain denoised wavelet coefficients; Performing wavelet reconstruction operation on the denoised wavelet coefficients to obtain a preliminary denoised signal, and inputting the preliminary denoised signal into a Chebyshev II digital low-pass filter, setting the cutoff frequency to 1 / 10 of the sampling frequency, to obtain a filtered processed signal; The filtered processed signal is normalized to obtain standardized data, and the signal-to-noise ratio and mean square error are calculated based on the standardized data, and data quality assessment and time series rearrangement are performed to obtain standardized processed data.
4. The stepping motor subdivision compensation method based on vector feedback according to claim 3 is characterized in that: The calculating of the theoretical position value according to the standardized processing data and the vector feedback network mathematical model, and performing deviation analysis between the measured position value and the theoretical position value to obtain position deviation characteristic data, include: The standardized processed data is input into the vector feedback network mathematical model, and numerically solved by Runge-Kutta fourth-order algorithm to obtain a theoretical state quantity, and coordinate transformation is performed on the theoretical state quantity to convert the current and position data in the dq axis coordinate system into a theoretical position value; Constructing a Kalman filter according to the theoretical position value, performing state estimation and noise filtering on the measured position value to obtain a filtered position value, and performing difference calculation between the filtered position value and the theoretical position value to obtain a deviation distribution feature; Performing Fourier transform on the position deviation sequence to obtain frequency domain feature data, and constructing a main feature vector according to the deviation distribution characteristics and the frequency domain feature data; Cluster analysis is performed on the main feature vector to classify the position deviation pattern into multiple categories to obtain a deviation pattern classification result, and the deviation pattern classification result is combined with the main feature vector to construct position deviation feature data.
5. The stepping motor subdivision compensation method based on vector feedback according to claim 4 is characterized in that: The position deviation characteristic data is processed 2 M Divide into equal parts to obtain multiple subdivision points, and calculate the subdivision compensation standard data set, including: Performing period recognition on the position deviation characteristic data, calculating the basic period of the signal based on the autocorrelation function, and using the basic period as the subdivision period to obtain the subdivision reference period; According to the set subdivision level M, the subdivision reference cycle is 2 M Divide equally, generate 2 M A sequence of subdivision sampling points evenly distributed at different angles is obtained to obtain the subdivision point position data; Performing cubic spline interpolation on the subdivision point position data, calculating the actual position curve corresponding to each subdivision point to obtain an actual position interpolation function, and performing difference operation between the actual position interpolation function and the theoretical position curve at each subdivision point position to obtain a subdivision point deviation sequence; A least squares optimization equation is established according to the subdivision point deviation sequence, the compensation weight coefficient of each subdivision point is calculated to obtain an initial compensation parameter, and the initial compensation parameter is nonlinearly optimized to obtain an optimized compensation coefficient; The compensation position of the subdivision points is calculated according to the optimized compensation coefficients to generate a subdivision compensation standard data set including position compensation values and compensation coefficients.
6. The stepping motor subdivision compensation method based on vector feedback according to claim 5 is characterized in that: The step of inputting the subdivision compensation standard data set into a dual-loop PID controller, calculating initial control parameters of the position loop and the speed loop according to the position deviation characteristic data, and outputting a first closed-loop control signal comprises: PID parameter optimization is performed based on the subdivided compensation standard data set, and the parameter search range of the position loop and the speed loop is determined according to the statistical characteristics of the position deviation characteristic data to obtain the initial range of the control parameters; The position loop is parameterized, the proportional coefficient Kp, integral coefficient Ki and differential coefficient Kd of the position loop are calculated, and the position loop control parameters are obtained; and the speed loop is parameterized, the proportional coefficient Kv, integral time constant Ti and differential time constant Td of the speed loop are calculated, and the speed loop control parameters are obtained; Establishing a controller transfer function according to the position loop control parameters and the speed loop control parameters, converting the continuous domain transfer function into a Z domain differential equation, and obtaining a digital PID control equation; The control outputs of the position loop and the speed loop are limited within a preset range of the motor rated current, and the output of the digital PID control equation is limited to obtain a limiting control parameter; An anti-saturation corrector is constructed based on the limiting control parameter, and the controller output is corrected by integral separation and dead zone compensation method to obtain a corrected control parameter, and the corrected control parameter is substituted into the digital PID control equation to calculate the real-time control quantity of the position loop and the speed loop, and output a first closed-loop control signal.
7. The stepping motor subdivision compensation method based on vector feedback according to claim 6 is characterized in that: The calculating of the position deviation root mean square value based on the first closed-loop control signal, obtaining the target control parameter by calculating the position deviation root mean square value in N consecutive control cycles, and updating the target control parameter to the dual-loop PID controller, and outputting the second closed-loop control signal, comprises: Collect actual position data within N control cycles according to the first closed-loop control signal, calculate the deviation sequence between the actual position data and the given position instruction, and obtain real-time position deviation data; Performing a root mean square operation on the real-time position deviation data, calculating the root mean square value of the position deviation of each control cycle, constructing a data sequence including N sampling points, and obtaining a performance evaluation sequence; An optimization objective function is constructed based on the performance evaluation sequence, a weighted sum of the root mean square values of the position deviations is used as the objective function value, a sensitivity analysis is performed on the control parameters to obtain the parameter optimization direction, and a stochastic gradient descent model is established according to the parameter optimization direction, a learning rate and an iteration step are set, and a gradient calculation is performed on the control parameters to obtain the parameter update amount; Substituting the parameter update amount into the dynamic learning rate adjustment function, adaptively adjusting the learning rate according to the change trend of the objective function value, obtaining the optimization step length, and performing Momentum correction on the optimization step length, introducing historical gradient information to correct the parameter update direction, and obtaining the target control parameter; The target control parameter is input into the dual-loop PID controller, the control parameters of the position loop and the speed loop are updated, a closed-loop control operation is performed, a controller output signal is obtained, PWM modulation and current feedback compensation are performed on the controller output signal, and a second closed-loop control signal is output.
8. A stepper motor subdivision compensation device based on vector feedback, characterized in that: The device is used to execute the stepper motor subdivision compensation method based on vector feedback according to any one of claims 1 to 7, the device comprising: Establish a module for collecting the stator winding current signal and rotor position pulse signal of the stepper motor, and establish a vector feedback network mathematical model; A preprocessing module, used for collecting the original operating parameter set of the stepper motor under rated working conditions, and performing preprocessing to obtain standardized processing data; An analysis module, used for calculating a theoretical position value according to the standardized processing data and the vector feedback network mathematical model, and performing a deviation analysis between the measured position value and the theoretical position value to obtain position deviation characteristic data; A division module is used to divide the position deviation characteristic data into two parts within a subdivision period. M Divide into equal parts to obtain multiple subdivision points, and calculate the subdivision compensation standard data set; A calculation module, used for inputting the subdivision compensation standard data set into a dual-loop PID controller, calculating initial control parameters of a position loop and a speed loop according to the position deviation characteristic data, and outputting a first closed-loop control signal; An output module is used to calculate the RMS value of the position deviation based on the first closed-loop control signal, obtain the target control parameter by calculating the RMS value of the position deviation within N consecutive control cycles, and update it to the dual-loop PID controller to output a second closed-loop control signal.
9. A stepper motor subdivision compensation device based on vector feedback, characterized in that: The stepper motor subdivision compensation device based on vector feedback comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the vector feedback-based stepper motor subdivision compensation device to perform the vector feedback-based stepper motor subdivision compensation method as described in any one of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the stepper motor subdivision compensation method based on vector feedback as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Electric actuator control method and system, electronic equipment and storage medium
CN120185474A
A method and system for planning motion trajectory of CNC machine tools
CN122569176A