Motor control method and device based on encoder, medium and program product
By combining the encoder signal and motor vibration noise characteristics, a motor operation state model is constructed, which solves the problem of insufficient positioning accuracy in robot joint motor control, and achieves more accurate motion control and stability.
Patent Information
- Application Number
- CN202510581348.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-29
AI Technical Summary
In the existing robot joint motor control system, due to factors such as mechanical clearance and transmission error, the position information collected by the encoder is deviated from the actual position of the robot joint, which affects the positioning accuracy, and the feedback from a single encoder leads to insufficient control accuracy.
By receiving the position signal and speed signal output from the encoder, filtering is performed, combining mechanical vibration and electromagnetic noise during motor operation, time frequency domain transformation and filtering and noise reduction are performed, frequency characteristic parameters are extracted, operating status model is constructed, and deviation values are calculated compared with standard motion trajectories, and compensation control is performed in real time.
It improves the accuracy of motor control and system response speed, reduces positioning deviations, enhances resistance to external interference, and achieves more comprehensive status monitoring and more accurate motion control.
Smart Images

Figure CN120566967A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motor control, and in particular to an encoder-based motor control method, device, medium, and program product. Background Art
[0002] With the rapid development of robotics, industrial and service robots are increasingly being used in various fields. The accuracy of a robot's motion control directly impacts its performance. This is especially true in high-precision applications like precision assembly and medical surgery, which place higher demands on the control accuracy of the robot's joint motors. Accurate motion control not only impacts a robot's operating efficiency but also serves as a crucial foundation for ensuring its reliability and safety.
[0003] In related technologies, the control of robot joint motors primarily relies on encoder systems to achieve closed-loop control. These systems utilize high-precision encoders installed on the joint motors to collect information about the motor rotor's position and speed. The controller then makes real-time adjustments based on the encoder feedback. Some robots are also equipped with auxiliary devices such as torque sensors and acceleration sensors to obtain state parameters such as force and acceleration during robot motion, thereby enhancing the robustness of the control system.
[0004] However, during the actual operation of the robot, due to factors such as mechanical clearance and transmission error, there may be a deviation between the position information collected by the encoder and the actual position of the robot joint. This deviation will affect the positioning accuracy of the robot. Summary of the Invention
[0005] The present application provides an encoder-based motor control method, device, medium, and program product for improving the control accuracy of the motor during actual operation.
[0006] In the first aspect, the present application provides an encoder-based motor control method, which is applied to a motor control device, and the method includes: receiving a position signal and a speed signal output by the encoder, filtering the position signal and the speed signal to obtain operating state parameters that characterize the current operating state of the motor; collecting the mechanical vibration and electromagnetic noise generated during the operation of the motor to obtain the motor acoustic parameters; performing time-frequency domain transformation and filtering noise reduction on the motor acoustic parameters to extract frequency characteristic parameters that characterize the motor speed and motion characteristics; fusing the operating state parameters and the frequency characteristic parameters according to preset weights to generate an operating state model that includes the motor position, speed and characteristics; comparing the operating state model with the standard motion trajectory to calculate the position deviation value and speed deviation value of the actual motion trajectory of the motor; calculating the compensation control amount based on the position deviation value and the speed deviation value, converting the compensation control amount into a drive signal and outputting it to the motor driver to drive the motor for operation adjustment.
[0007] In the above embodiment, the motor control device constructs an operating state model by fusing encoder signals and acoustic parameters, which not only obtains the position and speed information of the motor, but also combines the mechanical vibration and electromagnetic noise characteristics to form a more comprehensive state description. By comparing the deviation value with the standard trajectory and performing compensation control in real time, the control system can more accurately reflect the actual operating state of the motor, improve the control accuracy and system response speed, and effectively reduce the positioning deviation caused by mechanical clearance and transmission error.
[0008] In combination with some embodiments of the first aspect, in some embodiments, after comparing the operating state model with the standard motion trajectory and calculating the position deviation value and speed deviation value of the actual motion trajectory of the motor, the method also includes: obtaining the motor speed fluctuation and torque fluctuation in the operating state model; when the speed fluctuation exceeds the preset speed fluctuation threshold and the torque fluctuation exceeds the preset torque fluctuation threshold, adjusting the preset weight of data fusion to the actual weight; performing data fusion of the operating state parameters and frequency characteristic parameters based on the actual weight to obtain an updated operating state model, and updating the position deviation value and speed deviation value.
[0009] In the above embodiment, the motor control device monitors the fluctuations of the motor speed and torque, and the system can dynamically adjust the weight distribution of data fusion, and timely update the operating status model when the operating status changes significantly, thereby improving the adaptability to changes in operating conditions, making the control more stable and reliable, and effectively avoiding the control errors that may be caused by a single data source.
[0010] In combination with some embodiments of the first aspect, in some embodiments, the step of receiving the position signal and speed signal output by the encoder, filtering the position signal and speed signal, and obtaining the operating state parameters characterizing the current operating state of the motor specifically includes: receiving the position signal and speed signal output by the encoder; collecting multiple adjacent sampling period data of the position signal, calculating the position jump variable between adjacent sampling points, and when the position jump variable exceeds the preset displacement range, supplementing the abnormal sampling point data based on data interpolation to obtain a corrected position signal; performing wavelet decomposition on the corrected position signal to obtain a low-frequency fundamental frequency component and a high-frequency distortion component, and compensating and reconstructing the low-frequency fundamental frequency component and the high-frequency distortion component to obtain a filtered position signal; segmenting the speed signal according to the speed level, and extracting the mean and standard deviation of the speed signal in each speed interval, removing the abnormal speed value, and obtaining a corrected speed signal; performing spectral analysis on the corrected speed signal to obtain the fundamental component and the harmonic component, and filtering them separately and then superimposing and reconstructing them to obtain a filtered speed signal; determining the operating state parameters based on the filtered position signal and the filtered speed signal.
[0011] In the above embodiment, the motor control device can effectively remove noise and distortion in the signal and improve the accuracy of the state parameters by performing multi-level filtering processing on the position signal and the speed signal, including data interpolation and completion, wavelet decomposition and reconstruction, and spectrum analysis.
[0012] In combination with some embodiments of the first aspect, in some embodiments, before the step of collecting the mechanical vibration and electromagnetic noise generated during the operation of the motor to obtain the acoustic parameters of the motor, the method also includes: obtaining the resonant frequency data of each speed range of the motor, determining the frequency sampling window corresponding to each speed range based on user settings, and obtaining the frequency sampling parameters; calculating the vibration attenuation ratio according to the vibration data collected by the acoustic sensor to obtain the sensor weight factor; collecting the ambient noise when the motor is in a stopped state to obtain the noise baseline data; recording the vibration signal amplitude during the no-load startup of the motor, and extracting the vibration characteristics at different speeds to obtain a vibration feature template; writing the frequency sampling parameters, sensor weight factor, noise baseline data and vibration feature template into the acoustic acquisition module to perform noise reduction processing on the acoustic parameters of the motor.
[0013] In the above embodiment, the motor control device establishes a complete acoustic parameter collection and processing mechanism by pre-collecting and analyzing the acoustic characteristics of the motor under different working conditions, which can more accurately extract and utilize vibration noise information and improve the system's perception of the actual operating status of the motor.
[0014] In combination with some embodiments of the first aspect, in some embodiments, after the steps of calculating the compensation control amount based on the position deviation value and the speed deviation value, converting the compensation control amount into a drive signal and outputting it to the motor driver to drive the motor to perform operation adjustment, the method also includes: collecting the current acceleration and deceleration time, torque fluctuation amplitude and speed fluctuation amplitude of the motor to generate a response curve; calculating the acceleration change rate and the torque change rate according to the response curve to obtain a response compensation value; when the response compensation value exceeds a preset compensation threshold, performing interpolation correction based on the acceleration change rate and the torque change rate to generate a transition control amount; determining the optimized control amount based on the transition control amount and the compensation control amount; and generating an optimized drive signal based on the optimized control amount.
[0015] In the above embodiment, the motor control device analyzes the motor response curve and performs compensation correction, so that the system optimizes the control amount, improves the system's adaptability to changes in the motor's dynamic characteristics, and makes the control more stable and accurate.
[0016] In combination with some embodiments of the first aspect, in some embodiments, the step of generating an optimized drive signal based on the optimized control quantity specifically includes: obtaining the current temperature value and load value of the motor, determining the drive current limit value according to the temperature value, and determining the drive voltage limit value according to the load value; limiting the optimized control quantity within the range of the drive current limit value and the drive voltage limit value to obtain the limit control quantity; generating a correction coefficient based on the temperature change rate and the load change rate, and determining the corrected control quantity based on the correction coefficient and the limit control quantity; performing sliding averaging on the corrected control quantity to obtain a smoothed control quantity; converting the smoothed control quantity into a pulse signal to generate an optimized drive signal.
[0017] In the above embodiment, the motor control device limits and smoothes the control quantity by considering actual operating conditions such as temperature and load, thereby achieving safer and more reliable drive control, preventing over-control and sudden changes, and improving the stability and safety of system operation.
[0018] In combination with some embodiments of the first aspect, in some embodiments, after the steps of calculating the compensation control amount based on the position deviation value and the speed deviation value, converting the compensation control amount into a drive signal and outputting it to the motor driver to drive the motor to perform operation adjustment, the method also includes: constructing a motor state prediction model based on historical operation data; collecting motor operating environment parameters, and inputting the motor operating environment parameters into the motor state prediction model to obtain the operating state prediction value of the motor in the next control cycle; and pre-adjusting the control parameters of the next control cycle according to the operating state prediction value.
[0019] In the above embodiment, the motor control device achieves early optimization of the next control cycle by establishing a motor state prediction model and pre-adjusting it in combination with environmental parameters, thereby improving the system's foresight and control continuity and reducing the impact of control lag.
[0020] In second aspect, an embodiment of the present application provides a motor control device, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the motor control device to execute the method described in the first aspect and any possible implementation method of the first aspect.
[0021] In a third aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when the computer program product is run on a motor control device, enables the motor control device to execute the method described in the first aspect and any possible implementation of the first aspect.
[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium comprising instructions, which, when executed on a motor control device, causes the motor control device to execute the method described in the first aspect and any possible implementation of the first aspect.
[0023] It is understood that the motor control device provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the methods provided in the embodiments of the present application. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods and will not be repeated here.
[0024] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. By adopting a control method that combines encoder signals with acoustic parameters, the precise position and speed information of the motor and the vibration and noise characteristics during operation can be obtained simultaneously. This effectively solves the problem of insufficient control accuracy caused by relying solely on single encoder feedback in existing technologies, thereby achieving more comprehensive and accurate motor status monitoring and more precise motion control. It not only improves the accuracy of status perception, but also enhances the system's resistance to external interference, achieving the goal of improving control accuracy and operational stability.
[0025] 2. Due to the adoption of an adaptive weight adjustment mechanism based on speed and torque fluctuations, the data fusion strategy can be dynamically adjusted according to the actual operating status of the motor, effectively solving the problem that the fixed weight fusion method in the existing technology is difficult to adapt to changes in operating conditions, thereby realizing real-time optimization and adaptive adjustment of control parameters; the control model can be updated in time according to changes in operating conditions, improving the control system's ability to adapt to changes in operating conditions, and ensuring that high control accuracy can be maintained under different operating conditions.
[0026] 3. Due to the adoption of a control optimization method based on response curve analysis, the optimal control strategy can be dynamically generated according to the actual operating characteristics of the motor, effectively solving the problem of insufficient dynamic response caused by fixed control parameters in the existing technology, thereby achieving smoother and more precise motion control; improving the system's adaptability to changes in motor characteristics, and achieving a smooth transition of the control process, thereby achieving the purpose of improving motion control quality and system stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a flow chart of a motor control method based on an encoder in an embodiment of the present application; Figure 2 is another flow chart of the motor control method based on the encoder in an embodiment of the present application; Figure 3It is a schematic diagram of the physical device structure of the motor control device in the embodiment of the present application. DETAILED DESCRIPTION
[0028] The terms used in the following examples of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of the present application, the singular expressions "a", "an", "above", "the", and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations of one or more of the listed items.
[0029] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
[0030] In related technologies, encoder-based PID feedback control methods can be used to achieve closed-loop control of motor position and speed. Specifically, a high-precision encoder is used to collect motor rotor position information, and a digital PID algorithm is used to calculate the control variable, driving the motor to move along a set trajectory. Some systems are also equipped with auxiliary devices such as torque sensors and acceleration sensors to enhance the robustness of the control system. The following describes scenarios in which encoder-based motor control methods from related technologies are used.
[0031] Traditional robot joint motor control systems primarily utilize encoder-based PID closed-loop control. For example, an assembly robot on an automated production line uses a high-resolution 23-bit encoder to acquire motor position information, combined with a PID algorithm to implement dual closed-loop position and velocity control. Torque sensors and accelerometers are also used to obtain force and acceleration information on the robot arm. However, the encoder only measures the angular position of the motor shaft and cannot directly reflect the actual position of the end of the mechanical transmission chain. Due to the nonlinear characteristics of the mechanical system and environmental interference, a single PID control algorithm is difficult to adapt to complex operating conditions. Furthermore, the multi-sensor information is not effectively integrated, and each sensor operates independently, resulting in limited control accuracy.
[0032] The encoder-based motor control method in the embodiment of the present application is used to simultaneously obtain encoder position feedback and vibration noise characteristics during motor operation, thereby achieving a comprehensive perception of the actual motion state of the motor. This not only improves the accuracy of state detection, but also enhances the system's resistance to external interference. This method uses an adaptive weighted data fusion mechanism that can dynamically adjust the control strategy according to operating conditions, effectively solving the accuracy and stability problems of traditional methods. The following describes scenarios in which the encoder-based motor control method in this application is used.
[0033] After adopting the motor control method of this application, the robot production line of a precision instrument manufacturing company has achieved significant improvements. This method constructs a complete operating state model by simultaneously collecting encoder signals and motor acoustic characteristics. In the optical lens polishing process, the control system can monitor the vibration characteristics and motion parameters of the motor in real time, and immediately make compensation adjustments when abnormal vibration or position deviation is detected. For example, when the polishing pressure suddenly changes, the system quickly identifies the load change by analyzing the acoustic parameters, and realizes trajectory accuracy control in combination with position feedback. This solution not only solves the accuracy limitation problem in traditional methods, but also improves the system's resistance to external interference.
[0034] It can be seen that the encoder-based motor control method in the embodiment of the present application can not only achieve high-precision position control, but also effectively solve the impact of mechanical transmission errors and external interference, thereby achieving precise control of motor movement and comprehensive improvement of system performance.
[0035] For ease of understanding, the following describes the process of the method provided by this implementation in combination with the above scenario. Figure 1 , which is a flow chart of the encoder-based motor control method in an embodiment of the present application.
[0036] S101 , receiving a position signal and a speed signal output by an encoder, filtering the position signal and the speed signal, and obtaining an operating state parameter representing a current operating state of the motor.
[0037] Among them, the position signal represents the mechanical angular position of the motor rotor, usually in degrees or radians; the speed signal represents the angular velocity or speed of the motor rotor, usually in rad / s or rpm; filtering processing refers to the use of digital filtering algorithms to suppress noise and interference in the signal; the operating state parameters are used to represent the current motion state of the motor, including dynamic characteristic parameters such as actual position, actual speed, and acceleration.
[0038] The motor control device performs this step at the beginning of each control cycle to obtain information about the motor's current motion state. Specifically, the motor control device first reads sampled values of the position and velocity signals from the encoder via a communication interface. It then digitally filters these raw signals to remove sampling noise and electrical interference. Finally, based on the filtered signals, it calculates a set of parameters that characterize the motor's actual motion state for subsequent control calculations.
[0039] In some embodiments, an adaptive Kalman filter can be used to process position and velocity signals: first, a state-space model of the motor motion is established, with position and velocity as state variables; then, the system noise covariance matrix and the measurement noise covariance matrix are adaptively adjusted based on the statistical characteristics of the signal; finally, the optimal state value is recursively estimated through two steps of prediction and update. Optionally, a wavelet transform method can also be used: first, the signal is subjected to wavelet decomposition to obtain coefficients of different scales; then, the high-frequency coefficients are thresholded to remove noise; and finally, the filtered signal is obtained through wavelet reconstruction. It is understandable that other digital filtering methods can also be used to achieve signal noise reduction.
[0040] In some embodiments, the position and velocity signals are filtered using a wavelet decomposition and reconstruction method. For the position signal, a three-layer db4 wavelet decomposition is first used to obtain a low-frequency approximate coefficient sequence and three high-frequency detail coefficient sequences. The detail coefficients are processed using a soft thresholding method: d'=sign(d)(|d|-λ)+, where d is the detail coefficient and λ is the threshold, which is adaptively determined based on the signal-to-noise ratio. The processed coefficients are reconstructed using wavelet transforms to obtain a filtered position signal. The velocity signal is first segmented according to the rotational speed. Within each segment, a median filter is used to remove the mutation points. An FFT analysis is then performed to obtain the spectrum. The spectrum is weighted using a Hanning window to extract the fundamental component and the first five harmonic components. The remaining frequency components are set to zero. Finally, an IFFT reconstruction is performed to obtain the filtered velocity signal. For example, in a certain servo system, this method can effectively remove high-frequency noise and quantization error from the encoder signal, reducing the noise amplitude of the position signal to within ±0.1 degrees.
[0041] Furthermore, in practical applications, the raw encoder output signal may contain quantization errors, sampling delays, and other issues. The motor control device sets the appropriate sampling frequency based on the encoder's resolution, introduces delay compensation in signal processing, and uses interpolation algorithms to increase signal resolution, effectively improving the accuracy of position and velocity signals.
[0042] S102: Collect mechanical vibration and electromagnetic noise generated during the operation of the motor to obtain motor acoustic parameters.
[0043] Among them, mechanical vibration refers to the vibration of mechanical components generated when the motor is running, including rotor imbalance vibration, bearing vibration, etc.; electromagnetic noise refers to the noise generated by electromagnetic force when the motor is running; acoustic parameters are used to represent the characteristics of vibration and noise, including amplitude, frequency, phase, etc.
[0044] The motor control device uses vibration and acoustic sensors installed on the motor to collect vibration and noise signals in real time. Specifically, the vibration sensor collects acceleration signals from key parts of the motor, such as the bearing seat and casing, while the acoustic sensor collects sound pressure signals around the motor. These signals are amplified and filtered by the conditioning circuit and then fed into the data acquisition system, ultimately generating acoustic parameters that characterize the motor's dynamic characteristics.
[0045] In some embodiments, multi-sensor data fusion can be used to improve acquisition accuracy: first, the signals from each sensor are time-synchronized; then, signal compensation is performed based on the sensor's position and sensitivity characteristics; and finally, the data from multiple sensors is fused using algorithms such as weighted averaging. Alternatively, adaptive sampling can be used: automatically adjusting the sampling frequency based on motor speed; increasing the sampling rate at critical moments; and compressing and storing the data.
[0046] The collected signals may be distorted due to factors such as ambient noise and sensor installation location. The motor control unit measures and compensates for ambient noise, optimizes sensor installation location and mounting method, and uses adaptive filtering algorithms to suppress interference signals to improve the reliability of acoustic parameters.
[0047] S103 , performing time-frequency domain transformation and filtering noise reduction on the motor acoustic parameters to extract frequency characteristic parameters representing the motor speed and motion characteristics.
[0048] Among them, time-frequency domain transformation refers to the mathematical transformation method of converting time domain signals to the time-frequency plane, which is used to analyze the frequency characteristics of the signal at different times; filtering noise reduction means removing the noise components in the signal through digital filtering algorithms; frequency characteristic parameters are used to represent the characteristic frequency components in motor vibration and noise signals, including fundamental frequency, harmonic frequency, modulation frequency, etc.; motion characteristics refer to the motion state characteristics of the motor rotor, including dynamic characteristics such as speed fluctuations and load changes.
[0049] The motor control device immediately executes this step after acquiring the acoustic parameters, processing and analyzing the collected vibration and noise signals. Specifically, the motor control device first converts the time-domain signal to the time-frequency domain using a short-time Fourier transform to obtain a time-varying spectrum. It then applies adaptive threshold filtering to the spectrum to remove background noise and interference components. It then extracts characteristic frequencies and their amplitudes related to the motor speed, including rotor frequency, stator frequency, and bearing characteristic frequencies. Finally, through a combined analysis of the frequency components, it obtains a set of frequency characteristic parameters that characterize the motor's motion characteristics.
[0050] In some embodiments, time-frequency analysis and feature extraction can be achieved in a variety of ways: First, perform multi-resolution analysis of the signal through wavelet packet transform, first decompose the signal into sub-signals of different frequency bands, then calculate the energy distribution of each frequency band, then extract the frequency band with concentrated energy as the characteristic frequency band, and finally determine the motion state of the motor based on the time-varying characteristics of the frequency band energy. Another method is to use empirical mode decomposition method, first decompose the signal into several intrinsic mode functions, then perform Hilbert transform on each mode function to obtain the instantaneous frequency, then identify the characteristic frequency components through cluster analysis of the instantaneous frequency, and finally determine the operating state of the motor based on the variation pattern of the characteristic frequency.
[0051] In some embodiments, time-frequency analysis of acoustic parameters utilizes a short-time Fourier transform (STFT) combined with adaptive threshold processing. The acoustic signal is first divided into frames, with the frame length determined by the lowest analysis frequency and a 50% overlap between adjacent frames. Each frame is then Hanning-windowed and subjected to an FFT to obtain the time-varying spectrum S(t, f). The feature extraction process is as follows: First, the spectrum energy E(t, f) = |S(t, f)|² is calculated. At each time point t, the energy peak is found within a preset frequency range, and the corresponding frequency fp(t) and amplitude Ap(t) are recorded. The continuity index C(t) of the frequency trajectory is then calculated as |fp(t) - fp(t-1)| / fp(t). When C(t) is less than a threshold, it is considered a valid feature, and the frequency and amplitude at that moment are added to the feature sequence. Finally, a smooth frequency characteristic curve is obtained through polynomial fitting. For example, in a motor fault diagnosis system, this method can accurately extract characteristic frequency changes caused by rotor eccentricity with a sensitivity of 0.1 Hz.
[0052] Furthermore, in practical applications, motor acoustic signals often exhibit non-stationary characteristics, making it difficult to accurately extract features using traditional Fourier analysis methods. The motor control device adaptively adjusts the analysis window length based on the motor's operating speed range; employs variational mode decomposition to process non-stationary signals; and incorporates a time-varying feature tracking algorithm to update feature parameters in real time, improving the accuracy and real-time performance of feature extraction.
[0053] S104 , fusing the operating state parameters and the frequency characteristic parameters according to preset weights to generate an operating state model including the motor position, speed, and characteristics.
[0054] Among them, the preset weights represent the importance of different parameters in data fusion and are used to balance the reliability of various types of information; data fusion refers to the process of comprehensive processing of multi-source information; the operating state model is used to represent the current complete operating state of the motor, including mechanical motion state and dynamic characteristics; motor characteristics refer to various indicators reflecting motor performance, such as torque fluctuation, vibration intensity, etc.
[0055] The motor control device performs this step after obtaining the operating state parameters and frequency characteristic parameters. Specifically, the motor control device first normalizes the two parameters to make them dimensionally consistent. Then, based on pre-set weight coefficients, it constructs a multi-layer state observation equation. A sequential Kalman filter algorithm is then used to fuse and estimate the observed data to obtain the optimal state estimate. Finally, based on the state estimate, an operating state model is established that includes position, speed, and characteristic parameters.
[0056] It should be noted that the operating state model is a data model that describes the actual motion state of the motor and is used to characterize the complete operating state of the motor at a specific moment. This model includes three key state parameters: kinematic parameters (position, velocity, acceleration), dynamic parameters (torque, torque ripple), and vibration characteristic parameters (frequency and amplitude). The model construction process involves data fusion: First, wavelet filtering is performed on the position and velocity signals output by the encoder to extract the low-frequency fundamental component as the basic motion parameters. Simultaneously, time-frequency analysis is performed on the vibration signal collected by the acoustic sensor to extract the characteristic frequencies and corresponding amplitudes. These parameters are then integrated into a unified state space using an adaptive weight fusion algorithm. The weight coefficients are dynamically adjusted based on the signal-to-noise ratio and reliability of the signal. For example, when severe vibration is detected, the weight of the acoustic parameters is increased accordingly. The resulting operating state model is a multidimensional state vector that comprehensively reflects the actual operating state of the motor. In practical applications, such as precision positioning systems, this model can provide more accurate position information than encoder feedback alone. By comparing it with a standard motion trajectory, the actual position and velocity deviations are calculated, providing a basis for subsequent compensation control. For example, when a small gap appears in the mechanical system, the actual position deviation may not be detected by the encoder alone. However, by analyzing the changes in vibration characteristics, the model can promptly reflect this state deviation, enabling the control system to make appropriate compensation adjustments.
[0057] Furthermore, the data fusion process for operating state parameters and frequency characteristic parameters utilizes a multi-source information fusion method based on Kalman filtering. First, a state vector containing position, velocity, and vibration characteristics is established. The state transition matrix is constructed based on the motor kinematic model, and the observation matrix contains the mapping between encoder signals and acoustic features. The system noise covariance matrix is determined based on the encoder resolution and sampling error, while the observation noise covariance matrix is obtained by estimating the signal-to-noise ratio of the acoustic signal. The fusion process consists of two phases: prediction and update. The prediction phase uses the state transition equation to predict the next state, while the update phase uses the observed data to correct the state estimate. Preset weights are determined through eigenvalue analysis of the covariance matrix and reflect the reliability of different information sources. For example, in a certain servo motor application, when the speed is below 3000 rpm, the encoder signal weight is 0.7, and the acoustic feature weight is 0.3. When the speed exceeds 3000 rpm, due to increased mechanical vibration, the acoustic feature weight increases to 0.5 to balance the contributions of the two information sources.
[0058] In some embodiments, data fusion can be achieved through various approaches: Using a fuzzy neural network approach, a fuzzy rule base is first established to describe the relationship between parameters, followed by adaptive learning of optimal weights through the neural network, followed by fusion of state information from different sources, and finally obtaining an optimized state estimate. Another implementation approach is to employ a Bayesian estimation framework, first establishing a state transition probability model, then updating the posterior probability distribution based on the observed data, and then obtaining the fusion result through maximum a posteriori probability estimation.
[0059] Furthermore, in practical applications, the reliability of different parameters can change with operating conditions. The motor control device establishes parameter reliability evaluation metrics, including signal-to-noise ratio and consistency, calculates the reliability score of each parameter in real time, and dynamically adjusts the fusion weights based on the reliability scores to improve the robustness of state estimation.
[0060] S105 , comparing the operating state model with the standard motion trajectory, and calculating the position deviation value and speed deviation value of the actual motion trajectory of the motor.
[0061] Among them, the standard motion trajectory represents the ideal motion state expected by the motor, including a preset position and speed sequence; the actual motion trajectory refers to the current actual motion state of the motor; the position deviation value is used to represent the difference between the actual position and the expected position; the speed deviation value represents the difference between the actual speed and the expected speed; the comparison process refers to the deviation between the actual trajectory and the standard trajectory obtained through mathematical calculation.
[0062] The motor control device immediately executes this step after obtaining the operating state model. Specifically, it first reads the standard trajectory points corresponding to the current moment, including the expected position and expected velocity, from a pre-stored trajectory database. It then spatially and temporally aligns the actual position and velocity in the operating state model with the standard trajectory points. It then calculates the deviations in position and velocity in each dimension. It then performs a coordinate transformation on these deviations, converting them to the motor control coordinate system. Finally, based on the direction and magnitude of the deviations, it determines the motion component that requires compensation.
[0063] In some embodiments, trajectory comparison and deviation calculation can be achieved through various methods: Using a dynamic time warping algorithm, the time correspondence between the actual trajectory and the standard trajectory is first established, followed by calculating the Euclidean distance of each corresponding point. Next, the optimal matching sequence is obtained through minimum path optimization, and finally, the position and velocity deviations are calculated based on the matching sequence. Another method is to use a state observer method, which first constructs a state vector containing position and velocity, then establishes a reference model based on the standard trajectory, then estimates the state deviation in real time, and finally corrects the motor motion state through feedback.
[0064] Furthermore, in practical applications, trajectory tracking may experience lag or overshoot due to motor load variations and external disturbances. Motor control devices incorporate feedforward compensation mechanisms to predict motion trajectories based on load characteristics; establish disturbance observers to estimate and compensate for external disturbances in real time; and employ adaptive control strategies to dynamically adjust control parameters to improve trajectory tracking accuracy.
[0065] S106 , calculating a compensation control amount according to the position deviation value and the speed deviation value, converting the compensation control amount into a drive signal and outputting it to the motor driver to drive the motor to perform operation adjustment.
[0066] Among them, the compensation control quantity represents the control variable used to eliminate the deviation, including torque command, current command, etc.; the drive signal refers to the actual control command sent to the motor driver, usually a PWM signal or an analog signal; the motor driver is used to execute the control command and drive the motor to operate; the operation adjustment represents the real-time correction process of the motor's motion state.
[0067] The motor control device immediately executes this step after calculating the deviation value. Specifically, the motor control device first constructs an error vector based on the position deviation and speed deviation. Then, it calculates the output of each control link using the PID control algorithm. The control variable is then limited and dead-band compensated. The compensated control variable is then converted into a corresponding drive signal format based on the motor characteristics. Finally, the drive signal is sent to the motor driver via a communication interface, achieving precise control of the motor's motion.
[0068] In some embodiments, the calculation and conversion of control variables can be achieved through various approaches: Model predictive control methods are used, first establishing a dynamic model of the motor, then optimizing the control sequence within the prediction time domain, solving the constrained optimization problem to obtain the optimal control variable, and finally generating the drive signal through PWM modulation. Another approach is to use adaptive fuzzy control, first constructing a fuzzy rule base to describe the control strategy, then adaptively adjusting the control parameters based on the system response, then calculating the fuzzy inference results, and finally converting them into specific control instructions.
[0069] Furthermore, in practical applications, the nonlinear characteristics of motor drivers can lead to unsatisfactory control. The motor control device models the driver's input and output characteristics, performs reverse compensation to eliminate nonlinear effects, and finally introduces dead-time compensation and current lead control. This multi-step coordination improves control accuracy, ensuring that the compensation control variable is accurately converted into the desired motor motion.
[0070] The following is a more detailed description of the process of the method provided by this implementation. Figure 2 , is another flow chart of the encoder-based motor control method in an embodiment of the present application.
[0071] S201 , receiving a position signal and a speed signal output by an encoder, filtering the position signal and the speed signal, and obtaining an operating state parameter representing a current operating state of the motor.
[0072] Referring to step S101 , the motor control device determines operating state parameters.
[0073] In some embodiments, the motor control device obtains accurate operating state parameters through multi-step processing, that is, the motor control device receives the position signal and speed signal output by the encoder; collects multiple adjacent sampling period data of the position signal, calculates the position jump variable between adjacent sampling points, and when the position jump variable exceeds the preset displacement range, supplements the abnormal sampling point data based on data interpolation to obtain a corrected position signal; performs wavelet decomposition on the corrected position signal to obtain a low-frequency fundamental frequency component and a high-frequency distortion component, and compensates and reconstructs the low-frequency fundamental frequency component and the high-frequency distortion component to obtain a filtered position signal; segments the speed signal according to the speed level, and extracts the mean and standard deviation of the speed signal in each speed range, removes abnormal speed values, and obtains a corrected speed signal; performs spectral analysis on the corrected speed signal to obtain the fundamental component and the harmonic component, and filters them separately and then superimposes and reconstructs them to obtain a filtered speed signal; determines the operating state parameters based on the filtered position signal and the filtered speed signal.
[0074] Among them, the encoder refers to a sensing device used to detect the position and speed of the motor rotor; the position signal refers to a pulse sequence that reflects the angle of the motor rotor; the speed signal is an analog or digital signal used to represent the motor speed; the position jump variable represents the position difference between adjacent sampling points; the preset displacement range refers to the maximum allowable position change; data interpolation refers to the reconstruction of missing or abnormal data through mathematical methods; wavelet decomposition is used to decompose the signal into different frequency components; the fundamental frequency component refers to the basic frequency component of the signal; the distortion component represents the distorted part of the signal; the speed level represents the segmented interval of the motor's operating speed; the mean and standard deviation are used to represent the statistical characteristics of the data; the fundamental component refers to the main frequency component of the signal; the harmonic component represents the higher-order harmonic component of the signal; the operating state parameters are used to describe various indicators of the current operating state of the motor.
[0075] Specifically, the motor control device first obtains the original position and speed signals output by the encoder; then performs sampling point detection on the position signal and calculates the position difference between adjacent points. When the difference exceeds the preset range, the cubic spline interpolation method is used to repair the abnormal point; then the corrected position signal is decomposed into three layers of db4 wavelet to separate the low-frequency motion component and the high-frequency noise component, and the coefficients of each layer are processed by the threshold method and reconstructed to obtain the filtered position signal; at the same time, the speed signal is segmented according to the preset speed range, and the speed mean and 3σ range are calculated in each range to eliminate abnormal values beyond the range; then the corrected speed signal is subjected to FFT analysis to extract the fundamental wave and the first five harmonic components, which are processed separately by bandpass filters and then superimposed and reconstructed; finally, based on the processed position and speed signals, combined with the preset state judgment rules, the operating state parameter set including position, speed, acceleration and other parameters is calculated.
[0076] In some embodiments, signal processing and state parameter extraction can be achieved through various approaches: Adaptive filtering methods are employed, first constructing a Kalman filter to preprocess the position and velocity signals, then dynamically adjusting the filter parameters based on the signal variation characteristics, followed by outlier detection and correction, and finally obtaining reliable operating parameters through state fusion. Another approach is to use a neural network approach, first establishing a multilayer perceptron network model, then training the network using historical data, then inputting real-time signals into the network for processing, and finally outputting estimated state parameters.
[0077] In practical applications of signal processing and state parameter extraction, problems such as sampled data asynchrony, signal mutations, and sensor failures can arise. To address these challenges, a multi-sensor data fusion framework can be constructed. This framework first establishes an extended Kalman filter model, which includes position, velocity, and acceleration state variables. The state equation accounts for sensor delays and sampling period variations. An anomaly detection mechanism based on the Mahalanobis distance is then designed. This mechanism determines data reliability by calculating the weighted distance between observed and predicted data. An adaptive weighting method is then applied to detected anomalies, with the weight coefficients determined by the eigenvalues of the covariance matrix. For example, if a sensor's data mutation occurs, its weight is automatically reduced, while the weight contributions of other sensors are increased. Furthermore, during signal reconstruction, wavelet packet decomposition can be used to improve frequency resolution. The energy entropy criterion is used to select the optimal decomposition scale, enabling precise separation of transient and steady-state components in the signal.
[0078] S202: Collect mechanical vibration and electromagnetic noise generated during the operation of the motor to obtain motor acoustic parameters.
[0079] Referring to step S102 , the motor control device determines the motor acoustic parameters.
[0080] In some embodiments, the motor control device will perform preprocessing and noise reduction optimization of acoustic parameters, that is, the motor control device will obtain the resonant frequency data of each speed range of the motor, determine the frequency sampling window corresponding to each speed range based on user settings, and obtain frequency sampling parameters; calculate the vibration attenuation ratio based on the vibration data collected by the acoustic sensor to obtain the sensor weight factor; collect the ambient noise when the motor is in a stopped state to obtain noise baseline data; record the vibration signal amplitude during the no-load startup process of the motor, and extract the vibration characteristics at different speeds to obtain a vibration feature template; write the frequency sampling parameters, sensor weight factor, noise baseline data and vibration feature template into the acoustic acquisition module to perform noise reduction processing on the motor acoustic parameters.
[0081] Among them, the resonant frequency data represents the natural vibration frequency of the motor at different speeds; the frequency sampling window refers to the frequency analysis range set for different speed ranges; the vibration attenuation ratio is used to represent the energy attenuation characteristics of the vibration signal; the sensor weight factor represents the credibility coefficient of different sensors; the environmental noise refers to the interference signal in the environmental background; the noise baseline data is used to represent the baseline value of the background noise; the vibration signal amplitude represents the quantitative value of the vibration intensity; the vibration feature template is used to describe the standard vibration characteristics under different working conditions; the acoustic parameter refers to the acoustic feature quantity that characterizes the operating state of the motor.
[0082] Specifically, the motor control device first obtains the resonant frequency characteristics of the motor in each speed range through a frequency sweep experiment, and determines the frequency analysis range and sampling parameters of each speed range according to the sampling requirements set by the user; then, the vibration data collected by each acoustic sensor is analyzed in the time domain, and the attenuation time constant and attenuation ratio of the signal are calculated, and the weight coefficient of the sensor is set accordingly; then, when the motor is completely stopped, the environmental noise data is collected for a sufficiently long time, and the noise baseline of each frequency band is obtained through statistical analysis; then, the motor is controlled to perform a no-load start test, the vibration signal during the entire startup process is recorded, and the vibration feature vector containing amplitude, frequency, phase and other characteristics is extracted at different speed points; finally, these parameters and feature data are configured in the acoustic acquisition module for signal noise reduction and feature extraction during real-time operation.
[0083] In some embodiments, acoustic parameter preprocessing and configuration can be achieved through various approaches: Adaptive feature extraction methods can be used to first establish a multidimensional feature space to describe the vibration signal characteristics, then reduce the feature dimensionality through principal component analysis, and then use clustering algorithms to identify characteristic patterns for different operating conditions, ultimately generating adaptive feature templates. Another approach involves using deep learning methods, first constructing a convolutional neural network model, then training the network with a large amount of labeled data, and then optimizing the network parameters to obtain the optimal noise reduction model.
[0084] It should be noted that the vibration feature template can be constructed based on an acoustic feature template model, which is used to establish a standard feature library for the normal operation of the motor. Model training is based on acoustic data collected under a large amount of standard operating conditions. First, the original vibration signal is decomposed using wavelet packets to obtain energy distribution characteristics in different frequency bands. Principal component analysis is then used to reduce the feature dimensionality, retaining the most discriminative feature combinations. Adaptive clustering is performed on the reduced feature space to obtain standard feature clusters under different speed and load conditions. Each feature cluster contains a mean vector and covariance matrix, describing the normal vibration feature distribution under that operating condition. During operation, the system calculates the feature vector of the current vibration signal in real time, performs Mahalanobis distance matching with the standard features in the template library, and outputs the identification result of the most similar operating condition and an abnormality assessment. For example, in experiments with a certain servo motor model, the model was able to detect minor bearing wear anomalies by analyzing the degree of deviation in the vibration characteristics, allowing for early adjustment of the control strategy to avoid accuracy degradation.
[0085] During the acoustic parameter processing and configuration process, the non-stationarity of ambient noise and the complexity of the vibration propagation path can affect the accuracy of feature extraction. To improve system robustness, an adaptive noise suppression mechanism can be constructed. This mechanism first uses the empirical mode decomposition method to decompose the vibration signal into multiple intrinsic mode functions, each of which reflects the inherent oscillation characteristics of the signal. The instantaneous frequency and amplitude of each mode are then calculated through the Hilbert transform to construct a time-frequency distribution matrix. The independent component analysis method is then used to separate the noise and the effective signal, and the separation effect is evaluated using the mutual information criterion. In the frequency feature extraction process, considering the nonlinear characteristics of mechanical resonance, the bispectral analysis method can be used to identify the frequency coupling relationship, and the bispectral slicing technique can be used to extract high-order statistical features.
[0086] S203 , performing time-frequency domain transformation and filtering noise reduction on the motor acoustic parameters to extract frequency characteristic parameters representing the motor speed and motion characteristics.
[0087] Referring to step S103 , the motor control device extracts frequency characteristic parameters.
[0088] S204 , fusing the operating state parameters and the frequency characteristic parameters according to preset weights to generate an operating state model including the motor position, speed, and characteristics.
[0089] Referring to step S104 , the motor control device performs data fusion.
[0090] S205 , comparing the operating state model with the standard motion trajectory, and calculating the position deviation value and speed deviation value of the actual motion trajectory of the motor.
[0091] Referring to step S105 , the motor control device calculates the deviation value.
[0092] S206: Obtain the motor speed fluctuation and torque fluctuation in the operating state model.
[0093] Among them, the speed fluctuation indicates the degree of deviation of the actual motor speed from the average speed; the torque fluctuation refers to the fluctuation amplitude of the motor output torque relative to the rated torque; the operating state model is a mathematical model that contains the complete operating state information of the motor; the calculation of the fluctuation is based on the variance or standard deviation of the corresponding physical quantity.
[0094] The motor control device performs this step after generating an operating state model. Specifically, it first extracts the speed and torque data series for the most recent N sampling periods from the operating state model. It then calculates the mean and standard deviation of the speed series to obtain the speed fluctuation. It then calculates the mean and standard deviation of the torque series to obtain the torque fluctuation. Finally, it normalizes the fluctuation to facilitate comparison with a preset threshold.
[0095] In some embodiments, the calculation of fluctuation can be achieved through various methods: Using a sliding variance analysis method, the size of the sliding window is first set, the mean and variance of the data within the window are calculated, the window position is updated, and the calculation is repeated to obtain the time-varying fluctuation characteristics. Another method is to use a wavelet decomposition method, which first decomposes the signal into multiple scales, then calculates the energy fluctuation at each scale, and then integrates the fluctuation characteristics of each scale.
[0096] Furthermore, in practical applications, signals may contain sudden fluctuations or outliers. The motor control device preprocesses the raw data to remove outliers, uses robust statistical methods to calculate the fluctuations, and finally introduces exponential smoothing filtering to suppress sudden disturbances and improve the reliability of the fluctuation calculation.
[0097] S207 : When the speed fluctuation exceeds a preset speed fluctuation threshold and the torque fluctuation exceeds a preset torque fluctuation threshold, adjust the preset weight of data fusion to an actual weight.
[0098] Among them, the preset speed fluctuation threshold represents the maximum acceptable speed fluctuation range; the preset torque fluctuation threshold refers to the maximum allowable torque fluctuation range; the preset weight refers to the initially set data fusion weight coefficient; the actual weight represents the weight coefficient dynamically adjusted according to the operating status.
[0099] The motor control device immediately executes this step after obtaining the fluctuation amount. Specifically, the motor control device first compares the speed fluctuation amount with a preset speed fluctuation threshold; then determines whether the torque fluctuation amount exceeds the preset torque fluctuation threshold; then calculates a weight adjustment coefficient based on the degree of fluctuation exceeding the threshold; then, based on the adjustment coefficient, modifies the preset weight; and finally, obtains the actual weight appropriate for the current operating state.
[0100] In some embodiments, weight adjustment can be achieved through a variety of methods: Fuzzy reasoning methods are used to first establish fuzzy rules for fluctuation and weight adjustment, then calculate the adjustment amount based on the membership of the fluctuation, and then defuzzify to obtain the specific adjustment coefficient. Another method is to use an adaptive learning algorithm to first establish performance evaluation indicators and then dynamically optimize weight parameters based on system response.
[0101] In some embodiments, weight adjustment utilizes an adaptive mechanism based on fluctuations. First, the speed fluctuation ΔV and torque fluctuation ΔT are calculated, each characterized by its standard deviation. The fluctuations are then compared with preset thresholds (αV, αT). Weight adjustment is triggered when ΔV > αV and ΔT > αT. The adjustment coefficient k is calculated using a sigmoid function: k = 1 / (1 + exp(-β(max(ΔV / αV, ΔT / αT) - 1))), where β is the adjustment coefficient. The actual weight wreal is determined by the preset weight w0 and the adjustment coefficient: wreal = w0(1 ± γk), where γ is the weight change rate limiter, and the ± sign is selected based on the nature of the fluctuations. For example, during rapid positioning of a precision robot joint motor, if speed fluctuations exceeding 15% of the rated value and torque fluctuations exceeding 20% are detected, the system reduces the encoder signal weight from 0.7 to 0.5 while simultaneously increasing the acoustic feature weight, allowing control to rely more on vibration feature information for compensation.
[0102] Furthermore, in practical applications, frequent weight adjustments can lead to system instability. The motor control device sets dead zones and hysteresis characteristics for weight adjustments, introduces a smooth transition mechanism, and finally adds a weight change rate limit to avoid drastic fluctuations in weight.
[0103] S208 : Perform data fusion of the operating state parameters and the frequency characteristic parameters based on the actual weights to obtain an updated operating state model, and update the position deviation value and the speed deviation value.
[0104] Among them, data fusion refers to the process of comprehensive processing of multi-source information; operating state parameters refer to state quantities directly measured by the encoder; frequency characteristic parameters refer to characteristic quantities obtained through acoustic analysis; and the updated operating state model refers to the re-integrated state model after weight adjustment.
[0105] The motor control device immediately executes this step after obtaining the actual weights. Specifically, the motor control device first performs a weighted combination of the operating state parameters and frequency characteristic parameters according to the actual weights; then, based on the combined results, a new state observation equation is constructed; then, a Kalman filter algorithm is used for state estimation; then, the operating state model is updated based on the estimation results; and finally, the position deviation and velocity deviation values are recalculated based on the updated model.
[0106] In some embodiments, data fusion updates can be implemented in a variety of ways: Using a particle filter approach, an importance sampling function is first constructed based on weights, a Monte Carlo simulation is then used to generate a particle ensemble, particle weights are then updated based on the observed data, and finally a weighted average is used to obtain a state estimate. Another approach is to use a recursive least squares algorithm, which first constructs a weighted error function and then updates the state estimate through iterative optimization.
[0107] For example, in some embodiments, the state model is updated using recursive least squares combined with a Kalman filter. The state vector x contains the position θ, velocity ω, and the vibration eigenvector v. The observation equation is z = Hx + w, where H is the observation matrix and w is the observation noise. The prediction equation is x(k+1) = Ax(k) + Bu(k) + v, where A is the state transition matrix, B is the control matrix, u is the control input, and v is the system noise. Weight updates are achieved by modifying the observation noise covariance matrix R: R = diag(1 / w1, 1 / w2, ..., 1 / wn), where wi is the actual weight of the corresponding observation. State estimation is obtained by minimizing the weighted error function J = (z - Hx)TR-1(z - Hx). For example, in a high-precision positioning system, when the system detects abnormal mechanical vibration, the model will reduce the weight of the encoder position feedback and increase the weight of the vibration characteristics, making the state estimation more dependent on acoustic information, thereby improving position control accuracy under vibration disturbances.
[0108] Furthermore, in practical applications, state estimation may diverge. Therefore, the motor control device introduces a fault detection mechanism to monitor estimation errors, sets a covariance matrix reset condition, and finally uses a constrained state estimation algorithm to ensure convergence.
[0109] S209 , calculating a compensation control amount according to the position deviation value and the speed deviation value, converting the compensation control amount into a drive signal and outputting it to the motor driver to drive the motor to perform operation adjustment.
[0110] Referring to step S106 , the motor control device calculates the compensation amount.
[0111] In some embodiments, the motor control device will build a prediction model based on historical data and pre-adjust the next control cycle, that is, the motor control device will build a motor state prediction model based on historical operating data; collect motor operating environment parameters, and input the motor operating environment parameters into the motor state prediction model to obtain the motor operating state prediction value of the next control cycle; pre-adjust the control parameters of the next control cycle according to the operating state prediction value.
[0112] Among them, the state prediction model refers to the mathematical model used to predict the future state of the motor; the operating environment parameters refer to the environmental factors that affect the operation of the motor; the operating state prediction value is used to represent the predicted operating state of the next cycle; the control parameters refer to the various parameters used for motor control; and the control period refers to the sampling and control time interval of the controller.
[0113] Specifically, the motor control device first uses a machine learning method to build a motor state prediction model based on the state sequence and control sequence stored in the historical operation database; then it collects operating environment parameters including ambient temperature, humidity, vibration, etc. through various sensors; then it inputs the environmental parameters and the current state into the prediction model to calculate the expected operating state of the next control cycle; finally, based on the deviation between the predicted state and the expected state, the control parameters of the next cycle are optimized and adjusted in advance to achieve predictive control.
[0114] In some embodiments, state prediction and parameter pre-adjustment can be achieved through a variety of approaches: Using a recursive neural network approach, first constructing a long short-term memory network model, then training the network using time series data, then performing a sequence forecast of future states, and finally optimizing the control strategy based on the forecast results. Another approach is to use a gray forecasting method, first accumulating historical data, then building a gray differential equation model, and then solving it to obtain the forecast sequence.
[0115] It should be noted that the motor state prediction model focuses on predicting future states and employs a deep network architecture based on sequence learning. The model's training data comes from a historical operation database, containing complete state sequences and corresponding control instruction sequences. The training process first organizes data from multiple consecutive control cycles into sequence pairs. The input sequence consists of the historical state and control variables, and the output sequence is the subsequent state value. The network employs a multi-layer LSTM architecture, using a gating mechanism to handle long-term dependencies. The training objective is to minimize the weighted mean squared error between the predicted and actual states, with the weight coefficients dynamically adjusted based on the importance of different state variables. During operation, the model receives complete state information (including position, velocity, vibration characteristics) and environmental parameters (such as temperature and load) at the current moment, and predicts and outputs state evolution trends for multiple future control cycles. These predictions are used to proactively optimize control parameters. In practical applications, such as in the feed system of a high-speed cutting machine tool, this model can predict position deviations caused by varying cutting forces and proactively adjust control parameters to keep tracking errors within ±2 mm.
[0116] During state prediction and parameter pre-tuning, the model's generalization and prediction accuracy are affected by changes in the operating environment. To improve prediction accuracy, a dynamic model update mechanism can be constructed. This mechanism first uses deep learning methods to construct a hierarchical prediction model, consisting of a feature extraction layer, a time series processing layer, and a state prediction layer. New training samples are then continuously collected using a sliding time window method, and model parameters are updated using an online learning algorithm. A model evaluation mechanism based on prediction error is then designed to trigger model retraining when prediction performance degrades. During parameter pre-tuning, considering the multi-objective optimization problem, a Pareto optimization approach can be employed to balance control accuracy and energy efficiency.
[0117] S210 , collecting the current acceleration and deceleration time, torque fluctuation amplitude, and speed fluctuation amplitude of the motor, and generating a response curve.
[0118] Among them, the acceleration and deceleration time refers to the time required for the motor to switch from one speed state to another; the torque fluctuation amplitude refers to the peak-to-peak value variation range of the torque; the speed fluctuation amplitude refers to the maximum deviation range of the speed; and the response curve is used to represent the dynamic response characteristics of the motor to the control command.
[0119] The motor control device performs this step immediately after executing control adjustments. Specifically, it first records the time intervals between motor acceleration and deceleration; then collects the maximum and minimum values of the torque signal and calculates the fluctuation amplitude; then measures the fluctuation range of the speed signal; then time-aligns and normalizes the collected data; and finally generates a response curve that characterizes the motor's dynamic characteristics.
[0120] In some embodiments, response characteristics can be obtained through various methods: First, a parameter identification method is used to design an excitation signal sequence, then record system input and output data, then use the least squares method to fit system parameters, and finally establish a dynamic response model. Another method is to use a time-domain analysis method to first extract characteristic parameters such as response rise time and overshoot, and then construct a time-domain response function.
[0121] Furthermore, in practical applications, load variations can affect the accuracy of response characteristic measurements. The motor control device performs load compensation, employs an adaptive sampling strategy, and finally introduces a data smoothing mechanism to obtain a more accurate response characteristic curve.
[0122] S211. Calculate the acceleration change rate and the torque change rate according to the response curve to obtain a response compensation value.
[0123] The acceleration change rate indicates how quickly acceleration changes over time; the torque change rate indicates how quickly torque changes over time; the response compensation value indicates the amount of dynamic characteristic deviation that needs to be compensated; and the rate of change calculation is based on the derivative of the response curve.
[0124] The motor control device executes this step after obtaining the response curve. Specifically, it first numerically differentiates the response curve to obtain the acceleration and torque rate of change curves; then calculates the mean and standard deviation of the rate of change; then, based on the preset dynamic characteristics requirements, determines the deviation to be compensated; and finally, normalizes the compensation amount.
[0125] In some embodiments, the rate of change calculation can be implemented in a variety of ways: using a wavelet differential algorithm, first performing a wavelet transform on the signal, then calculating the derivative in the transform domain, and then performing an inverse transform to obtain the time-domain rate of change. Another approach is to use an adaptive filtering method, first constructing a state-space model, and then estimating the derivative value using a Kalman filter.
[0126] In addition, in practical applications, numerical differentiation may amplify high-frequency noise. To address this problem, we can first pre-filter the signal, use a robust differentiation algorithm, and finally introduce rate-of-change clipping to obtain a smooth rate-of-change estimate.
[0127] S212: When the response compensation value exceeds the preset compensation threshold, interpolation correction is performed based on the acceleration change rate and the torque change rate to generate a transition control amount.
[0128] Among them, the response compensation value indicates the size of the control quantity that needs to be dynamically compensated; the preset compensation threshold refers to the maximum allowable compensation range; the acceleration change rate is used to indicate the instantaneous change speed of acceleration; the torque change rate indicates the instantaneous change speed of torque; and the transition control quantity represents the control instruction after smoothing.
[0129] The motor control device executes this step after obtaining the response compensation value. Specifically, the motor control device first compares the response compensation value with a preset compensation threshold; then calculates the current rate of change of acceleration and torque; then designs the shape parameters and time constant of the interpolation function based on the rate of change; then uses the cubic spline interpolation method to generate a smooth transition trajectory; and finally, samples the transition trajectory to obtain a discrete sequence of transition control variables.
[0130] In some embodiments, interpolation correction can be achieved through various methods: Adaptive spline interpolation methods are employed, first determining control nodes based on the system's dynamic characteristics, then constructing a piecewise polynomial interpolation function, then determining interpolation coefficients through least-squares optimization, and finally generating a transition curve that satisfies continuity constraints. Another approach is to use fuzzy interpolation control, constructing fuzzy rules based on the rate of change to dynamically adjust interpolation parameters.
[0131] Furthermore, in practical applications, large changes in the control variable can cause system oscillations. Motor control devices incorporate a rate-of-change limiter, introduce adaptive dead-band compensation, and finally, add anti-oscillation protection mechanisms to ensure a smooth transition of the control variable.
[0132] S213. Determine the optimized control amount according to the transition control amount and the compensation control amount.
[0133] Among them, the transition control quantity represents the smooth control sequence obtained by interpolation correction; the compensation control quantity refers to the compensation quantity originally calculated; the optimization control quantity represents the instruction quantity finally used for control; and the determination process includes the coordination and fusion of multiple control quantities.
[0134] The motor control device performs this step after generating the transition control variable. Specifically, the motor control device first evaluates the reliability of the transition control variable and the compensation control variable; then designs dynamic weight coefficients; then performs a weighted fusion of the two control variables; then performs constrained optimization on the fusion result; and finally generates an optimized control variable that meets the control requirements.
[0135] In some embodiments, control optimization can be achieved through a variety of approaches: Model predictive control methods can be used to first establish a system prediction model, then define an objective function that includes control effectiveness and energy consumption, and then solve for the optimal control sequence under the constraints. Another approach is to use an adaptive controller to dynamically adjust control parameters based on system response characteristics.
[0136] In some embodiments, the optimal control quantity is determined using a model predictive control method. First, a prediction model is established: x(k+1)=f(x(k), u(k)), where x is the state vector and u is the control input. The optimization objective function is defined as: J=Σ(||x(k)-xr(k)||Q+||u(k)||R), where xr is the reference trajectory, and Q and R are weight matrices. Constraints include: state constraint |x|≤xmax, control constraint |u|≤umax, and rate of change constraint |Δu|≤dumax. The quadratic programming problem is solved in the rolling time domain: min J st constraint condition, and the optimal control sequence is obtained. The actual control quantity takes the first value of the sequence, and the optimization process is repeated in the next cycle. For example, in a high-precision robot, this method can achieve smooth trajectory tracking while ensuring position accuracy, and the position overshoot is controlled within 1%.
[0137] Furthermore, in practical applications, conflicts may arise between different control variables. Therefore, the motor control device establishes a priority mechanism, implements a hierarchical control strategy, and finally introduces a coordinated control algorithm to ensure the proper integration of the control variables.
[0138] S214: Generate an optimized driving signal based on the optimized control quantity.
[0139] Among them, the optimized control quantity refers to the control instruction that has undergone multiple optimizations; the optimized drive signal refers to the control signal actually output to the motor driver; the drive signal generation process includes steps such as signal modulation and waveform shaping.
[0140] The motor control device executes this step after determining the optimized control variable. Specifically, the motor control device first maps the optimized control variable to the range required by the driver; then performs linear compensation based on the motor characteristics; then converts the compensated signal into a PWM waveform or analog signal; then performs dead-zone compensation and phase correction; and finally outputs a drive signal that meets timing requirements.
[0141] In some embodiments, drive signal generation can be achieved through a variety of methods: First, a high-precision PWM modulation method is used, which first designs a carrier signal, then performs pulse-width modulation, then improves control accuracy through dead-band compensation, and finally implements current closed-loop control. Another method is to use a vector control strategy to achieve precise torque regulation.
[0142] Furthermore, in practical applications, the drive signal may be affected by electrical interference. Therefore, the motor control device undergoes EMC design optimization, implements signal isolation protection, and finally adds anti-interference filtering to improve the quality and reliability of the drive signal.
[0143] In some embodiments, the motor control device will limit and smooth the control quantity based on parameters such as temperature and load to generate a final optimized drive signal, that is, the motor control device will obtain the current temperature value and load value of the motor, determine the drive current limit value according to the temperature value, and determine the drive voltage limit value according to the load value; limit the optimized control quantity within the range of the drive current limit value and the drive voltage limit value to obtain the limited control quantity; generate a correction coefficient based on the temperature change rate and the load change rate, and determine the corrected control quantity based on the correction coefficient and the limiting control quantity; perform sliding averaging on the corrected control quantity to obtain a smoothed control quantity; convert the smoothed control quantity into a pulse signal to generate an optimized drive signal.
[0144] Among them, the temperature value indicates the current operating temperature of the motor; the load value refers to the size of the mechanical load borne by the motor; the drive current limit value is used to indicate the maximum allowable current value; the drive voltage limit value indicates the maximum allowable voltage value; the temperature change rate is used to describe the speed of temperature change; the load change rate refers to the speed of change of the load size; the correction coefficient indicates the compensation factor based on the change of the working conditions; the sliding average is used to smooth the fluctuation of the control quantity; the pulse signal refers to the PWM waveform of the drive motor.
[0145] Specifically, the motor control device first obtains the current temperature value and load value through a temperature sensor and a torque sensor; then determines the safe current limit range according to the temperature characteristic curve of the motor and the required voltage limit range according to the load characteristic curve; then compares the optimized control quantity with the limit value and truncates it to ensure that the control quantity will not cause overcurrent or overvoltage; then calculates the change trends of the temperature and the load, generates a correction coefficient reflecting the change of the working condition, and applies the correction coefficient to the limited control quantity; then performs a sliding average operation of a specified length on the corrected control quantity to eliminate the mutation and jitter of the control quantity; finally, converts the smoothed control quantity into an actual drive signal through PWM modulation. [[ID=]1]
[0146] In some embodiments, the optimization and conversion of the control quantity can be achieved in various ways: adopting the model predictive control method, first establishing a prediction model including the dynamic characteristics of the temperature and the load, then solving the optimal control sequence under the constraint conditions, then dynamically adjusting the control parameters according to the prediction results, and finally generating a control signal that meets multiple constraints. Another way is to use adaptive fuzzy control, first constructing a fuzzy rule base for the temperature and the load, then adaptively adjusting the control rules according to the change of the working condition, and then obtaining the control decision through fuzzy inference.
[0147] In some embodiments, the generation of the drive signal adopts a high-precision PWM control method based on carrier modulation. First, perform linearization compensation according to the motor characteristic curve: u' = k1u + k2u² + k3u³, where u is the original control quantity, and k1, k2, and k3 are compensation coefficients. Then perform dead zone compensation: when |u'| < ud, u'' = sign(u')(|u'| + kd), where ud is the dead zone threshold and kd is the compensation coefficient. The compensated control quantity generates a PWM waveform through triangular carrier modulation, and the carrier frequency is selected according to the motor response characteristic. Finally, perform waveform shaping through an RC filter network to reduce the impact of switching transients on the motor. For example, in a certain precision positioning system, this method can achieve a PWM resolution of 1 ms, effectively suppressing current fluctuations and reducing the torque ripple to less than 0.1% of the rated value.
[0148] During the optimization and conversion of the control quantity, the change of the temperature and the fluctuation of the load will cause the system parameters to be time-varying, affecting the control accuracy. To achieve more precise control, a parameter adaptive estimation mechanism can be constructed. This mechanism first establishes a mathematical model of the motor considering the temperature effect, including the temperature coefficients of the winding resistance and the magnetic flux; then designs a recursive least squares parameter identifier to estimate the model parameters online; then based on the parameter estimation results, adopts a sliding mode variable structure control method to design a robust controller to achieve system stability through an equivalent control term and a switching control term. In the limit control, considering the coupling relationship of multiple constraints, the model predictive control method can be adopted to obtain the optimal control sequence by solving a quadratic programming problem.
[0149] In the embodiments of the present application, due to the use of a multi-source information fusion control method based on encoders and acoustic parameters, and the introduction of an adaptive weight adjustment mechanism and a predictive optimization control strategy, it is possible to fully perceive the actual motion state of the motor and dynamically adjust the control parameters, effectively solving the problems of insufficient precision, poor anti-interference ability, and weak adaptability existing in traditional control methods; by fusing encoder signals and acoustic characteristic parameters, the accuracy of state perception and the anti-interference ability of the system are improved; the use of an adaptive weight data fusion mechanism enhances the system's adaptability to changes in working conditions; and the introduction of predictive optimization and smooth transition control achieves high-precision control of motor motion and stable and reliable operation. This method has important application value in high-precision control fields such as industrial robots and precision machining equipment.
[0150] The motor control device in the embodiment of the present invention is described below from the perspective of hardware processing. Figure 3 , is a schematic diagram of a physical device structure of a motor control device in an embodiment of the present application.
[0151] It should be noted that Figure 3 The structure of the motor control device shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0152] like Figure 3 As shown, the motor control device includes a CPU 301, which can execute various appropriate actions and processes based on programs stored in a ROM 302 or programs loaded from a storage unit 308 into a RAM 303, such as the methods described in the above embodiments. RAM 303 also stores various programs and data required for system operation. CPU 301, ROM 302, and RAM 303 are interconnected via a bus 304. An I / O interface 305 is also connected to bus 304.
[0153] The following components are connected to the I / O interface 305: an input section 306 including an audio input device, push button switches, and the like; an output section 307 including a liquid crystal display (LCD), an audio output device, indicator lights, and the like; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. Removable media 311, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 310 as needed, so that computer programs read from the removable media can be installed in the storage section 308 as needed.
[0154] In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present invention includes a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 309 and / or installed from the removable medium 311. When the computer program is executed by the CPU 301, the various functions defined in the present invention are performed.
[0155] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings.
[0156] Specifically, the motor control device of this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, the encoder-based motor control method provided in the above embodiment is implemented.
[0157] As another aspect, the present invention further provides a computer-readable storage medium, which may be included in the motor control device described in the above embodiments, or may exist independently and not incorporated into the motor control device. The storage medium carries one or more computer programs, which, when executed by a processor of the motor control device, enable the motor control device to implement the encoder-based motor control method provided in the above embodiments.
[0158] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0159] As used in the above embodiments, the term “when” may be interpreted to mean “if” or “after” or “in response to determining that” or “in response to detecting that”, depending on the context. Similarly, the phrases “upon determining that” or “if (stated condition or event) is detected” may be interpreted to mean “if determining that” or “in response to determining that” or “upon detecting (stated condition or event)” or “in response to detecting (stated condition or event)”, depending on the context.
Claims
1. A motor control method based on an encoder, characterized in that: Applied to a motor control device, the method includes: receiving a position signal and a speed signal output by an encoder, filtering the position signal and the speed signal to obtain an operating state parameter representing a current operating state of the motor; Collect the mechanical vibration and electromagnetic noise generated during the operation of the motor to obtain the motor acoustic parameters; Performing time-frequency domain transformation and filtering noise reduction on the motor acoustic parameters to extract frequency characteristic parameters that characterize the motor speed and motion characteristics; Performing data fusion on the operating state parameters and the frequency characteristic parameters according to preset weights to generate an operating state model including the motor position, speed and characteristics; Comparing the operating state model with the standard motion trajectory to calculate the position deviation value and speed deviation value of the actual motion trajectory of the motor; A compensation control amount is calculated according to the position deviation value and the speed deviation value, and the compensation control amount is converted into a driving signal and output to a motor driver to drive the motor to perform operation adjustment.
2. The method according to claim 1, characterized in that After the step of comparing the operating state model with the standard motion trajectory and calculating the position deviation value and the speed deviation value of the actual motion trajectory of the motor, the method further includes: Obtaining motor speed fluctuation and torque fluctuation in the operating state model; When the speed fluctuation amount exceeds a preset speed fluctuation threshold and the torque fluctuation amount exceeds a preset torque fluctuation threshold, adjusting the preset weight of data fusion to an actual weight; Data fusion of the operating state parameter and the frequency characteristic parameter is performed based on the actual weight to obtain an updated operating state model, and the position deviation value and the speed deviation value are updated.
3. The method according to claim 1, characterized in that The step of receiving the position signal and the speed signal output by the encoder, filtering the position signal and the speed signal, and obtaining the operating state parameter representing the current operating state of the motor specifically includes: Receive the position signal and speed signal output by the encoder; Collecting data of a plurality of adjacent sampling periods of the position signal, calculating the position jump variable between adjacent sampling points, and when the position jump variable exceeds a preset displacement range, supplementing the abnormal sampling point data based on data interpolation to obtain a corrected position signal; Performing wavelet decomposition on the corrected position signal to obtain a low-frequency fundamental frequency component and a high-frequency distortion component, and compensating and reconstructing the low-frequency fundamental frequency component and the high-frequency distortion component to obtain a filtered position signal; The speed signal is segmented according to the speed level, and the mean and standard deviation of the speed signal are extracted in each speed interval, and abnormal speed values are removed to obtain a corrected speed signal; Performing spectrum analysis on the modified speed signal to obtain fundamental wave components and harmonic wave components, filtering them respectively and then superimposing and reconstructing them to obtain a filtered speed signal; An operating state parameter is determined based on the filtered position signal and the filtered speed signal.
4. The method according to claim 1, wherein Before the step of collecting the mechanical vibration and electromagnetic noise generated during the operation of the motor to obtain the motor acoustic parameters, the method further includes: Obtain the resonant frequency data of each speed range of the motor, determine the frequency sampling window corresponding to each speed range based on user settings, and obtain the frequency sampling parameters; Calculate the vibration attenuation ratio based on the vibration data collected by the acoustic sensor to obtain the sensor weight factor; Collect the ambient noise when the motor is stopped to obtain the noise baseline data; Record the vibration signal amplitude during the motor's no-load startup process, extract the vibration characteristics at different speeds, and obtain a vibration feature template; The frequency sampling parameter, the sensor weight factor, the noise baseline data and the vibration feature template are written into an acoustic acquisition module to perform noise reduction processing on the motor acoustic parameters.
5. The method according to claim 1, characterized in that After the steps of calculating a compensation control amount according to the position deviation value and the speed deviation value, converting the compensation control amount into a drive signal and outputting the signal to a motor driver to drive the motor to perform operation adjustment, the method further includes: Collect the motor's current acceleration and deceleration time, torque fluctuation amplitude, and speed fluctuation amplitude to generate a response curve; Calculating the acceleration change rate and the torque change rate according to the response curve to obtain a response compensation value; When the response compensation value exceeds a preset compensation threshold, interpolation correction is performed based on the acceleration change rate and the torque change rate to generate a transition control amount; determining an optimized control amount according to the transition control amount and the compensation control amount; Based on the optimized control variable, an optimized driving signal is generated.
6. The method according to claim 5, characterized in that The step of generating an optimized driving signal based on the optimized control amount specifically includes: Acquire the current temperature value and load value of the motor, determine the driving current limit value according to the temperature value, and determine the driving voltage limit value according to the load value; Limiting the optimized control amount within the range of the driving current limit value and the driving voltage limit value to obtain a limit control amount; generating a correction coefficient based on the temperature change rate and the load change rate, and determining a correction control amount according to the correction coefficient and the limit control amount; Performing sliding average on the corrected control amount to obtain a smoothed control amount; The smoothing control amount is converted into a pulse signal to generate an optimized driving signal.
7. The method according to claim 1, characterized in that After the steps of calculating a compensation control amount according to the position deviation value and the speed deviation value, converting the compensation control amount into a drive signal and outputting the signal to a motor driver to drive the motor to perform operation adjustment, the method further includes: Build a motor status prediction model based on historical operation data; Collecting motor operating environment parameters and inputting the motor operating environment parameters into the motor state prediction model to obtain a predicted value of the motor's operating state in the next control cycle; The control parameters of the next control cycle are pre-adjusted according to the operation state prediction value.
8. A motor control device, characterized in that: The motor control device includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the motor control device to execute the method as described in any one of claims 1-7.
9. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on a motor control device, the motor control device is caused to execute the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that When the computer program product is run on a motor control device, the motor control device is caused to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Multi-point calibration method and system for servo motor of photoelectric pod
CN121036627A
A multi-point calibration method and system for servo motors of an electro-optical pod
CN121036627B
Intelligent motor control method and system based on data analysis
CN121077350A
Motor intelligent control method and system based on data analysis
CN121077350B
Full-speed-domain mixed flux linkage observation method and device based on adaptive weight fuzzy switching
CN121585041A