CN117811449A - Motor driving method, motor model generating method and electronic device - Google Patents

Motor driving method, motor model generating method and electronic device Download PDF

Info

Publication number
CN117811449A
CN117811449A CN202311851339.8A CN202311851339A CN117811449A CN 117811449 A CN117811449 A CN 117811449A CN 202311851339 A CN202311851339 A CN 202311851339A CN 117811449 A CN117811449 A CN 117811449A
Authority
CN
China
Prior art keywords
motor
model
data
vibration
output
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311851339.8A
Other languages
Chinese (zh)
Inventor
童小彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Awinic Technology Co Ltd
Original Assignee
Shanghai Awinic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Awinic Technology Co Ltd filed Critical Shanghai Awinic Technology Co Ltd
Priority to CN202311851339.8A priority Critical patent/CN117811449A/en
Publication of CN117811449A publication Critical patent/CN117811449A/en
Pending legal-status Critical Current

Links

Landscapes

  • Control Of Electric Motors In General (AREA)

Abstract

The application relates to the technical field of motors, and discloses a motor driving method, a motor model generating method and electronic equipment, wherein the method comprises the following steps: obtaining tail vibration data of the motor, wherein the tail vibration data comprise output signals generated by motor vibration after the motor is stopped being driven; determining a vibration reduction signal based on the tail vibration data and the motor model; the motor model is generated based on the vibration data training of the motor, and is used for reflecting the relation between the input signal and the output signal of the motor; the motor is driven to stop vibrating based on the vibration reduction signal. According to the method, the motor model with higher accuracy based on the input signals and the output data of the motor is used for acquiring the vibration reduction signals, so that tail vibration can be effectively reduced, in addition, when the motor model is built, various parameters of the motor are not required to be acquired, and the workload of building the motor model is effectively reduced.

Description

