Rotation angle operation prediction method of linear rotation motor

By combining machine learning algorithms with multi-source data fusion technology, an LSTM and adversarial training reinforcement learning model was constructed, which solved the problem of low accuracy in traditional motor prediction methods. This enabled accurate prediction and efficient control of motor rotation angle, improving the stability and efficiency of industrial production.

CN121077337APending Publication Date: 2025-12-05SHENZHEN SCAUTO PRECISION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511361681.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-23
Publication Date
2025-12-05

AI Technical Summary

Technical Problem

Traditional methods for predicting motor operating conditions have low accuracy and poor adaptability, making it difficult to accurately predict faults and performance change trends, thus affecting the stability and efficiency of industrial production.

Method used

By employing machine learning algorithms combined with multi-source data fusion technology, data is collected through magnetic field sensors, tachogenerators, current transformers, voltage transformers, and microphones. LSTM and adversarial training reinforcement learning models are constructed to accurately predict the motor rotation angle. Multilayer perceptrons and support vector regression are used to process complex relationships, achieving efficient control of the motor's operating status.

Benefits of technology

It enables precise prediction and efficient control of motor rotation angle, improves the continuity and efficiency of production process, reduces equipment failure rate and maintenance cost, adapts to complex working conditions, and provides a comprehensive time series dataset and solid data foundation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121077337A_ABST
    Figure CN121077337A_ABST
Patent Text Reader

Abstract

The invention discloses a rotation angle operation prediction method for a linear rotating motor, which selects a machine learning algorithm to predict the rotation angle operation, and is characterized by comprising the following steps of: acquiring and preprocessing data of the linear rotating motor, collecting angle data and parameters of the motor by using a sensor, training a machine learning model, and predicting the rotation angle operation of the linear rotating motor. The collected data are preprocessed, when the motor angle and other parameters are in a linear relation, a linear regression mode is used for the motor angle, and when the motor angle is influenced by the previous angle state and parameter historical values, the motor angle is subjected to the linear regression mode; according to the rotation angle operation prediction method of the linear rotating motor, a prediction model is constructed through a machine learning algorithm, and motor operation state changes are informed in advance. On the basis, the motor control system can accurately adjust the driving signal in advance according to the predicted angle value, it is ensured that the motor stably operates in an ideal state all the time, the control precision of the relation between the angle and parameters of the motor is greatly improved, and the continuity and high efficiency of the production process are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of motor prediction, in particular to a rotation angle operation prediction method of a linear-rotary motor. BACKGROUND

[0002] In the field of industrial automation and intelligent manufacturing, motors are key equipment, and the accurate prediction of their operating state is crucial. Traditional prediction methods often rely on single sensor data or simple empirical models, which have low precision and poor adaptability. With the development of technology, advanced machine learning and deep learning algorithms are now used in combination with multi-source data fusion technology to provide more accurate and reliable predictions for motors. By collecting motor current, voltage, temperature, vibration, and rotational speed, etc. a variety of operating parameters, using big data analysis to mine the complex internal relationships between parameters, and constructing a highly accurate prediction model, the probability and time node of motor failure can be predicted in advance, and the performance trend of the motor can be effectively predicted, providing a strong basis for equipment maintenance and production scheduling, thereby improving the stability, reliability, and operating efficiency of the entire industrial production system, reducing economic losses and production interruption risks caused by motor failure, and promoting the development of industrial production towards intelligent and efficient direction. SUMMARY

[0003] The purpose of the present application is to provide a rotation angle operation prediction method of a linear-rotary motor to solve the problems raised in the background.

[0004] To achieve the above purpose, the present application provides the following technical solution: a rotation angle operation prediction method of a linear-rotary motor, which uses machine learning algorithms for prediction, including the following steps:

[0005] S1: Data collection and preprocessing of the linear-rotary motor, using sensors to collect motor angle data and parameters for machine learning model training, and preprocessing the collected data;

[0006] S2: Selecting a machine learning algorithm, using linear regression mode when the motor angle and other parameters are linearly related, and using LSTM when the motor angle is affected by previous angle state and parameter history value;

[0007] S3: Model training, inputting the preprocessed training data into the selected machine learning model for training, using a combination of adversarial training and reinforcement learning;

[0008] S4: Model application, deploying the model after reinforcement learning to the detection system of the linear-rotary motor, obtaining the motor parameters and inputting them into the model, and feeding back the predicted value of the motor angle.

[0009] Preferably, in the S1 step, the installation of the sensor and the debugging step include:

[0010] S11a: the sensor is a magnetic field sensor and the number is at least two, and the magnetic field sensor is arranged according to the installation state of the motor;

[0011] S11b: the signal output ends of all the magnetic field sensors are connected to a signal conditioning circuit for amplifying electrical signals, filtering and converting, so as to accurately collect data by a data acquisition card, and transmit the data to an embedded data processing platform;

