Linear motor driving method and device, electronic equipment and computer readable storage medium
By adding prefix driving signals to the linear motor driving signals to detect and update motor parameters in real time, the problem of difficulty in real time in the prior art is solved, and a more stable vibration effect is achieved.
Patent Information
- Application Number
- CN202510280056.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-06-27
AI Technical Summary
The prior art is difficult to update the motor parameters in real time during the use of linear motors, resulting in poor vibration effects.
By adding a prefix drive signal, including a detection signal and a zero drive signal, the linear motor is driven and its operating signal is obtained to determine the current parameters and update the drive signal according to these parameters.
Real-time update of linear motor parameters is achieved, ensuring the stability and efficiency of vibration effects, and avoiding the problem of poor vibration effects caused by parameter differences.
Smart Images

Figure CN120222858A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of linear motors, and in particular to a linear motor driving method, device, electronic device, and computer-readable storage medium. Background Art
[0002] At present, a linear motor is a motor that directly converts electrical energy into linear reciprocating motion mechanical energy. It is often used in scenarios such as motors in speakers and vibration motors in electronic devices. During the life cycle of a linear motor, the motor parameters of the linear motor (such as resonant frequency, DC resistance, quality factor, etc.) will change. Therefore, the control of a linear motor is often inseparable from the detection of the motor parameters.
[0003] In the related technology, the resonant frequency of the linear motor mainly includes the swept frequency modeling method and the residual vibration detection method. The swept frequency modeling method mainly inputs a swept frequency signal to the linear motor, and then measures the voltage and current of the linear motor for modeling, so as to obtain the resonant frequency of the linear motor; the residual vibration detection method detects the residual vibration after the linear motor oscillates, so as to calculate the resonant frequency of the linear motor.
[0004] However, for the swept frequency modeling method, the swept frequency signal usually needs to last for several seconds, so it is difficult to determine the resonant frequency of the linear motor using the swept frequency modeling method during the use of the linear motor; and for the residual vibration detection method, in order to ensure accuracy, the residual vibration detection time generally needs to last for several resonant cycles, that is, it often takes more than 20ms. Therefore, the swept frequency modeling method cannot continue to drive the linear motor during the residual vibration period, and can only continue to drive the linear motor after the motor stabilizes.
[0005] Therefore, both of the above two methods cannot update the motor parameters of the linear motor immediately to the vibration driving data to be played in real time. If the detected motor parameters differ greatly from the motor parameters during use due to environmental changes, the vibration effect of the linear motor will deteriorate. Summary of the invention
[0006] The present application provides a linear motor driving method, device, electronic device and computer-readable storage medium, aiming to solve the above technical problems.
[0007] In a first aspect, the present application provides a linear motor driving method, comprising:
[0008] Add a prefix driving signal to the driving signal to be driven;
[0009] acquiring an operating signal of the linear motor during driving the linear motor according to the prefix driving signal;
[0010] Determine the current parameters of the linear motor according to the working signal of the linear motor;
[0011] Drive the linear motor according to the current parameters of the linear motor and the signal to be driven.
[0012] In some embodiments, the prefix drive signal includes at least one detection signal, the frequency of the detection signal is greater than the frequency of the signal to be driven, and the amplitude of the detection signal is less than the amplitude of the signal to be driven.
[0013] In some embodiments, the prefix drive signal further includes a zero drive signal;
[0014] The zero drive signal is located between the detection signal and the signal to be driven, and the amplitude of the zero drive signal is equal to 0.
[0015] In some embodiments, the duration of the detection signal is less than 50 ms and greater than 5 ms.
[0016] In some embodiments, the step of determining the current parameters of the linear motor according to the working signal of the linear motor includes:
[0017] Determine the current DC resistance of the linear motor according to the working signal of the linear motor;
[0018] Determine the current parameters of the linear motor according to the current DC resistance of the linear motor.
[0019] In some embodiments, the step of determining the current parameters of the linear motor according to the current DC resistance of the linear motor includes:
[0020] Determine the current temperature of the linear motor according to the current DC resistance of the linear motor and the preset DC resistance temperature model;
[0021] Determine the current parameters of the linear motor according to the current temperature of the linear motor and the preset motor parameter temperature model.
[0022] In some embodiments, the step of driving the linear motor according to the current parameters of the linear motor and the signal to be driven includes:
[0023] Determine the target playback waveform set corresponding to the signal to be driven from the preset multiple playback waveform sets according to the signal to be driven;
[0024] Determine the target playback waveform matching the current parameters from the target playback waveform set according to the current parameters of the linear motor, and drive the linear motor according to the target playback waveform;
[0025] Wherein, each playback waveform set includes a plurality of playback waveforms, and each playback waveform corresponds to a parameter of the linear motor.
[0026] In some embodiments, the step of driving the linear motor according to the current parameters of the linear motor and the signal to be driven includes:
[0027] Update the playback bitrate of the linear motor according to the current parameters of the linear motor;
[0028] Drive the linear motor according to the updated playback bitrate of the linear motor and the signal to be driven.
[0029] In some embodiments, the step of driving the linear motor according to the current parameters of the linear motor and the signal to be driven includes:
[0030] Update the driving waveform generation model or the driving waveform compensation model of the linear motor according to the current parameters of the linear motor;
[0031] Regenerate the signal to be driven according to the updated driving waveform generation model, and drive the linear motor according to the regenerated signal to be driven; or
[0032] Compensate the signal to be driven according to the updated driving waveform compensation model, and drive the linear motor according to the compensated signal to be driven.
[0033] In a second aspect, the present application provides a linear motor driving device, including:
[0034] A waveform processing module, which is used to add a prefix driving signal to the signal to be driven;
[0035] A working signal detection module, which is used to obtain the working signal of the linear motor during driving the linear motor according to the prefix driving signal;
[0036] A motor parameter determination module, which is used to determine the current parameters of the linear motor according to the working signal of the linear motor;
[0037] A motor driving module, which is used to drive the linear motor according to the current parameters of the linear motor and the signal to be driven.
[0038] In a third aspect, the present application provides an electronic device, including a memory and a processor. When a computer program stored in the memory is executed by the processor, the processor executes the steps of the linear motor driving method as described in the first aspect.
[0039] In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the linear motor driving method as described in the first aspect are implemented.
[0040] This application adds a prefix drive signal to the drive signal to be processed, and obtains the working signal of the linear motor during the process of driving the linear motor according to the prefix drive signal. Thus, the current parameters of the linear motor can be determined by using the working signal of the linear motor. Therefore, ultimately, the linear motor can be driven according to the current parameters of the linear motor and the drive signal to be processed. That is to say, this application detects the current parameters of the linear motor through the prefix drive signal, and can immediately apply the obtained current parameters of the linear motor to the drive signal to be processed after obtaining the current parameters of the linear motor, so as to ensure the timeliness of the current parameters of the linear motor, and avoid the problem that the vibration effect of the linear motor is poor due to the large difference between the detected motor parameters and the actual motor parameters. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, without creative efforts, other drawings can be obtained according to these drawings.
[0042] Figure 1 FIG. shows a schematic flowchart of a linear motor driving method according to an embodiment of the present application;
[0043] Figure 2 FIG. shows a schematic diagram of a drive signal to be processed and a prefix drive signal according to an embodiment of the present application;
[0044] Figure 3 FIG. shows another schematic diagram of a drive signal to be processed and a prefix drive signal according to an embodiment of the present application;
[0045] Figure 4 FIG. shows a schematic flowchart of determining current parameters according to an embodiment of the present application;
[0046] Figure 5 FIG. shows another schematic flowchart of determining current parameters according to an embodiment of the present application;
[0047] Figure 6 FIG. shows a schematic flowchart of driving a linear motor according to an embodiment of the present application;
[0048] Figure 7 FIG. shows another schematic flowchart of driving a linear motor according to an embodiment of the present application;
[0049] Figure 8 FIG. shows another schematic flowchart of driving a linear motor according to an embodiment of the present application;
[0050] Figure 9 FIG. shows a schematic diagram of a linear motor driving device according to an embodiment of the present application;
[0051] Figure 10 A schematic diagram of an electronic device in an embodiment of the present application is shown. Detailed implementation manners
[0052] Next, with reference to the accompanying drawings in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts fall within the protection scope of the present invention.
[0053] In the description of the present invention, the term "exemplary" is used to mean "serving as an example, illustration, or description". Any embodiment described as "exemplary" in this application is not necessarily construed as being more preferred or having more advantages than other embodiments. In order for any person skilled in the art to implement and use the present invention, the following description is given. In the following description, details are set forth for the purpose of explanation. It should be understood that those skilled in the art can realize that the present invention can be implemented without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid unnecessary details from obscuring the description of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed in this application.
[0054] The embodiments of the present application provide a linear motor driving method, device, electronic device, and computer-readable storage medium, which will be described in detail below respectively.
[0055] First, refer to Figure 1 , Figure 1 A flowchart of a linear motor driving method in an embodiment of the present application is shown. Among them, the linear motor driving method includes:
[0056] Step S101, adding a prefix driving signal to the signal to be driven;
[0057] Specifically, the signal to be driven refers to the control signal that wants to control the linear motor to perform the expected vibration this time. The prefix driving signal refers to a section of prefix signal added before the signal to be driven. The prefix driving signal has nothing to do with controlling the linear motor to perform the expected vibration and is only used as a parameter for detecting the linear motor. In other words, it can be understood that the signal to be driven is the actual control signal for driving the motor to vibrate, and the prefix driving signal is the detection signal for detecting the parameters of the linear motor.
[0058] In some embodiments of the present application, the signal to be driven and the prefix driving signal may be digital signals, and the processor of the electronic device adds the prefix driving signal to the signal to be driven through digital logic processing. In some embodiments of the present application, the signal to be driven and the prefix driving signal may also be analog signals, such as voltage signals or current signals.
[0059] In some embodiments of the present application, refer to Figure 2 , Figure 2 , which shows a schematic diagram of the signal to be driven and the prefix driving signal in an embodiment of the present application. Among them, the prefix driving signal includes at least one segment of detection signal. The frequency of the detection signal is greater than the frequency of the signal to be driven, and the amplitude of the detection signal is less than the amplitude of the signal to be driven. That is to say, the prefix driving signal includes a detection signal with high frequency and low amplitude. When driving the linear motor according to the detection signal, the detection signal with high frequency and low amplitude will cause the linear motor to hardly vibrate. Therefore, it is beneficial to reduce the influence of the detection signal on the vibration effect of the subsequent signal to be driven for driving the linear motor.
[0060] In some embodiments of the present application, refer to Figure 3 , Figure 3 , which shows a schematic diagram of the signal to be driven and the prefix driving signal in an embodiment of the present application. Among them, the prefix driving signal further includes a zero driving signal. The amplitude of the zero driving signal is equal to 0, and the zero driving signal is located between the detection signal and the signal to be driven. After the detection signal with high frequency and low amplitude drives the linear motor to vibrate, the zero driving signal causes the linear motor to stop vibrating. This creates a buffer zone between the detection signal and the signal to be driven. Therefore, the zero driving signal can ensure that the detection signal has no influence on the vibration effect of the subsequent signal to be driven for driving the linear motor.
[0061] Generally, the duration of the detection signal and the zero driving signal is relatively short, so that the signal to be driven can drive the linear motor with a relatively short delay. Exemplarily, the duration of the detection signal may be less than 50 ms and greater than 5 ms, and the duration of the zero driving signal may be less than 20 ms and greater than 5 ms.
[0062] Step S102, obtaining the working signal of the linear motor during driving the linear motor according to the prefix driving signal;
[0063] After adding a prefix drive signal to the signal to be driven, the linear motor can be driven to work. For example, the prefix drive signal can be input into a PID controller or a motor drive chip, and the linear motor is controlled to work by the PID controller or the motor drive chip. Among them, during the driving of the linear motor according to the prefix drive signal, the working signal of the linear motor can be obtained. The working signal of the linear motor can include the working voltage and / or the working current of the linear motor. For example, when the linear motor is driven in voltage mode, since the working voltage is a known quantity, measuring the working current of the linear motor can obtain the working signal of the linear motor. Another example is that when the linear motor is driven in current mode, since the working current is a known quantity, measuring the working voltage of the linear motor can obtain the working signal of the linear motor.
[0064] It can be understood that in some possible embodiments, the working voltage and the working current of the linear motor can also be measured simultaneously to obtain the working signal of the linear motor.
[0065] Step S103: Determine the current parameters of the linear motor according to the working signal of the linear motor;
[0066] After measuring the working signal of the linear motor during the driving of the linear motor by the prefix drive signal, the current parameters of the linear motor can be determined according to the working signal of the linear motor. The current parameters of the linear motor can include the resonant frequency, magnetic induction intensity, quality factor, etc.
[0067] In some embodiments of the present application, since the prefix drive signal includes a high-frequency detection signal, and the impedance of the linear motor under high-frequency operation mainly comes from the DC resistance and inductance, the impedance (DC resistance and inductance) of the linear motor can be calculated according to the working voltage and working current of the linear motor, and then the resonant frequency, magnetic induction intensity, quality factor and other parameters of the linear motor can be determined according to the impedance of the linear motor. In some embodiments of the present application, the working voltage and working current of the linear motor can also be input into a preset mathematical model, and the resonant frequency, magnetic induction intensity, quality factor and other parameters of the linear motor can be obtained according to the output result of the mathematical model.
[0068] Step S104: Drive the linear motor according to the current parameters of the linear motor and the signal to be driven.
[0069] After obtaining the current parameters of the linear motor, the linear motor can be driven by using the current parameters of the linear motor and the signal to be driven. Since the current parameters of the linear motor are obtained by using the prefix drive signal of the signal to be driven, the current parameters of the linear motor have high timeliness, thus avoiding the problem that the detected motor parameters are quite different from the actual motor parameters, resulting in poor vibration effect of the signal to be driven on the linear motor.
[0070] In some embodiments of the present application, the signal to be driven can be adjusted according to the current parameters of the linear motor, so that the signal to be driven matches the current parameters of the linear motor (for example, the frequency of the signal to be driven matches the resonance frequency of the linear motor), and then the linear motor can be driven by the adjusted signal to be driven, thus ensuring the vibration effect of the linear motor.
[0071] In some embodiments of the present application, the playback bit rate of the linear motor can also be adjusted according to the current parameters of the linear motor, so that the frequency of the signal to be driven is objectively changed and the vibration effect of the linear motor is ensured without changing the signal to be driven.
[0072] In some embodiments of the present application, the control model of the linear motor can also be updated according to the current parameters of the linear motor. For example, for an embodiment in which the linear motor is controlled based on a PID controller, the parameters of the PID controller can be updated according to the current parameters of the linear motor, so that the vibration effect of the linear motor can be ensured without changing the signal to be driven.
[0073] The present application adds a prefix driving signal to the signal to be driven, and obtains the working signal of the linear motor during the process of driving the linear motor according to the prefix driving signal, so that the current parameters of the linear motor can be determined by using the working signal of the linear motor. Therefore, finally, the linear motor can be driven according to the current parameters of the linear motor and the signal to be driven. That is to say, the present application detects the current parameters of the linear motor through the prefix driving signal, and can immediately apply the obtained current parameters of the linear motor to the signal to be driven, so as to ensure the timeliness of the current parameters of the linear motor and avoid the problem that the vibration effect of the linear motor is poor due to the large difference between the detected motor parameters and the actual motor parameters.
[0074] In some embodiments of the present application, refer to Figure 4 , Figure 4 shows a schematic flow chart for determining the current parameters in the embodiments of the present application. Among them, the steps of determining the current parameters of the linear motor according to the working signal of the linear motor include:
[0075] Step S401, determine the current DC resistance of the linear motor according to the working signal of the linear motor;
[0076] It should be noted that in the case of high-frequency vibration of the linear motor, the impedance of the linear motor mainly comes from inductance and resistance, and other components can be ignored. At this time, the impedance expression of the linear motor is:
[0077] Z = R + jωL
[0078] where R is the DC resistance of the linear motor and L is the inductance of the linear motor.
[0079] Since the prefix driving signal includes a detection signal with high frequency and low amplitude, and the detection signal causes the linear motor to vibrate at high frequency, the current DC resistance of the linear motor can be determined according to the working voltage and working current of the linear motor under high-frequency vibration.
[0080] In some embodiments of the present application, a frequency-domain signal analysis method can be used to determine the current DC resistance of the linear motor. For example, the working voltage and working current of the linear motor can be converted from time-domain signals to frequency-domain signals through Fourier transform, and then the current DC resistance of the linear motor can be calculated according to the amplitude ratio and phase difference of the frequency-domain signals.
[0081] In some embodiments of the present application, a time-domain signal analysis method can also be used to determine the current DC resistance of the linear motor. For example, the current DC resistance of the linear motor can be calculated according to the following formula:
[0082]
[0083] Where R is the current DC resistance, A is the amplitude ratio of the working voltage and the working current, and θ is the phase difference between the working voltage and the working current.
[0084] Step S402, determine the current parameters of the linear motor according to the current DC resistance of the linear motor.
[0085] After obtaining the current DC resistance of the linear motor, the current parameters of the linear motor can be determined, such as parameters such as the resonant frequency, magnetic induction intensity, and quality factor of the linear motor. In some embodiments of the present application, according to the current DC resistance and a preset mathematical model, parameters such as the resonant frequency, magnetic induction intensity, and quality factor of the linear motor can be calculated through the mathematical model. For example, for an embodiment where the current parameters of the linear motor include the resonant frequency, the preset mathematical model may include a mathematical model of the relationship between the current DC resistance and the resonant frequency; for another example, for an embodiment where the current parameters of the linear motor include the magnetic induction intensity, the preset mathematical model may include a mathematical model of the relationship between the current DC resistance and the magnetic induction intensity; for yet another example, for an embodiment where the current parameters of the linear motor include the quality factor, the preset mathematical model may include a mathematical model of the relationship between the current DC resistance and the quality factor.
[0086] In some embodiments of the present application, refer to Figure 5 , Figure 5 shows another schematic flowchart for determining the current parameters in the embodiments of the present application. Among them, the steps of determining the current parameters of the linear motor according to the current DC resistance of the linear motor include:
[0087] Step S501, determine the current temperature of the linear motor according to the current DC resistance of the linear motor and a preset DC resistance-temperature model;
[0088] It should be noted that the preset DC resistance temperature model characterizes the relationship between the current DC resistance and temperature. The preset DC resistance temperature model can be obtained through pre-tests. Exemplarily, the preset DC resistance temperature model can be expressed by the following formula:
[0089] R = R0(1 + (T - T0)*k1)
[0090] Wherein, R is the current DC resistance of the linear motor, T0 is the set temperature (such as 25°C), T is the current temperature of the linear motor, R0 is the DC resistance of the linear motor at the set temperature T0, and k1 is the DC resistance temperature coefficient of the linear motor.
[0091] Therefore, the current temperature of the linear motor can be calculated according to the following formula:
[0092]
[0093] It can be understood that the above preset DC resistance temperature model is a first-order temperature model. In some possible embodiments, the above preset DC resistance temperature model can also be a second-order temperature model or a third-order temperature model.
[0094] Step S502, determine the current parameters of the linear motor according to the current temperature of the linear motor and the preset motor parameter temperature model.
[0095] After obtaining the current temperature of the linear motor, the current parameters of the linear motor can be determined in combination with the preset motor parameter temperature model. For example, taking the current parameters of the linear motor including the resonant frequency as an example, since temperature changes will cause changes in the elastic material properties (such as elastic modulus, thermal expansion coefficient, etc.) of the linear motor, and this change is consistent for different motors, the resonant frequency of the linear motor at different temperatures can be measured through experiments, and then the preset motor parameter temperature model can be obtained by fitting. Finally, the current resonant frequency of the linear motor can be determined according to the current temperature of the linear motor and the preset motor parameter temperature model.
[0096] For example, assume that the preset motor parameter temperature model satisfies the following formula:
[0097] f0 = f0’(1 + (T - T0)*k2)
[0098] Wherein, f0 is the current resonant frequency of the linear motor, T0 is the set temperature (such as 25°C), T is the current temperature of the linear motor, f0’ is the resonant frequency of the linear motor at the set temperature T0, and k2 is the resonant frequency temperature coefficient of the linear motor.
[0099] It can be seen that substituting the current temperature of the linear motor into the above formula can calculate and determine the current resonant frequency of the linear motor.
[0100] Understandably, when the current parameters of the linear motor include the magnetic field strength, the above-mentioned preset motor parameter temperature model can also be obtained by fitting the magnetic field strength of the linear motor at different temperatures; or, when the current parameters of the linear motor include the quality factor, the above-mentioned preset motor parameter temperature model can also be obtained by fitting the quality factor of the linear motor at different temperatures.
[0101] In some embodiments of the present application, refer to Figure 6 , Figure 6 FIG. shows a schematic flow chart of driving a linear motor in an embodiment of the present application. Among them, the steps of driving the linear motor according to the current parameters of the linear motor and the signal to be driven include:
[0102] Step S601, according to the signal to be driven, determine a target playback waveform set corresponding to the signal to be driven from a plurality of preset playback waveform sets. Each playback waveform set includes a plurality of playback waveforms, and each playback waveform corresponds to a parameter of a linear motor;
[0103] It should be noted that due to the individual differences of linear motors, the parameters of different linear motors are not the same. In order to ensure the vibration effect, multiple playback waveforms matching different motor parameters are usually designed for the linear motor. For example, taking the current parameters of the linear motor including the resonance frequency as an example, the resonance frequencies of different linear motors are not the same. For short vibration waveforms, multiple short vibration waveforms corresponding to different resonance frequencies are usually designed, and these multiple short vibration waveforms form a playback waveform set; for long vibration waveforms, multiple long vibration waveforms corresponding to different resonance frequencies are usually designed, and these multiple long vibration waveforms form another playback waveform set.
[0104] When multiple playback waveform sets are designed for the linear motor, and each playback waveform set has playback waveforms matching different resonance frequencies, then according to the signal to be driven, the target playback waveform set corresponding to the signal to be driven can be determined from the plurality of preset playback waveform sets. For example, assuming that the signal to be driven is generated based on a short vibration waveform, then the playback waveform set including multiple short vibration waveforms can be determined as the target playback waveform. Another example, assuming that the signal to be driven is generated based on a long vibration waveform, then the playback waveform set including multiple long vibration waveforms can be determined as the target playback waveform.
[0105] Step S602, according to the current parameters of the linear motor, determine the target playback waveform matching the current parameters from the target playback waveform set, and drive the linear motor according to the target playback waveform;
[0106] Since each set of playback waveforms has playback waveforms that match the parameters of different linear motors, the target playback waveform that matches the current parameters can be determined from the target set of playback waveforms according to the current parameters of the linear motor. For example, assume that the current parameters of the linear motor include the current resonance frequency, and the determined current resonance frequency is 160 Hz. Then, the playback waveform corresponding to the resonance frequency of 160 Hz or close to 160 Hz can be determined as the target playback waveform, and the signal to be driven can be regenerated according to the target playback waveform to drive the linear motor, ultimately ensuring the vibration effect of the linear motor.
[0107] It can be seen that in the above embodiments, the signal to be driven is updated after determining the current parameters of the linear motor, and the updated signal to be driven matches the current parameters of the linear motor, so the vibration effect of the linear motor can be ensured.
[0108] In some embodiments of the present application, refer to Figure 7 , Figure 7 which shows a schematic flowchart of driving a linear motor in an embodiment of the present application. Among them, the steps of driving the linear motor according to the current parameters of the linear motor and the signal to be driven include:
[0109] Step S701: Update the playback bit rate of the linear motor according to the current parameters of the linear motor;
[0110] Step S702: Drive the linear motor according to the updated playback bit rate of the linear motor and the signal to be driven.
[0111] It should be noted that the playback bit rate of the linear motor represents the playback speed of the linear motor for the signal to be driven. Therefore, if the playback bit rate of the linear motor is changed, it can also be considered that the signal to be driven is updated. For example, assume that the current parameters of the linear motor include the current resonance frequency, the determined current resonance frequency is 160 Hz, the original resonance frequency of the linear motor is 170 Hz, and the frequency bit rate of the linear motor is K. Then, the updated playback bit rate K' of the linear motor can be calculated according to the following formula:
[0112]
[0113] It can be seen that when the playback bit rate of the linear motor is updated, objectively, the frequency of the signal to be driven is equivalently changed, so that the actual frequency of the signal to be driven acting on the linear motor matches the current resonance frequency of the linear motor, thus ensuring the vibration effect of the linear motor.
[0114] In some embodiments of the present application, refer to Figure 8 , Figure 8The figure shows a schematic flowchart of driving a linear motor in an embodiment of the present application. Among them, the steps of driving the linear motor according to the current parameters of the linear motor and the signal to be driven include:
[0115] Step S801: Update the driving waveform generation model or the driving waveform compensation model of the linear motor according to the current parameters of the linear motor;
[0116] Step S802: Regenerate the signal to be driven according to the updated driving waveform generation model, and drive the linear motor according to the regenerated signal to be driven; or compensate the signal to be driven according to the updated driving waveform compensation model, and drive the linear motor according to the compensated signal to be driven.
[0117] It should be noted that the driving waveform generation model refers to a model for generating the signal to be driven according to the playback waveform data, and the driving waveform compensation model is a model for compensating the signal to be driven. After obtaining the current parameters of the linear motor, the driving waveform generation model or the driving waveform compensation model of the linear motor can also be updated, and then the updated driving waveform generation model is used to regenerate the signal to be driven, or the signal to be driven is compensated according to the updated driving waveform compensation model. In this way, the regenerated or compensated signal to be driven also matches the parameters of the linear motor, and the vibration effect of the linear motor can be ensured when driving the linear motor according to the regenerated or compensated signal to be driven.
[0118] To better implement the linear motor driving method in the embodiment of the present application, based on the linear motor driving method, an embodiment of the present application also provides a linear motor driving device, as Figure 9 shown. The linear motor driving device 900 includes:
[0119] A waveform processing module 901, which is used to add a prefix driving signal to the signal to be driven;
[0120] A working signal detection module 902, which is used to obtain the working signal of the linear motor during driving the linear motor according to the prefix driving signal;
[0121] A motor parameter determination module 903, which is used to determine the current parameters of the linear motor according to the working signal of the linear motor;
[0122] A motor driving module 904, which is used to drive the linear motor according to the current parameters of the linear motor and the signal to be driven.
[0123] In some embodiments, the prefix driving signal includes at least one segment of detection signal, the frequency of the detection signal is greater than that of the signal to be driven, and the amplitude of the detection signal is less than that of the signal to be driven.
[0124] In some embodiments, the prefix driving signal further includes a zero driving signal;
[0125] The zero driving signal is located between the detection signal and the signal to be driven, and the amplitude of the zero driving signal is equal to 0.
[0126] In some embodiments, the duration of the detection signal is less than 50 ms and greater than 5 ms.
[0127] In some embodiments, the motor parameter determination module 903 is specifically configured to:
[0128] Determine the current DC resistance of the linear motor according to the working signal of the linear motor;
[0129] Determine the current parameters of the linear motor according to the current DC resistance of the linear motor.
[0130] In some embodiments, the motor parameter determination module 903 is specifically configured to:
[0131] Determine the current temperature of the linear motor according to the current DC resistance of the linear motor and the preset DC resistance temperature model;
[0132] Determine the current parameters of the linear motor according to the current temperature of the linear motor and the preset motor parameter temperature model.
[0133] In some embodiments, the motor driving module 904 is specifically configured to:
[0134] Determine a target playback waveform set corresponding to the signal to be driven from a plurality of preset playback waveform sets;
[0135] Determine a target playback waveform matching the current parameters from the target playback waveform set according to the current parameters of the linear motor, and drive the linear motor according to the target playback waveform;
[0136] Wherein, each playback waveform set includes a plurality of playback waveforms, and each playback waveform corresponds to a parameter of a linear motor.
[0137] In some embodiments, the motor driving module 904 is specifically configured to:
[0138] Update the playback bit rate of the linear motor according to the current parameters of the linear motor;
[0139] Drive the linear motor according to the updated playback bit rate of the linear motor and the signal to be driven.
[0140] In some embodiments, the motor driving module 904 is specifically configured to:
[0141] Update the driving waveform generation model of the linear motor according to the current parameters of the linear motor;
[0142] Regenerate the signal to be driven according to the updated driving waveform generation model, and drive the linear motor according to the regenerated signal to be driven.
[0143] It should be understood that Figure 9 The illustrated device and its modules can be implemented in various ways. For example, in some embodiments, the device and its modules can be implemented by hardware, software, or a combination of software and hardware. Among them, the hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated designed hardware. Those skilled in the art can understand that the above methods and systems can be implemented using computer-executable instructions and / or included in the processor control code, such as provided on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The systems and modules of the present application can not only be implemented by a hardware circuit of programmable hardware devices such as very large scale integrated circuits or gate arrays, semiconductors such as logic chips and transistors, or field programmable gate arrays and programmable logic devices, but also be implemented by software executed by various types of processors, or be implemented by a combination of the above hardware circuits and software (for example, firmware).
[0144] To better implement the linear motor driving method in the embodiments of the present application, based on the linear motor driving method, an electronic device is further provided in the embodiments of the present application, as Figure 10 shown, the electronic device includes:
[0145] One or more processors;
[0146] A memory; and
[0147] One or more applications, where the one or more applications are stored in the memory and configured to be executed by the processor to perform the steps in the linear motor driving method described in any one of the above embodiments of the linear motor driving method.
[0148] Those skilled in the art can understand that Figure 10 the structure shown in does not constitute a limitation on the electronic device, and it may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0149] Wherein:
[0150] The processor 1001 is the control center of the system, connecting various parts of the whole system through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 1002, and calling the data stored in the memory 1002, it executes various functions of the system and processes data, thereby monitoring the system as a whole. Optionally, the processor 1001 may include one or more processing cores; the processor 1001 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Preferably, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 1001 either.
[0151] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area can store data created according to the use of the linear motor drive system, etc. In addition, the memory 1002 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.
[0152] Although not shown, the linear motor drive system may also include a display unit, etc., which will not be elaborated here. Specifically, in this embodiment, the processor 1001 in the linear motor drive system will load the executable files corresponding to the processes of one or more application programs into the memory 1002 according to the following instructions, and the processor 1001 will run the application programs stored in the memory 1002 to achieve various functions as follows:
[0153] Add a prefix drive signal to the signal to be driven;
[0154] Obtain the working signal of the linear motor during driving the linear motor according to the prefix drive signal;
[0155] Determine the current parameters of the linear motor according to the working signal of the linear motor;
[0156] Drive the linear motor according to the current parameters of the linear motor and the signal to be driven.
[0157] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0158] For this reason, an embodiment of the present invention provides a computer-readable storage medium, which may include: Read Only Memory (ROM), Random Access Memory (RAM), a magnetic disk or an optical disc, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any of the linear motor driving methods provided by the embodiments of the present invention. For example, when the computer program is loaded by the processor, the following steps may be executed:
[0159] Add a prefix drive signal to the signal to be driven;
[0160] Obtain the working signal of the linear motor during driving the linear motor according to the prefix drive signal;
[0161] Determine the current parameters of the linear motor according to the working signal of the linear motor;
[0162] Drive the linear motor according to the current parameters of the linear motor and the signal to be driven.
[0163] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the detailed descriptions of other embodiments above, and details will not be repeated here.
[0164] The above has introduced in detail a linear motor driving method, device, electronic device, and computer-readable storage medium provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principles and implementation manners of the present invention. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A linear motor driving method, characterized in that: include: Add a prefix driving signal to the driving signal to be driven; acquiring a working signal of the linear motor during driving the linear motor according to the prefix driving signal; Determining current parameters of the linear motor according to the working signal of the linear motor; The linear motor is driven according to current parameters of the linear motor and the signal to be driven.
2. The linear motor driving method according to claim 1, wherein: The prefix driving signal includes at least one section of a detection signal, the frequency of the detection signal is greater than the frequency of the signal to be driven, and the amplitude of the detection signal is smaller than the amplitude of the signal to be driven.
3. The linear motor driving method according to claim 2, wherein: The prefix drive signal also includes a zero drive signal; The zero driving signal is located between the detection signal and the signal to be driven, and the amplitude of the zero driving signal is equal to 0.
4. The linear motor driving method according to claim 2, wherein: The duration of the detection signal is less than 50 ms and greater than 5 ms.
5. The linear motor driving method according to claim 1, wherein: The step of determining the current parameters of the linear motor according to the working signal of the linear motor comprises: Determining a current DC resistance of the linear motor according to a working signal of the linear motor; According to the current direct current resistance of the linear motor, the current parameters of the linear motor are determined.
6. The linear motor driving method according to claim 5, wherein: The step of determining the current parameters of the linear motor according to the current DC resistance of the linear motor comprises: Determining a current temperature of the linear motor according to a current DC resistance of the linear motor and a preset DC resistance temperature model; The current parameters of the linear motor are determined according to the current temperature of the linear motor and a preset motor parameter temperature model.
7. The linear motor driving method according to claim 1, wherein: The step of driving the linear motor according to the current parameters of the linear motor and the signal to be driven comprises: According to the signal to be driven, determining a target playback waveform set corresponding to the signal to be driven from a plurality of preset playback waveform sets; According to the current parameters of the linear motor, determining a target playback waveform matching the current parameters from the target playback waveform set, and driving the linear motor according to the target playback waveform; Each of the playback waveform sets includes a plurality of playback waveforms, and each of the playback waveforms corresponds to a parameter of the linear motor.
8. The linear motor driving method according to claim 1, wherein: The step of driving the linear motor according to the current parameters of the linear motor and the signal to be driven comprises: According to the current parameters of the linear motor, updating the playback bit rate of the linear motor; The linear motor is driven according to the updated playback bit rate of the linear motor and the signal to be driven.
9. The linear motor driving method according to claim 1, wherein: The step of driving the linear motor according to the current parameters of the linear motor and the signal to be driven comprises: updating a driving waveform generation model or a driving waveform compensation model of the linear motor according to current parameters of the linear motor; The signal to be driven is regenerated according to the updated driving waveform generation model, and the linear motor is driven according to the regenerated signal to be driven; or, the signal to be driven is compensated according to the updated driving waveform compensation model, and the linear motor is driven according to the compensated signal to be driven.
10. A linear motor driving device, characterized in that: include: A waveform processing module, the waveform processing module is used to add a prefix driving signal to the driving signal; a working signal detection module, the working signal detection module being used to obtain a working signal of the linear motor during driving the linear motor according to the prefix driving signal; a motor parameter determination module, the motor parameter determination module being used to determine current parameters of the linear motor according to a working signal of the linear motor; A motor driving module is used to drive the linear motor according to current parameters of the linear motor and the signal to be driven.
11. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the linear motor driving method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the linear motor driving method according to any one of claims 1 to 9 are implemented.