Motor driving method, motor model generating method and electronic device
Technical Field
The present disclosure relates to the field of motors, and in particular, to a motor driving method, a motor model generating method, and an electronic device.
Background
Motors are widely used in electronic devices such as mobile phones, handles, tablet computers, and smart watches, for example, when a user uses an electronic device, a certain vibration scene is triggered, and the electronic device drives the motor to vibrate. During motor vibration, due to its own nature, the motor may also have a period of end vibration (e.g., the motor vibration waveform of the portion of fig. 2) after the motor's drive waveform is completed (e.g., the short vibration drive waveform of fig. 1), which may affect the user experience.
In some schemes, a related model is generally built for the motor, the output of the motor is predicted in real time, and when the motor is required to stop rotating, a braking signal is obtained according to the model, and the braking signal can timely output a counter-drive pulse to the motor so as to offset the tail vibration. The specific method is as follows: an equivalent circuit model of the linear motor is first constructed based on the basic parameters of the motor, including the shaft diameter, idle current, efficiency, size, etc. of the motor. And then, respectively establishing an electrical equation and a mechanical equation according to the kirchhoff law and the Newton second law, eliminating the intermediate variable current, obtaining a system differential equation between the input voltage and the displacement of the output motor, and finally obtaining a transfer function of the motor system, namely a model corresponding to the motor system and used for reducing tail vibration through Laplace transformation. When the motor is in tail vibration, based on the output of the motor tail vibration, a brake signal of the motor is predicted by using a transfer function, so that the motor is braked, and the tail vibration is eliminated.
However, the above solution requires high accuracy of the motor base parameters for constructing the system differential equation. In the early stage, the basic parameters of the motor are required to be obtained through testing the motor, the workload is large, and as long as one of the parameters is inaccurate to obtain, larger errors can be brought to the predicted data of the motor model, so that the motor cannot be completely stopped by a brake signal derived from the motor model, or the motor is driven to vibrate reversely, and the tail vibration of the motor is difficult to eliminate.
Disclosure of Invention
The purpose of the present application is to provide a motor driving method, a motor model generation method, and an electronic device.
A first aspect of the present application provides a motor driving method, the method comprising: obtaining tail vibration data of the motor, wherein the tail vibration data comprise output signals generated by motor vibration after the motor is stopped being driven; determining a vibration reduction signal based on the tail vibration data and the motor model; the motor model is generated based on the vibration data training of the motor, and is used for reflecting the relation between the input signal and the output signal of the motor; the motor is driven to stop vibrating based on the vibration reduction signal.
It will be appreciated that the motor is also free to vibrate for a period of time after the drive waveform has ended. The braking signal of the motor, namely the vibration reduction signal, can be reversely deduced through the motor model and the collected motor tail vibration data. According to the method, the motor model with higher accuracy based on the motor driving signal and the output data is adopted to acquire the vibration reduction signal, so that the tail vibration can be effectively reduced, in addition, when the motor model is built, various parameters of the motor are not required to be acquired, and the workload of building the motor model is effectively reduced.
In a possible implementation of the first aspect, the method further includes: the vibration data of the motor includes: and first output data when the motor vibrates, wherein the first output data comprises displacement and/or vibration quantity and/or acceleration data.
In a possible implementation of the first aspect, the method further includes: a motor model is generated based on vibration data training of a motor, comprising: acquiring input data of a motor and first output data generated by the motor corresponding to the input data; low-pass filtering the first output data to obtain second output data; and inputting the input data and the second output data into the first model, training the first model, acquiring a second model, and taking the second model as a motor model.
It can be understood that the input data is a driving signal of the motor, the first output data may be collected vibration quantity data of the motor, and the second output data may be obtained after low-pass filtering the vibration quantity data of the motor. The first model is an initial model of the motor, and the initial model is trained through input data and second output data of the motor, so that a model which can describe the relation between the input data and the second output data of the motor, namely a second model, namely a motor model, can be obtained.
In a possible implementation of the first aspect, the method further includes the motor model is:
A(q)×Z(k)=B(q)×X(k)+e(k)
wherein Z (k) is second output data, X (k) is input data of the motor, A (q) and B (q) are model parameters, q is model order, and e (k) is error.
In a possible implementation of the first aspect, the method further includes, when a change in environmental information of the motor is detected, correcting the current motor model, and obtaining a corrected motor model.
It can be understood that when the motor vibration environment is too large, the motor model can not well predict the output data of the motor in a new environment, so that the motor model can be corrected again based on the scheme of the application, and the output of the motor model is more accurate.
In a possible implementation of the first aspect, the method further includes obtaining vibration data when the first driving waveform drives the motor to vibrate; a second drive waveform of the motor is determined based on vibration data and a motor model when the motor is driven to vibrate by the first drive waveform.
It can be understood that the first driving waveform may also be input data of the motor, where the first driving waveform includes driving waveforms with different frequencies, the driving waveforms may be theoretical values, vibration amount data of the motor corresponding to the waveforms with different frequencies may be calculated according to the first driving waveform by the motor model, and the first driving waveform corresponding to the maximum vibration amount of the motor may be collected as an optimal driving waveform of the motor, that is, the second driving waveform.
The second aspect of the application provides a motor model generating method, which comprises the following steps of obtaining input data of a motor and generating first output data corresponding to the input data of the motor; low-pass filtering the first output data to obtain second output data; and inputting the input data and the second output data into the first model, training the first model, acquiring a second model, and taking the second model as a motor model.
It will be appreciated that when the motor model is established, only the input data of the motor, which may be a driving signal, a driving waveform, etc., and the first output data, which may be acceleration, displacement or vibration amount data of the motor, need to be collected. The second output data may be obtained by low pass filtering the first output data. The first model is an initial model of a motor model, and the second model conforming to the motor can be obtained only by training the input data and the second output data, namely the motor model.
In a possible implementation of the second aspect, the method further includes the first output data including displacement and/or vibration amount and/or acceleration data.
A third aspect of the present application provides an electronic device comprising a sensor assembly for acquiring tail vibration data of a motor; the control circuit is used for determining a vibration reduction signal based on the tail vibration data and the motor model; wherein, the motor model is generated based on the vibration data training of the motor, and the motor model is used for reflecting the relation between the input signal and the output signal of the motor. And a driving chip for driving the motor to stop vibrating based on the vibration reduction signal.
It can be understood that the control circuit stores a motor model, the sensor component can be an accelerometer, the tail vibration data of the motor collected by the accelerometer can be input into the control circuit, and the motor model derives a brake signal, so that the motor is driven to vibrate, the tail vibration of the motor is reduced, and the motor is stopped rapidly.
A fourth aspect of the present application provides an electronic apparatus, including a control circuit for outputting a driving signal; the driving chip is used for driving the motor to vibrate according to the driving signal; a sensor assembly for acquiring first output data of the motor; the control module is used for carrying out low-pass filtering on the first output data to obtain second output data; the control module is also used for inputting the driving signal and the second output data into the first model, training the first model, acquiring a second model, and taking the second model as a motor model.
It will be appreciated that in the process of building the motor model, the driving signals sent by the control circuit may be collected as input data. The sensor assembly may be an accelerometer and the first output data collected may be vibration amount data of the motor, and the vibration amount data of the motor is low pass filtered to generate the second output data. Training the motor model by a control module: the control module trains the first model, namely the initial motor model, through the driving signals and the second output data to obtain a second model, namely the motor model, which accords with the motor.
Drawings
FIG. 1 shows a schematic diagram of a short wave drive waveform according to an embodiment of the present application;
FIG. 2 illustrates a schematic diagram of a motor vibration waveform according to an embodiment of the present application;
FIG. 3 illustrates a schematic structural diagram of an electronic device, according to an embodiment of the present application;
FIG. 4 illustrates a flow diagram of a motor driving method according to an embodiment of the present application;
FIG. 5 illustrates a schematic diagram of a method of acquiring a motor drive waveform, according to an embodiment of the present application;
fig. 6 shows a schematic step diagram of a method for generating a motor model according to an embodiment of the present application.
Detailed Description
Embodiments of the present application include, but are not limited to, a motor driving method, a motor model generating method, and an electronic apparatus. In order to facilitate understanding of the technical solutions of the present application, the following explains the technical terms related to the technical solutions of the present application.
Driving waveform of motor: the driving waveform of the motor is a driving voltage having a certain waveform, and is used for driving the motor to vibrate according to the waveform of the driving voltage. In general, when the frequency of the motor driving waveform is identical to the natural frequency of the motor, the vibration effect of the motor is best, and the resonance effect can be achieved. For example, the natural frequency of the motor A model is 170HZ, and the motor A is driven by a driving waveform of 170HZ to achieve a resonance effect; the natural frequency of the motor of the type B is 60HZ, and the motor B is driven by a driving waveform of 60HZ to achieve a resonance effect; if the model B motor is driven by the waveform of the model A170 HZ motor, the vibration sense is bad.
Transfer function: and a function for characterizing a mapping relationship between the input quantity and the output quantity. In the motor system, the relationship between the motor input signal and the output vibration amount is represented by building a motor model, and thus the motor model may be referred to as a transfer function of the motor.
Autoregressive (Auto-Regressive with Extra Input, ARX) model with external inputs: the method is a time sequence analysis method, the model parameters aggregate important information of the system state, and an accurate ARX model can deeply and intensively express the operation rule of the system. The model equation is as follows:
A(q)×Z(k)=B(q)×X(k)+e(k)
wherein Z (k) and X (k) are output and input data, respectively, A (q) and B (q) are model parameters, q is model order, and e (k) is error.
Gradient descent method (Gradient): is a first order optimization algorithm, also commonly referred to as the steepest descent method. To find the local minima of a function using the gradient descent method, an iterative search must be performed for a specified step distance point in the opposite direction of the gradient (or approximate gradient) to the current point on the function.
Low pass filtering: a filtering means for filtering high frequency signals. The principle of low pass filtering may be: a frequency point is set, which cannot pass when the signal frequency is higher than the frequency, in the digital signal, the frequency point is the cut-off frequency, and when the frequency domain is higher than the cut-off frequency, all values are set to 0. Since the low frequency signal is passed through in its entirety during this process, it is called low-pass filtering.
In order to solve the above-mentioned problems, the present application refers to a method for generating a motor model for reducing motor tail vibration, which is used for obtaining vibration data, namely output data of a motor when the motor model needs to be built, when the motor vibrates, taking low-pass filtered output data and a driving signal (namely an input signal of the motor) for driving the motor to vibrate as model training samples, and training an initial motor model, so as to obtain a trained motor model. It can be understood that in the scheme of the application, according to the model established based on the input signal and the output signal of the motor, the real vibration condition of the motor can be more met, and the accuracy of the model is improved. After the motor driving signal is finished, the motor can be reversely driven based on the output waveform of the motor model, and the tail vibration of the motor is effectively reduced.
Wherein the vibration data includes: displacement, vibration amount, and/or acceleration data of the motor. The vibration amount data is as a motor vibration waveform shown in fig. 2.
In addition, the motor model generation method does not need to test basic parameters of the motor, has low working requirements on a test environment, effectively reduces the workload of motor model generation, and improves the generation efficiency of the motor model.
Based on the model generated by the model generation method, the application provides a motor driving method which is applied to electronic equipment. The method comprises the following steps: output data in the motor tail vibration process is acquired, for example, vibration quantity data is included, the output data is subjected to low-pass filtering, the output data after the low-pass filtering is input into a motor model, and a brake signal (the brake signal can be a vibration reduction signal in the application) when the motor tail vibration is acquired based on the motor model. And then driving the motor to reversely vibrate according to the brake signal, thereby reducing the vibration quantity in the tail vibration process of the motor and eliminating the tail vibration of the motor.
The technical scheme of the application can be suitable for the motor field. For the purpose of making the objects, technical solutions and advantages of the present application more apparent, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 3 shows a schematic diagram of an electronic device in an embodiment of the application, which may include a motor. As an example, electronic devices in this application include, but are not limited to: electronic devices such as mobile phones, cameras, tablet computers, smart watches, and the like.
Specifically, as shown in fig. 3, in some embodiments of the present application, the electronic device, for example, a mobile phone, includes:
the control circuit 301 is configured to send a driving signal (the driving signal mentioned in the present application may be input data, an input signal, a driving waveform, etc. of the present application) to the driving chip 302, and send data of the driving signal to the control module 305.
The driving chip 302 is configured to drive the motor 303 to vibrate according to a driving signal sent by the control circuit 301.
The sensor assembly 304 is connected to the motor 303 for acquiring output data of the motor 303 (the output data of the present application may also be vibration amount data, output signals, etc.) and transmitting the output data to the control module 305.
The control module 305 stores therein an algorithm for training the motor model, and is configured to train the motor model according to the driving signal input by the control circuit 301 and the output data of the motor 303 collected by the sensor assembly 304.
It will be appreciated that the parameters of the motor model are stored in the control circuit 301 and that the motor model may be invoked directly by the control circuit 301 to reduce tail vibration during vibration of the motor 303. Since the motor 303 may not be used in the case of tail vibration in different environments, the present application may calibrate the motor model in real time or periodically or according to different scenarios. Specifically, the sensor assembly 304 in the electronic device further includes a temperature sensor, and when detecting that the difference between the current ambient temperature of the motor 303 and the temperature of the motor model trained before exceeds a preset value, the motor model can be corrected again, that is, the motor model is retrained based on the input signal and the output signal of the motor after the difference exceeds the preset value, and an updated new motor model is obtained. The motor model is retrained with the control module 305 based on the drive signals from the control circuit 301 and the output data of the motor 303 collected by the sensor assembly 304, wherein the sensor assembly 304 includes an accelerometer from which the output data of the motor is collected. The trained model parameters are stored in the control circuit 301, so that the motor model parameters in the control circuit 301 are updated and corrected, and the motor model is ensured to be capable of predicting the output of the motor 303 more accurately.
In other embodiments of the present application, as shown in fig. 3, the control module 305 obtains a motor model, and stores the motor model in the control circuit 301, that is, the control circuit 301 outputs a brake signal to reduce the tail vibration of the motor 303. Specifically, after a driving signal sent by the control circuit 301 is finished, the motor 303 is free to vibrate due to its own attribute, at this time, output data of the motor 303 is collected through the accelerometer, a motor model stored in the control circuit 301 derives a braking signal of the motor according to the output data, and the driving chip 302 drives the motor 303 to vibrate through the braking signal, so as to eliminate tail vibration of the motor 303.
For example, fig. 4 shows a schematic flow chart of a motor driving method of the present application, which is applied to an electronic device. In some embodiments of the present application, the electronic device is, for example, a mobile phone, and as shown in fig. 4, the method may be performed by the control module 305 of the mobile phone, and the method may include:
s401: output data of the motor when the motor enters the tail vibration is collected.
For example, the user triggers a vibration scenario when using the mobile phone, at which time the control circuit sends out a driving signal, and the driving chip on the motor drives the motor to vibrate through the driving signal. After the end of the drive signal, the motor is also free to vibrate due to its own nature. At this time, vibration amount data of the motor after the end of the drive signal is collected by the sensor assembly as output data at the time of motor tail vibration.
S402: and low-pass filtering the output data of the motor during tail vibration.
For example, when the vibration quantity data of the motor during tail vibration is collected, the vibration quantity data of the motor is affected by noise in an application scene of the motor, and noise reduction is required to be carried out on the vibration quantity data of the motor, so that relatively accurate vibration quantity data of the motor is obtained. For example, the vibration amount data of the motor is passed through a second-order low-pass filter having a cut-off frequency of 500 HZ.
S403: and inputting the motor vibration quantity data after low-pass filtering into a motor model to obtain a motor braking signal.
Illustratively, the control circuit has stored therein parameter data for a motor model that represents a relationship between the motor drive signal and the output data. The control circuit can deduce a braking signal of the motor according to the motor model after receiving the motor vibration quantity data after low-pass filtering. The motor model is obtained by training a driving signal of a motor and output data under the driving signal as training samples.
S404: according to the braking signal of the motor, ma Dawei vibration is reduced.
The controller outputs a braking signal after obtaining the braking signal of the motor, and the driving chip drives the motor to vibrate according to the braking signal, wherein the vibration direction is opposite to the motor tail vibration direction, so that the motor tail vibration is reduced. In this process, the brake signal may overcorrect the tail vibration of the motor, or may undercorrect the tail vibration of the motor, so that the correction of the tail vibration of the motor needs to be repeated until the motor vibration amount is attenuated to 0.
Fig. 5 illustrates a method of acquiring a motor driving waveform, and by way of example, since the optimal driving waveforms of the motor 303 in different environments are different, in order to acquire the optimal driving waveforms of the motor 303 in different environments, a motor model in the environment needs to be acquired. The method is used in the electronic device shown in fig. 3. As shown in fig. 5, the method of acquiring the motor driving waveform includes:
s501, the control circuit sends a driving signal to the motor.
For example, in order to obtain a motor model in the current environment, the current input signal of the motor 303, that is, the driving signal sent by the control circuit 301, needs to be acquired. The driving signal may be a driving voltage with a certain waveform, the control circuit 301 is connected to the driving chip 302, and the driving chip 302 drives the motor 303 to vibrate according to the waveform of the driving voltage after receiving the driving voltage outputted from the control circuit 301.
S502, collecting output data of the motor through a sensor assembly.
The output data of the motor 303 includes, for example, acceleration, displacement, or vibration amount data of the motor 303, and in this embodiment, the vibration amount data of the motor 303 is taken as the output data of the motor 303. The sensor assembly 304 may be an accelerometer, and the sensor assembly 304 is connected to the control module 305 to output the collected vibration amount data of the motor 303 at the current driving voltage to the control module 305.
S503, generating a motor model through a control module.
Illustratively, the control module 305 has stored therein a training algorithm for the motor model. The control module 305 is further connected to the control circuit 301, and is configured to collect driving signals output by the control circuit 301, and combine output data of the motor 303 to build a motor model. The training samples of the motor model are the driving signals and output data of the motor 303, and model parameters of the motor model are obtained through a training algorithm of the motor model, so that a model is built.
Specifically, taking an ARX model as an example, the ARX model represents a relationship between an input value and an output value, that is, a relationship between a driving signal of the motor 303 and output data. The equation model is shown in formula (one).
A (q) ×z (k) =b (q) ×x (k) +e (k) (one)
Where Z (k) and X (k) are output and input data of the motor 303, respectively, a (q) and B (q) are model parameters, q is a model order, and e (k) is an error. In some embodiments of the present application, a (q) =d (q) Z -q ,B(q)=n(q)Z -q D (q) and n (q) are weighting values of the output and input, Z -q Data representing the first q times, e.g. q=3, Z -3 Data representing the first three times. Z (k) Z -3 Output data representing the previous three times, X (k) Z -3 Representing the input data of the first three times. Taking a third-order linear system as an example, the current output is approximately equal to the weighted sum of the previous three outputs and the input, and the current approximate output is the current predicted output
Wherein d 2 ,d 3 ,d 4 ,n 1 ,n 2 ,n 3 ,n 4 The model parameters are obtained.
ARX modulo by training samplesTraining such that the predicted output of motor 303The error with the actual output is smaller than the preset value, and then the model parameter of the ARX model under the state, namely d, is obtained 2 ,d 3 ,d 4 ,n 1 ,n 2 ,n 3 ,n 4 The motor model can be obtained.
S504, obtaining an identification result according to the motor model.
Illustratively, the control module 305 outputs model parameters to the control circuit 301 after generating the motor model. The control circuit 301 stores an algorithm of the motor model, and the control circuit 301 updates the algorithm after obtaining the model parameters, thereby storing the updated motor model in the control circuit 301. The control circuit 301 designs a driving waveform with the optimal current environment of the motor 303 based on the motor model, namely, collects vibration amount data of different driving waveforms of the motor 303, and selects a waveform corresponding to the data with the largest vibration amount as the driving waveform with the optimal current environment of the motor 303.
It will be appreciated from the above embodiments that the present application builds a motor model directly from the drive signal of the motor 303, and the vibration amount data collected under the drive signal. The directly collected data can more truly reflect the current state of the motor system, and the data already contains information of the small influence of the external environment on the motor system, so that the scheme has better robustness, the whole process does not involve the parameters of the motor 303, namely, the links needing manual intervention are less, and the workload is small.
Figure 6 is a method of generating a motor model according to an embodiment of the present application,
when a specific electronic device needs to acquire a motor model, the method is applied to a server, cloud equipment or a computer system, and the acquired motor data are uploaded to the server, the cloud equipment or the computer system, so that parameters of the motor model are acquired by the device and then are issued to the electronic device. Or the method is directly applied to the electronic equipment and used for obtaining a motor model, and related parameters of the motor are obtained according to the motor model. Specifically, as shown in fig. 6, the method is used in an electronic device, and electronic devices suitable for the application include, but are not limited to: electronic devices such as mobile phones, cameras, tablet computers, smart watches, and the like.
Next, taking a mobile phone as an example, a method for generating a motor model provided in the embodiment of the present application will be described in detail. The mobile phone comprises the motor system identification device. Specifically, the method comprises the following steps:
s601, loading the collected motor vibration quantity data and driving signals.
Illustratively, a driving signal sent by the control circuit 301 to the motor 303 and motor 303 vibration amount data collected by the sensor assembly 304 of the motor 303 under the driving signal are loaded respectively.
S602, carrying out low-pass filtering on vibration quantity data of the motor to obtain a training sample.
Illustratively, since the collected vibration amount data of the motor 303 may introduce more or less noise, and the ARX model indicates that the current output is equal to the weighted sum of the previous outputs and inputs, the current output may be affected by the previous noise, i.e., the noise may gradually accumulate over time, eventually resulting in a large identified model error, and thus low-pass filtering of the vibration amount signal of the collected motor 303 is required to filter out the noise. For example, in the present embodiment, a second-order low-pass filter having a cut-off frequency of 500HZ is employed. At this time, the training samples include the input data of the motor 303, i.e. the driving signal, and the output data of the motor 303, i.e. the low-pass filtered vibration amount data of the motor 303
S603, constructing a motor model.
Illustratively, the motor model is a transfer function between the input signal and the output vibration amount of the motor 303, and the transfer function may be represented by an ARX model, which has the expression:
A(q)×Z(k)=B(q)×X(k)+e(k)
wherein Z (k) and X (k) are respectively output and input data of the motor, A (q) and B (q) are model parameters, q is model order, and e (k) is error. In the present embodiment, a (q) =d (q) Z -q ,B(q)=n(q)Z -q D (q) and n (q) are weighting values of the output and input, Z -q Data representing the first q times, e.g. q=3, Z -3 Data representing the first three times. Z (k) Z -3 Output data representing the previous three times, X (k) Z -3 Representing the input data of the first three times.
Taking a third-order linear system as an example, the current output is approximately equal to the weighted sum of the previous three outputs and the input, and the current approximate output is the current predicted output
Wherein d 2 ,d 3 ,d 4 ,n 1 ,n 2 ,n 3 ,n 4 The model parameters are obtained.
Specifically, the expression of the third-order ARX model is shown as the formula (II):
where the leftmost matrix is H, Z (n) represents the vibration amount data output from the motor 303, and x (n) represents the driving signal from the control circuit 301. The middle coefficient matrix is W, d 2 ,d 3 ,d 4 ,n 1 ,n 2 ,n 3 ,n 4 The matrix at the rightmost end is the predicted output as the model parameter
S604, setting initial parameters of model training.
Illustratively, some initial conditions of the model, namely, initialization algorithm parameters, need to be set at the beginning of training the model. For example, the algorithm parameters that need to be initialized include the number of model iterations I. The total number of training samples B for each training is the number of training samples obtained in step S602. The learning rate lr is used for controlling the updating speed of the model parameters. And stopping the iteration when the updated model parameters enable the error of the predicted output and the actual output of the model to be smaller than Err each time.
It will be appreciated that the purpose of training the model is to find the optimal set of model parameters d 2 ,d 3 ,d 4 ,n 1 ,n 2 ,n 3 ,n 4 The error of each prediction output and the actual output of the model is minimized, and the actual output is vibration quantity data after low-pass filtering.
S605, setting iteration termination conditions.
Illustratively, in some embodiments the iteration number i=2000, the termination error err=0.5. .
It will be appreciated that when the number of iterations of model training reaches 2000, or the sum of the errors of each predicted and actual output of the model is less than 0.5, model iteration is stopped and the model parameter d is output 2 ,d 3 ,d 4 ,n 1 ,n 2 ,n 3 ,n 4
The sample batch number B is the data actually input and actually output by the motor system. The learning rate lr is used for controlling the speed of the model parameter moving along the gradient opposite direction, and if the learning rate is too large, the model is easy to oscillate and can not be converged. Conversely, if the learning rate is too small, the model will converge very slowly, and the learning rate is adjusted to allow the model to converge quickly. When the obtained model parameters make the error of each predicted output and actual output smaller than the end error Err, namely smaller than 0.5, the obtained model parameters can be considered as the optimal parameters, and the model parameters can be substituted into the model expression to obtain the model of the motor. The error is shown in the formula (III).
Where H is a matrix of driving signals and vibration amount data of the motor 303, W is a matrix of model parameters, Z is a matrix of vibration amount data of the motor 303, and B is a total number of training samples.
S606, setting a sample array of the loss function.
Illustratively, in obtaining the optimal model parameters, the model parameters need to be updated by a loss function. In order to enable the motor model to quickly converge, a certain batch of data is extracted from training samples at random each time to correct the loss function, so that the model iteration process is accelerated, and the data finally used for training the loss function can cover all samples as much as possible under the condition that the iteration times are large in random extraction, so that the trained loss function is moderately strong, and the risk of over fitting is reduced. If the total number of the sample arrays is N, B integers are randomly generated between 1 and N and stored in the array P, as shown in the formula (IV).
P=randi ([ 1, n ],1, b) (four)
Wherein, the array P represents the sample array of the loss function, N is the total number of the sample arrays P, and B is the total number of training samples.
S607, setting a loss function.
For example, the model to be finally trained needs to make the error between the predicted value and the true value of each batch of data as small as possible, so when the model parameters do not meet the requirements, the model parameters need to be updated, and the data of the model parameter update are related to the loss function. In this embodiment, the loss function takes half of the sum of squares of errors, namely the following (fifth) equation:
where J (W) is a loss function, H is a matrix of driving signals and vibration amount data of the motor 303, W is a model parameter matrix, Z is a vibration amount data matrix of the motor 303, B is a total number of training samples, and P is a sample array of the loss function.
S608, updating the parameters by using the gradient descent method.
Illustratively, a gradient descent algorithm is employed to update the model parameters. It can be appreciated that the object rises fastest when climbing along its own gradient direction until climbing to the highest gradient of 0; in contrast, if the object wants to climb to the lowest position, the object only needs to climb along the opposite direction of the own gradient until the gradient is 0 or less than a certain threshold value, and the object can be approximately considered to have been crawled to the lowest position. Therefore, if the loss function J (W) is to be minimized, the W parameter is only required to be continuously adjusted so that W is updated along the opposite direction of the gradient. Where W is a multidimensional variable, it is necessary to first bias each dimension and then update the dimension variable in the opposite direction of the dimension bias, for example, the kth dimension variable update process is as follows:
where J (W) is a loss function, H is a matrix of driving signals and vibration amount data of the motor 303, W is a model parameter matrix, Z is a vibration amount data matrix of the motor 303, B is a total number of training samples, P is a sample array of the loss function, and lr is a learning rate.
S609, obtaining a model parameter W based on the training sample iteration model.
The model may be iterated based on the training sample after the loss function and the equation for updating the model parameters are set, and the model parameters may be output after the iteration is completed when the iteration termination condition in step S605 is satisfied, that is, W is set, and the model generation is completed.
It will be understood that, although the terms "first," "second," etc. may be used herein to describe various features, these features should not be limited by these terms. These terms are used merely for distinguishing and are not to be construed as indicating or implying relative importance. For example, a first feature may be referred to as a second feature, and similarly a second feature may be referred to as a first feature, without departing from the scope of the example embodiments.
Furthermore, various operations will be described as multiple discrete operations, in a manner that is most helpful in understanding the illustrative embodiments; however, the order of description should not be construed as to imply that these operations are necessarily order dependent, and that many of the operations be performed in parallel, concurrently or with other operations. Furthermore, the order of the operations may also be rearranged. When the described operations are completed, the process may be terminated, but may also have additional operations not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
References in the specification to "one embodiment," "an illustrative embodiment," etc., indicate that the embodiment described may include a particular feature, structure, or characteristic, but every embodiment may or may not necessarily include the particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same embodiment. Furthermore, when a particular feature is described in connection with a particular embodiment, it is within the knowledge of one skilled in the art to affect such feature in connection with other embodiments, whether or not such embodiment is explicitly described.
The terms "comprising," "having," and "including" are synonymous, unless the context dictates otherwise. The phrase "A/B" means "A or B". The phrase "a and/or B" means "(a), (B) or (a and B)".
In the drawings, some structural or methodological features may be shown in a particular arrangement and/or order. However, it should be understood that such a particular arrangement and/or ordering is not required. Rather, in some embodiments, these features may be described in a different manner and/or order than shown in the illustrative figures. Additionally, the inclusion of a structural or methodological feature in a particular drawing does not imply that all embodiments need to include such feature, and in some embodiments may not be included or may be combined with other features.
The embodiments of the present application have been described in detail above with reference to the accompanying drawings, but the application of the technical solution of the present application is not limited to the applications mentioned in the embodiments of the present application, and various structures and modifications can be easily implemented with reference to the technical solution of the present application, so as to achieve the various beneficial effects mentioned herein. Various changes, which may be made by those of ordinary skill in the art without departing from the spirit of the present application, are intended to be covered by the claims herein.