[0012] S11c: in the state that the motor is static and not powered, a high-precision magnetic field measuring instrument is used to measure the magnetic field distribution around the motor in detail to obtain the magnetic field reference data at different positions, and the magnetic field distribution is measured again in the state that the motor is powered but not rotated to analyze the change of the magnetic field after being powered, and a mathematical model of the magnetic field of the motor is established according to the measurement data and the electromagnetic structure design principle of the motor;

[0013] Before the motor is operated, a data calibration operation is performed, the motor is adjusted to a known initial angle position, the magnetic field data collected by the magnetic field sensing array at this time is recorded as the calibration reference data, the angle of the motor is gradually changed to other known positions, and the corresponding magnetic field data is recorded respectively, and the corresponding relationship between the consistent angle and the corresponding magnetic field data is used to calibrate and optimize the parameters in the magnetic field model;

[0014] S11d: when the motor starts to operate, the data acquisition card collects the magnetic field data of each sensor in the magnetic field sensing array in real time according to the set sampling frequency;

[0015] S11e: a tachogenerator is arranged on the motor to collect the rotating speed information, a current transformer and a voltage transformer are used to collect the current and voltage respectively, a microphone is arranged on the motor to collect the running sound of the motor, and the collected data is time stamped to form a complete time series data set.

[0016] Preferably, in the S1 step, the data preprocessing step includes:

[0017] S12a: data preprocessing, which is performed at the same time as data acquisition, including removing outliers and data smoothing;

[0018] S12b: according to the magnetic field model established and calibrated in advance, the real-time collected magnetic field data is input into an angle calculation algorithm, and the inverse problem in the magnetic field model is solved, that is, the angle position of the motor is inversely calculated according to the known magnetic field data;

[0019] S12c: During the operation of the motor, the motor angle data calculated based on the magnetic field induction array is compared with other traditional angle measurement methods;

[0020] S13d: The angle accuracy measured by the magnetic field induction array is evaluated using statistical analysis methods, the error index between the measured angle and the true angle is calculated, and the operating conditions of the motor are changed to evaluate the measurement accuracy under various operating conditions;

[0021] When the accuracy does not meet the requirements, the layout of the sensor is optimized, the magnetic field model is improved, and the data processing algorithm is optimized.

[0022] Preferably, in the S2 step, when using a linear regression model, the original parameters such as current and voltage are directly used as features, the parameters are combined and transformed, and a regularization method is applied.

[0023] Preferably, the S2 step further includes support vector regression, referred to as SVR, which is used to handle linear and complex nonlinear relationships and to handle the relationship between the angle and the current and voltage caused by the length change inside the motor.

[0024] Preferably, in the S2 step, the LSTM belongs to a neural network algorithm, and the neural network algorithm further includes an MLP, which is a multi-layer perceptron. The MLP trains the network using a backpropagation algorithm, adjusts the connection weights between neurons, and uses the ReLU function in the activation function in the hidden layer. to strengthen the nonlinear expression of the model.

[0025] Preferably, the LSTM is used for time series data of the motor angle, which is used to handle long-term dependencies in sequence data. LSTM stores and updates historical information through memory cells, thereby more accurately predicting future angle changes of the motor.

[0026] Preferably, in the S3 step, the steps of the adversarial training include:

[0027] S31a: Construct a generator network, input the sound vector, and output simulated motor operation data, including magnetic field strength change, speed, current, and voltage sequence. The generator generates a data distribution similar to the true motor operation data;

[0028] S31b: Construct a discriminator network, input the real motor data or the data generated by the generator, and output a probability value representing the authenticity of the data, to distinguish whether the input data is real or not;

[0029] S31c: training the discriminator, inputting real motor data and a batch of data generated by the generator into the discriminator, adjusting parameters of the discriminator, using a binary cross-entropy loss function, and enabling the discriminator to accurately distinguish between real data and generated data, i.e. outputting a probability close to 1 for real data and a probability close to 0 for generated data;

[0030] S31d: training the generator, fixing parameters of the discriminator, inputting data generated by the generator into the discriminator, and enabling the generator to distinguish from the discriminator by adjusting its own parameters, so that the discriminator outputs a probability close to 1 for the data generated by the generator, and alternately training the generator and the discriminator.

[0031] Preferably, in the S3 step, the reinforcement learning is to input current motor operation data and simulated data generated by the generator into an agent based on a deep learning policy network, and the output of the agent is a decision on motor control parameters, and the specific steps include:

[0032] S32a: designing a reward and punishment function,

[0033] If the agent accurately predicts the motor angle, stably operates, and has high efficiency, the agent is rewarded;

[0034] If the agent has errors in predicting the motor angle, does not operate stably, and has high energy consumption, the agent is punished;

[0035] S32b: the agent updates parameters of the policy network using a reinforcement learning algorithm according to the reward value and a new state;

[0036] S32c: connecting the trained policy network to a motor control system, collecting real-time motor operation data, inputting the data into the policy network, and outputting an adjustment value of the motor control parameters from the policy network, so as to realize accurate control and efficient operation of the motor angle.

[0037] Preferably, the S4 step specifically adjusts the driving signal of the motor in advance according to the predicted angle value, accurately controls the motor, and periodically updates the optimization model using newly collected data when the relationship between the angle and the parameters of the motor changes.

[0038] Compared with the prior art, the present application has the following advantages:

[0039] The rotation angle operation prediction method of the linear motor accurately predicts and efficiently controls: by constructing a prediction model through machine learning algorithms, the motor's rotation angle can be accurately back calculated, and the motor's operation state changes can be anticipated in advance. Based on this, the motor control system can adjust the driving signal in advance and accurately according to the predicted angle value, ensuring that the motor always operates stably in an ideal state, greatly improving the control accuracy of the relationship between the motor angle and parameters, and ensuring the continuity and efficiency of the production process.

[0040] The rotation angle operation prediction method of the linear motor comprehensively uses magnetic field sensors, tachogenerators, current transformers, voltage transformers, microphones and other sensors to collect data, covering magnetic field strength, speed, current, voltage, running sound and other rich information, forming a comprehensive time series data set. Multiple sources of data complement and verify each other, providing a solid data foundation for accurate prediction, enabling the model to more comprehensively capture motor operating characteristics and adapt to complex and variable working conditions.

[0041] The rotation angle operation prediction method of the linear motor constructs a generator and a discriminator network, uses an adversarial training mechanism to make the generator generate highly realistic simulated motor operation data, and the discriminator constantly improves its ability to distinguish between true and false. Alternating training between the two enables the model to learn more extensive and subtle motor data features, greatly improving the model's understanding depth and adaptability to real motor data, and enabling accurate prediction in the face of diverse actual working conditions.

[0042] The rotation angle operation prediction method of the linear motor incorporates reinforcement learning, using motor operation data and simulated data as environmental information, and the agent makes decisions on motor control parameters based on a deep learning policy network. According to the precisely designed reward and penalty functions, the agent constantly optimizes its strategy to seamlessly integrate with the motor control system. Not only can it adjust control parameters in real time based on operation data to ensure accurate control of motor angle and efficient operation, but it can also provide timely warnings when potential faults such as angle prediction error, unstable operation, and abnormal energy consumption increase, assisting in intelligent operation and maintenance, reducing equipment failure rate, reducing downtime, and saving maintenance costs.

[0043] The rotation angle operation prediction method of the linear motor continuously monitors measurement accuracy during motor operation, uses statistical analysis methods to evaluate angle accuracy, and immediately optimizes and adjusts from sensor layout, magnetic field model, data processing algorithms and other aspects once the accuracy does not meet the requirements. And regularly update the model with newly collected data, so that it can keep pace with the times and continuously adapt to performance changes, component aging and other factors during long-term motor operation, and always maintain high-precision prediction standards. BRIEF DESCRIPTION OF DRAWINGS

[0044] Figure 1 The flowchart of the present application. DETAILED DESCRIPTION

[0045] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0046] Please refer to Figure 1 The present application provides a technical solution: a rotation angle operation prediction method of a linear rotary motor, which is predicted by selecting a machine learning algorithm, and the steps include:

[0047] S1: data acquisition and preprocessing of the linear rotary motor, collecting angle data and parameters of the motor by a sensor, for training the machine learning model, and preprocessing the collected data, S2: selecting a machine learning algorithm, using linear regression mode when the motor angle and the remaining parameters are in linear relationship, using LSTM when the motor angle is affected by the previous angle state and the parameter history value, S3: model training, inputting the preprocessed training data into the selected machine learning model for training, using the combination of adversarial training and reinforcement learning, S4: model application, deploying the model after reinforcement learning to the detection system of the linear rotary motor, obtaining the parameters of the motor and inputting them into the model, and feeding back the predicted value of the motor angle.