Claims (10)

1. A motor driving method, comprising:
obtaining tail vibration data of a motor, wherein the tail vibration data comprise output signals generated by motor vibration after the motor is stopped being driven;
determining a vibration reduction signal based on the tail vibration data and a motor model; the motor model is generated based on vibration data training of the motor, and is used for reflecting the relation between an input signal and an output signal of the motor;
the motor is driven to stop vibrating based on the vibration reduction signal.
2. The method of claim 1, wherein the vibration data of the motor comprises: the first output data when the motor vibrates includes displacement and/or vibration amount and/or acceleration data.
3. The method of claim 2, wherein the motor model is generated based on vibration data training of the motor, comprising:
acquiring input data of the motor and first output data generated by the motor corresponding to the input data;
low-pass filtering the first output data to obtain second output data;
and inputting the input data and the second output data into a first model, training the first model, obtaining a second model, and taking the second model as the motor model.
4. A method according to claim 3, wherein the motor model is:
A(q)×Z(k)=B(q)×X(k)+e(k)
wherein Z (k) is second output data, X (k) is input data of the motor, A (q) and B (q) are model parameters, q is model order, and e (k) is error.
5. The method as recited in claim 1, further comprising:
and when detecting the change of the environmental information of the motor, correcting the current motor model to obtain a corrected motor model.
6. The method according to claim 1 or 5, further comprising: obtaining vibration data when a first driving waveform drives the motor to vibrate;
a second drive waveform of the motor is determined based on vibration data when the motor is driven to vibrate by the first drive waveform and the motor model.
7. A motor model generation method is characterized by comprising the following steps,
acquiring input data of the motor and first output data generated by the motor corresponding to the input data;
low-pass filtering the first output data to obtain second output data;
and inputting the input data and the second output data into a first model, training the first model, obtaining a second model, and taking the second model as the motor model.
8. The method according to claim 7, wherein the first output data comprises displacement and/or vibration amount and/or acceleration data.
9. An electronic device, comprising,
the sensor component is used for acquiring tail vibration data of the motor;
the control circuit is used for determining a vibration reduction signal based on the tail vibration data and a motor model; wherein the motor model is generated based on vibration data training of the motor, and the motor model is used for reflecting the relation between an input signal and an output signal of the motor;
and the driving chip is used for driving the motor to stop vibrating based on the vibration reduction signal.
10. An electronic device, comprising,
a control circuit for outputting a driving signal;
the driving chip is used for driving the motor to vibrate according to the driving signal;
a sensor assembly for acquiring first output data of the motor;
the control module is used for carrying out low-pass filtering on the first output data to obtain second output data;
the control module is further configured to input the driving signal and the second output data into a first model, train the first model, obtain a second model, and use the second model as the motor model.
CN202311851339.8A 2023-12-28 2023-12-28 Motor driving method, motor model generating method and electronic device Pending CN117811449A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311851339.8A CN117811449A (en) 2023-12-28 2023-12-28 Motor driving method, motor model generating method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311851339.8A CN117811449A (en) 2023-12-28 2023-12-28 Motor driving method, motor model generating method and electronic device