[0048] In S1 step: for the installation of sensors and debugging steps, S11a: the sensor is a magnetic field sensor and the number is at least two, the magnetic field sensor is arranged according to the installation state of the motor, the appropriate type and sensitivity of the magnetic field sensor is selected according to the power, size and expected measurement accuracy of the motor, the number and distribution array geometry of the sensor are determined, the rotating shaft of the motor is approximately vertical, a circular array layout can be used, the sensors are uniformly distributed on the circumference with the motor shaft as the center, the circumference radius is determined according to the effective range of the motor magnetic field and the induction distance of the sensor, which can generally be selected within 1.5-3 times the radius of the motor shell, the number of sensors can start from 8 and be adjusted according to the subsequent experimental results and accuracy requirements, the installation bracket of the sensor is designed to ensure that the position of each sensor in the array is fixed and accurate, and the installation bracket should have sufficient mechanical stability to prevent the sensor position from shifting due to vibration and other factors. Install the magnetic field sensing array around the motor at a suitable location to ensure that there are no large metal obstacles between the sensor and the motor to interfere with the propagation of the magnetic field, S11b: the signal output terminals of all magnetic field sensors are connected to the signal conditioning circuit for signal amplification, filtering and conversion to achieve accurate data acquisition by the data acquisition card, and the transmitted data is transmitted to the embedded data processing platform. The signal output terminals of each magnetic field sensor are connected to the signal conditioning circuit, and the main function of the signal conditioning circuit is to amplify, filter and convert the weak electrical signals output by the sensor, so that they can be accurately acquired by the data acquisition card. The amplification circuit may need to have an amplification factor of 100-1000, and a low-pass filter is used to remove high-frequency noise interference. The cutoff frequency of the filter can be determined according to the frequency range of the motor magnetic field change, which is generally between 1-10 kHz. The signal after signal conditioning is connected to the analog input channel of the data acquisition card. The selection of the data acquisition card should consider parameters such as sampling frequency, resolution and channel number. The sampling frequency should be determined according to the motor speed and the frequency characteristics of the magnetic field change. For high-speed motors, the sampling frequency should be at least 10-20 times the magnetic field change frequency corresponding to the highest motor speed to ensure accurate capture of dynamic changes in the magnetic field. The resolution of the data acquisition card should meet the accuracy requirements of the magnetic field strength measurement. For example, for a magnetic field strength change range of 0-100mT, a data acquisition card with 12-16 bit resolution can be selected.The data acquisition card is connected to a computer or an embedded data processing platform through a USB or PCI interface, S11c: In the state of motor static and no power, the magnetic field distribution around the motor is measured in detail using high-precision magnetic field measuring instruments, and the magnetic field reference data at different positions is obtained. In the case of motor energization but not rotation, the magnetic field distribution is measured again, and the change of magnetic field after energization is analyzed. According to these measurement data, the mathematical model of motor magnetic field is established combined with the electromagnetic structure design principle of motor. The model should be able to describe the theoretical variation relationship of magnetic field intensity and direction at each sensor in the magnetic field sensing array at different angle positions. According to the principle of rotating magnetic field generation, the mathematical expression between magnetic field intensity and motor angle, current and other parameters is derived using Maxwell's equations, and it is used as the basic model for subsequent calculation of motor angle. In the modeling process, the influence of the magnetic permeability of motor material and the non-uniformity of air gap magnetic field on the magnetic field distribution should be considered, and appropriate correction coefficients or functions are used for compensation. Since the motor air gap magnetic field may have certain non-uniformity in the radial and axial directions, a polynomial function can be used to fit the non-uniformity change and it is included in the magnetic field model. Before the motor runs, data calibration operation is performed, the motor is adjusted to a known initial angle position, and the magnetic field data collected by the magnetic field sensing array at this time is recorded as the calibration reference data. The motor angle is gradually changed to other known positions, and the corresponding magnetic field data is recorded respectively. Through the corresponding relationship between the consistent angle and the corresponding magnetic field data, the parameters in the magnetic field model are calibrated and optimized, S11d: When the motor starts to run, the data is preliminarily preprocessed at the same time of data acquisition, including removing abnormal values such as instantaneous large jump data caused by electromagnetic interference and data smoothing processing such as using sliding average method to smooth the data to reduce the influence of noise on subsequent calculation. The data acquisition card collects the magnetic field data of each sensor in the magnetic field sensing array in real time according to the set sampling frequency. According to the pre-established and calibrated magnetic field model, the real-time collected magnetic field data is input into the angle calculation algorithm. The algorithm solves the inverse problem in the magnetic field model, that is, the motor angle position is calculated from the known magnetic field data. For the magnetic field sensing array based on circular array layout, the angle of the motor can be calculated by using the triangulation method or the optimization algorithm based on the least square method. The geometric position relationship between different sensors and the difference of the magnetic field intensity measured by them are used to calculate the angle offset of the motor head relative to the array center through the trigonometric function relationship. In the calculation process, the vector characteristics of the magnetic field should be considered, and the magnetic field intensity and direction information should be included in the calculation. Since the motor magnetic field may have certain nonlinearity and multiple solutions, such as symmetry of magnetic field distribution at some special angle positions, which may cause ambiguity in angle calculation, some auxiliary methods are needed to solve these problems.For example, in combination with the rotation direction information of the motor, the unique motor angle solution can be determined by other sensors such as encoders or by using the time sequence characteristics of magnetic field changes, such as the trend of magnetic field strength change over time, S11e: a tachogenerator is arranged on the motor to collect speed information, current and voltage are collected respectively using current transformers and voltage transformers, forming a complete time series data set, the collected data needs to be time stamped, the data acquisition system collects 100 groups of data per second, including motor angle, speed, three-phase current and three-phase voltage, these data can be stored in a local database or a cloud server for subsequent processing, a microphone is arranged on the motor to collect the running sound of the motor, and the collected data is time stamped to form a complete time series data set.

[0049] The steps for data preprocessing in S1 include: S12a: data preprocessing, when the motor starts to run, the data acquisition card collects the magnetic field data of each sensor in the magnetic field sensing array in real time according to the set sampling frequency, and at the same time of data acquisition, including removing outliers and data smoothing processing, using simple algorithms such as moving average method to smooth the data to reduce the influence of noise on subsequent calculation, S12b: according to the pre-established and calibrated magnetic field model, input the real-time collected magnetic field data into the angle calculation algorithm, which solves the inverse problem of the magnetic field model. For the magnetic field sensing array based on circular array layout, the triangulation method or optimization algorithm based on least squares method can be used to calculate the angle of the motor. Taking the triangulation method as an example, the angle offset of the motor head relative to the array center is calculated through the geometric position relationship between different sensors and the difference of the magnetic field intensity they measured. In the calculation process, the vector characteristics of the magnetic field should be considered, and the magnetic field intensity and direction information should be taken into account. Since the motor magnetic field may have certain nonlinearity and multiple solutions, such as symmetry of magnetic field distribution at some special angle positions, which may cause ambiguity in angle calculation, combined with the rotation direction information of the motor, which can be obtained by other sensors such as encoders or using the time sequence characteristics of the magnetic field change, such as the trend of magnetic field intensity change over time. The unique motor angle solution is obtained, that is, the angle position of the motor is calculated by solving the inverse problem of the magnetic field model, S12c: during the operation of the motor, the motor angle data calculated based on the magnetic field sensing array is compared and verified with other traditional angle measurement methods, such as high-precision encoder measurement results. If there is a deviation between them, the reason should be analyzed in time, which may be due to the inaccuracy of the magnetic field model, sensor failure or defects in the data processing algorithm, etc. If it is found that the calculated angle data has a large deviation when the motor rotates at high speed, it may be due to the fact that the magnetic field model does not fully consider the dynamic characteristics of the magnetic field change at high speed, and the magnetic field model needs to be further modified and improved, S13d: statistical analysis method is used to evaluate the angle accuracy measured by the magnetic field sensing array, and the error index between the measured angle and the true angle is calculated, such as root mean square error (RMSE), mean absolute error (MAE), etc. Change the running conditions of the motor, such as different rotating speeds, loads, etc., and evaluate the measurement accuracy under various working conditions. When the accuracy cannot meet the requirements, optimize the layout of the sensors, improve the magnetic field model, and optimize the data processing algorithm, gradually improve the measurement accuracy. By increasing the number of magnetic field sensors or adjusting the distribution position of the sensors, the measurement accuracy may be improved; or more complex magnetic field modeling methods and data processing algorithms are used, such as magnetic field model correction and angle calculation method based on machine learning, to adapt to more complex motor operating environment and higher accuracy requirements.

[0050] In the S2 step, when using a linear regression model, the original parameters such as current and voltage are directly used as features, and these parameters can also be combined or transformed. The product and square of the current and voltage are calculated to increase the fitting ability of the model. For example, a feature vector containing motor current, voltage, current square, voltage square, and current voltage product is constructed as the input of the linear regression model. Regularization methods such as ridge regression are applied, which incorporates an L2 norm penalty term in the loss function. Lasso regression adds an L1 norm penalty term, which involves a regularization parameter and the weight coefficients of the model. In actual operation, the value of the regularization parameter can be fine-tuned to control the complexity of the model, ensuring that the model can fully fit the training data without overfitting and reducing the generalization ability. The support vector regression (SVR) is also included in the S2 step. SVR can map data to high-dimensional space through kernel functions to handle non-linear relationships. Common kernel functions include linear kernel, polynomial kernel, Gaussian radial basis kernel, and kernel parameters. For motor angle prediction, if preliminary analysis shows that the relationship between motor angle and parameters is complex and nonlinear, and the data distribution is relatively concentrated, Gaussian radial basis kernel function can be used to optimize the performance of the model by adjusting the parameters. In addition to kernel function parameters, SVR has other parameters to adjust, such as the penalty parameter, which controls the penalty for training errors. A larger value means a larger penalty for training errors, and the model will try to fit the training data, but may lead to overfitting. A smaller value may make the model too simple and unable to fit the data well. Cross-validation and other methods can be used to select the appropriate parameter combination. SVR is used to handle linear and complex nonlinear relationships, and the relationship between the angle and the current and voltage caused by the length change of the motor inside. In the S2 step, LSTM belongs to neural network algorithms, and neural network algorithms also include MLP (Multi-Layer Perceptron). The network structure is determined according to the complexity of the data and the desired prediction accuracy. For example, for input data containing magnetic field strength data, magnetic field values collected from multiple sensor positions, speed, three-phase current, and three-phase voltage, the number of nodes in the input layer is determined first. MLP constructs a neural network containing an input layer and an output layer, trains the network using the backpropagation algorithm, and adjusts the connection weights between neurons. In the hidden layer, the ReLU function is used as the activation function The non-linear expression of the enhanced model is to output the input value when the input value is greater than 0, and output 0 when the input value is less than or equal to 0. LSTM is used for time series data of motor angle. When using LSTM, the input data format should be set according to the time step. For example, if the past 10 time points are considered to predict the current motor angle, the input data shape is the number of samples per training, 10, and the number of input features at each time point, such as motor speed, current, and voltage information. After the LSTM layer processes the data, a fully connected layer is connected to convert the processed result into a predicted value of the motor angle. LSTM is a very effective algorithm for processing long-term dependencies in sequence data. For example, the angle change of the motor in a period of time may be affected by the previous angle state and other historical parameter values. LSTM stores and updates historical information through memory cells, thereby more accurately predicting the future angle change of the motor.

[0051] In step S3, the steps of adversarial training include: S31a: constructing a generator network that inputs sound vectors and outputs simulated motor operation data, including magnetic field strength change, speed, current, and voltage sequence. The generator generates a data distribution similar to the real motor operation data. A discriminator network is also constructed, which inputs real motor data or data generated by the generator. The task of the discriminator is to distinguish whether the input data is real or generated, and output a probability value representing the authenticity of the data. S31b: Construct a discriminator network that inputs real motor data or data generated by the generator to distinguish whether the input data is real or not, and outputs a probability value representing the authenticity of the data. S31c: Train the discriminator by inputting real motor data and a batch of data generated by the generator into the discriminator. By adjusting the parameters of the discriminator, using the binary cross-entropy loss function, the discriminator can accurately distinguish between real and generated data, i.e. output a probability close to 1 for real data and a probability close to 0 for generated data. S31d: Train the generator by fixing the parameters of the discriminator and inputting the data generated by the generator into the discriminator. The goal of the generator is to adjust its own parameters to make the discriminator output a probability close to 1 for the data it generates. The discriminator is trained alternately. This process is achieved by minimizing the loss function of the generator, which is related to the output probability of the discriminator for the generated data. By alternately training the generator and the discriminator, the generator can generate high-quality simulated motor data after multiple iterations.

[0052] In the S3 step, the reinforcement learning is to input the current motor running data and the simulation data generated by the generator, the magnetic field strength, the rotating speed and the simulation data generated by the generator into the agent, which is a policy network based on deep learning, and the output of the agent is the decision on the motor control parameters such as the voltage adjustment amount, the current limit value, etc. The specific steps include:

[0053] In the S32a, the reward and punishment functions are designed, and the agent is rewarded when the agent accurately predicts the motor angle, the accuracy is the deviation from the actual measured angle, the rotating speed fluctuation range when the motor runs stably, the stability of the current and voltage, and the high efficiency such as the ratio of the power consumption to the output power, and the agent is punished when the agent has errors in predicting the motor angle, the motor runs unstably and the energy consumption is high. In the S32b, at each training time step, the agent selects a control action according to the current state, the real and simulation data, adjusts the motor parameters, the environment updates the running state of the motor according to the action, and returns a reward value. The agent updates the parameters of the policy network according to the reward value and the new state using the reinforcement learning algorithm. In the S32c, through a large number of training time steps and multiple rounds of training, the trained policy network is connected to the motor control system, the running data of the motor is collected in real time and input into the policy network, and the policy network outputs the adjustment value of the motor control parameters, so as to realize the accurate control of the motor angle and the high efficiency of the motor running. The agent learns the optimal motor control strategy, and in the process, the state space contains the simulation data, and the model also learns how to better use the simulation data to improve the motor running performance and the accuracy of the angle prediction.

[0054] The S4 step is specifically that the control system of the motor predicts the angle value to adjust the driving signal of the motor in advance, and accurately controls the relationship between the angle and the parameters of the motor. When the relationship between the angle and the parameters of the motor changes, the optimization model is updated regularly using newly collected data.

[0055] In the use of the rotating angle running prediction method of the linear rotating motor, in the data collection link, multiple sensors work cooperatively. The magnetic field sensor is a core component, which is carefully laid out according to the characteristics of the motor, and is usually arranged in an array around the motor. Taking a motor with a vertical rotating shaft as an example, a circular array is selected, the circumferential radius is determined according to the effective range of the motor magnetic field and the sensing distance of the sensor, 8 or more sensors are uniformly distributed, and the position is accurately and stably ensured by means of a mounting bracket to avoid obstruction of the magnetic field propagation. At the same time, the speed generator, the current transformer and the voltage transformer are respectively responsible for collecting the rotating speed, current and voltage information, and the microphone collects the running sound. All data are provided with accurate time stamps, 100 groups of data are collected per second, and a complete time series data set is formed, which is transmitted to the embedded data processing platform in real time.

[0056] Data preprocessing is synchronized and unfolded. On the one hand, outliers such as instantaneous large fluctuations caused by electromagnetic interference are removed, and moving average method is used to smooth the noise. On the other hand, according to the magnetic field mathematical model established by accurate measurement when the motor is stationary and not rotating, the real-time magnetic field data is substituted into the inverse problem based on the triangulation method or least squares optimization algorithm, combined with the characteristics of magnetic field vector, rotation direction and time sequence information, the motor angle is accurately back calculated, and the measurement results of traditional high-precision encoder are compared and verified to ensure the accuracy of angle calculation.

[0057] In the model construction stage, the algorithm is selected according to the relationship between motor angle and parameters. When the relationship is linear, linear regression is used, not only the original current and voltage parameters are used, but also the combination transformation (such as product, square operation to construct feature vector) is used to improve the fitting ability, combined with ridge regression or Lasso regression regularization to fine-tune the model complexity to prevent overfitting. In the face of complex nonlinear relationship, support vector regression (SVR) plays a big role, which maps data to high-dimensional space by using Gaussian radial basis kernel function, and optimizes kernel parameters and penalty parameters by cross-validation to accurately handle the correlation between angle and electrical parameter changes. For motor angle data with time series characteristics, long short-term memory network (LSTM) has obvious advantages, which sets the input data format according to the past time steps (such as 10), stores and updates historical information through memory cells, and outputs the predicted angle through fully connected layers. Multilayer perceptron (MLP) helps prediction by building neural networks with specific activation functions (such as ReLU) and optimizing neuron connection weights through back propagation.

[0058] The model training adopts an innovative mode combining adversarial training and reinforcement learning. In adversarial training, the generator inputs sound vectors to generate simulated motor operation data, and the discriminator distinguishes between true and false. Through the alternation of the two, the parameters are optimized by the binary cross-entropy loss function to make the generator produce high-quality simulated data. In reinforcement learning, the agent relies on a deep learning policy network to create a state space with real and simulated motor operation data, and design a reward and punishment function based on motor angle prediction accuracy, running stability and energy efficiency. In the training cycle, the agent selects control actions based on the state, and the environment feedbacks the reward to update the policy network parameters. After a large number of training steps and multiple iterations, the agent masters the optimal motor control strategy to improve the running performance and angle prediction accuracy.

[0059] Finally, in the application stage, the trained model is seamlessly embedded into the motor detection system. The control system inputs the motor operation parameters into the model in real time, quickly feeds back the angle prediction value, and adjusts the driving signal in advance to ensure the stable operation of the motor. Moreover, as the motor runs, new data is collected regularly to update and optimize the model, adapting to changes in motor performance, and ensuring accurate prediction and efficient control of the running angle of the linear motor throughout the process.

[0060] While embodiments of the application have been shown and described, it is to be understood that the embodiments described are merely exemplary of the principles and application of the present application. Numerous modifications and adaptions can be effected without departing from the spirit and scope of the present application, which is not limited to the exact construction and arrangement described. It is intended, therefore, to cover all modifications and adaptions that fall within the scope of the claims and their equivalents.

Claims

1. A method for predicting the rotation angle of a linear rotary motor, using a machine learning algorithm for prediction, characterized by the following steps: Comprise: S1: data collection and preprocessing of linear motor, use sensors to collect motor angle data and parameters, for machine learning model training, preprocess the collected data; S2: select machine learning algorithm, when motor angle and other parameters are linear relationship, use linear regression mode, when motor angle is affected by previous angle state and parameter history value, use LSTM; S3: model training, input the preprocessed training data into the selected machine learning model for training, adopt the combination of adversarial training and reinforcement learning; S4: model application, deploy the model after reinforcement learning to the detection system of linear motor, get the motor parameters and input them into the model, and feedback the predicted value of motor angle.

2. The method of claim 1, wherein: In S1 step: for installing the sensor and debugging steps include: S11a: the sensor is a magnetic field sensor and the number is at least two, the magnetic field sensor is arrayed according to the installation state of the motor; S11b: the signal output end of all the magnetic field sensors is connected with signal conditioning circuit for expanding electric signal, filtering and converting, so as to accurately collect data by data acquisition card, and transmit the data to embedded data processing platform; S11c: in the state of motor static and no power, use high-precision magnetic field measuring instrument to measure the magnetic field distribution around the motor in detail, obtain the magnetic field reference data at different positions, measure the magnetic field distribution again in the case of motor power on but not rotating, analyze the change of magnetic field after power on, and establish the mathematical model of motor magnetic field according to these measurement data and the design principle of motor electromagnetic structure; Before the motor runs, carry out data calibration operation, adjust the motor to the known initial angle position, record the magnetic field data collected by the magnetic field induction array at this time as the calibration reference data, gradually change the angle of the motor to other known positions, respectively record the corresponding magnetic field data, and calibrate and optimize the parameters in the magnetic field model according to the corresponding relationship between consistent angle and corresponding magnetic field data; S11d: when the motor starts to run, the data acquisition card collects the magnetic field data of each sensor in the magnetic field induction array in real time according to the set sampling frequency; S11e: set a speed generator on the motor for collecting speed information, use current transformer and voltage transformer to collect current and voltage respectively, set a microphone on the motor to collect the running sound of the motor, and the collected data is time stamped to form a complete time series data set.

3. The method of claim 2, wherein: the first and second values are determined based on a difference between the first and second values of the first and second currents, respectively. In S1 step, the steps for data preprocessing include: S12a: data preprocessing, carried out at the same time of data collection, including removing outliers and data smoothing; S12b: according to the pre-established and calibrated magnetic field model, input the real-time collected magnetic field data into the angle calculation algorithm, and solve the inverse problem in the magnetic field model, that is, inversely calculate the angle position of the motor according to the known magnetic field data; S12c: during the operation of the motor, the motor angle data calculated based on the magnetic field induction array are compared with other traditional angle measurement methods; S13d: Using statistical analysis method to evaluate the angle accuracy of the magnetic field sensing array measurement, calculate the error index between the measured angle and the true angle, change the operating conditions of the motor, and evaluate the measurement accuracy under various operating conditions respectively; When the accuracy cannot meet the requirements, optimize the layout of the sensor, improve the magnetic field model, and optimize the data processing algorithm.

4. The method of claim 1, wherein: In the S2 step, when using a linear regression model, directly use the original parameters such as current and voltage as features, perform combination transformation on the parameters, and apply regularization methods.

5. The method of claim 4, wherein: the first and second values are determined based on a difference between the first and second values of the first and second currents, respectively. The S2 step also includes support vector regression, abbreviated as SVR, which is used to handle linear and complex nonlinear relationships and to handle the relationship between the angle and the current and voltage caused by the length change inside the motor.

6. The method for predicting the rotation angle of a linear rotary motor according to claim 5, characterized in that: In the S2 step, the LSTM belongs to a neural network algorithm, and the neural network algorithm further includes an MLP (Multi-Layer Perceptron) which is trained by constructing a neural network including an input layer and an output layer, using a back propagation algorithm to adjust the connection weights between neurons, and using a ReLU function in the activation function of the neurons in the hidden layer to strengthen the nonlinear expression of the model.

7. The method for predicting the rotation angle of a linear rotary motor according to claim 6, characterized in that: The LSTM is used for time series data of the motor angle, which is used to handle long-term dependencies in sequence data, and LSTM stores and updates historical information through memory units to more accurately predict future angle changes of the motor.

8. The method of claim 1, wherein: In the S3 step, the steps of the adversarial training include: S31a: Construct a generator network, input sound vector, output simulated motor operation data, operation data includes magnetic field strength change, speed, current, voltage sequence, the generator generates data distribution similar to the real motor operation data; S31b: Construct a discriminator network, input real motor data or data generated by the generator, used to distinguish whether the input data is real, output a probability value representing the authenticity of the data; S31c: Train the discriminator, input the real motor data and a batch of data generated by the generator into the discriminator, adjust the parameters of the discriminator, use the binary cross-entropy loss function, so that the discriminator can accurately distinguish between real and generated data, that is, output a probability close to 1 for real data, and a probability close to 0 for generated data; S31d: Train the generator, fix the parameters of the discriminator, input the data generated by the generator into the discriminator, the goal of the generator is to adjust its own parameters so that the discriminator outputs a probability close to 1 for the data it generates, and the discriminator is trained alternately.

9. The method for predicting the rotation angle of a linear rotary motor according to claim 8, characterized in that: In the S3 step, the reinforcement learning is to input the current motor operation data and the simulated data generated by the generator into the agent, which is a policy network based on deep learning, and the output is the decision of the motor control parameters, the specific steps include: S32a: Design reward and penalty functions, If the agent accurately predicts the motor angle, runs stably and efficiently, it will be rewarded; If the agent has errors in predicting the motor angle, runs unstably and has high energy consumption, it will be punished; S32b: The agent updates the parameters of its policy network using reinforcement learning algorithms based on the reward value and the new state; S32c: Connect the trained policy network to the motor control system, real-time collect the motor operation data, input into the policy network, the policy network outputs the adjustment value of the motor control parameters, so as to realize accurate control and efficient operation of the motor angle.

10. The method of claim 1, wherein: The S4 step is specifically that the control system of the motor predicts the angle value to adjust the driving signal of the motor in advance, accurately controls, and when the relationship between the angle and the parameters of the motor changes, the optimization model is updated regularly using newly collected data.