Publications (1)

Publication Number Publication Date
CN117811449A true CN117811449A (en) 2024-04-02

Family

ID=90429524

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311851339.8A Pending CN117811449A (en) 2023-12-28 2023-12-28 Motor driving method, motor model generating method and electronic device

Country Status (1)

Country Link
CN (1) CN117811449A (en)

Similar Documents

Publication Publication Date Title
CN110146810B (en) Method and device for determining test parameters of linear motor
CN111578966B (en) Hemisphere harmonic oscillator characteristic parameter identification method based on LMS algorithm
CN113155114B (en) Temperature compensation method and device for gyro zero position of MEMS inertial measurement unit
WO2022110413A1 (en) Method and apparatus for determining nonlinear parameter of motor, and device and storage medium
CN112859600B (en) Mechanical system finite time control method based on extended state observer
CN113325311A (en) Method and device for obtaining characteristic parameters of vibration motor and storage medium
CN112257186B (en) Time domain identification method for pneumatic parameters of small four-rotor aircraft
CN111413651B (en) Compensation method, device and system for total magnetic field and storage medium
CN104280047A (en) Gyroscope shift filtering system and method integrating multiple sensors
CN111211726A (en) System for generating motor drive signals
CN112985867B (en) Steering engine testing method, device, equipment and storage medium
CN117811449A (en) Motor driving method, motor model generating method and electronic device
KR100267362B1 (en) Preview control apparatus
CN111427262B (en) Intelligent control method for unknown disturbance of MEMS sensor in extreme environment
JP3697484B2 (en) Dynamic force evaluation system in magnetic support balance device
CN109655057B (en) Filtering optimization method and system for accelerator measurement value of six-push unmanned aerial vehicle
KR20080071532A (en) Resonant frequency identification
CN111351628A (en) Hypersonic wind tunnel continuous variable attack angle test data processing method
CN115309630A (en) Method, device and equipment for generating automatic driving simulation data and storage medium
CN116155143A (en) Method and device for acquiring motor parameters
JP3114358B2 (en) Structure vibration test apparatus and method
CN111310896B (en) Method and device for training neural network
US11314211B2 (en) Method and device for optimizing performance of a servo control of a mechatronic system based on effective static and dynamic margins
JP2002149713A (en) Six-degree-of-freedom simulation method
CN101943889A (en) The method and the device that make the electric drive system regulator start and/or move automatically

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination