Motor control method, device, apparatus and computer readable storage medium

By sampling the target acceleration waveform and linearly adjusting the driving voltage, the problem that the required driving voltage exceeds the output peak of the motor hardware driving circuit is solved, and a more accurate motor vibration effect is achieved.

CN114006565BActive Publication Date: 2025-04-01GOERTEK INC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111277461.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-29
Publication Date
2025-04-01
Estimated Expiration
2041-10-29

AI Technical Summary

Technical Problem

When the required driving voltage exceeds the voltage peak output by the motor hardware driving circuit, the actual driving voltage is limited, resulting in a large difference between the actual vibration waveform and the expected vibration waveform, affecting the vibration effect of the motor.

Method used

By sampling the target acceleration waveform, the first driving voltage data is calculated and linearly adjusted according to the peak output voltage of the motor hardware driving circuit to obtain the second driving voltage data. The absolute value of the voltage value of this data is not greater than the peak output voltage and is used to drive the motor to vibrate.

Benefits of technology

The difference between the actual vibration waveform and the expected vibration waveform is reduced, ensuring that the actual vibration effect of the motor is smaller than the expected vibration effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114006565B_ABST
    Figure CN114006565B_ABST
Patent Text Reader

Abstract

The present invention discloses a motor control method, device, equipment and computer-readable storage medium, the method comprising: sampling a target acceleration waveform to obtain first acceleration data; calculating first drive voltage data according to the first acceleration data; adjusting the first drive voltage data according to the output voltage peak value of the hardware drive circuit of the motor to obtain second drive voltage data, and driving the motor to vibrate based on the second drive voltage data, wherein the absolute value of the voltage value in the second drive voltage data is not greater than the output voltage peak value. The present invention can avoid the large difference between the actual vibration waveform and the expected vibration waveform caused by the drive voltage required for the acceleration waveform exceeding the output voltage peak value of the hardware drive circuit, thereby ensuring that the actual vibration effect of the motor is less different from the expected vibration effect when the drive voltage required for the acceleration waveform exceeds the output voltage peak value of the hardware drive circuit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of motor technology, and in particular to a motor control method, device, equipment and computer-readable storage medium. Background Art

[0002] The application of motors in electronic equipment products is becoming more and more popular. For example, linear motors (Linear Resonant Actuator, LRA) have been widely used in various vibration occasions of consumer electronics, especially games and AR / VR products, due to their strong, rich, crisp vibration and low energy consumption. By constructing a variety of broadband vibration waveforms (acceleration waveforms), the motor can achieve very rich and realistic vibration feedback. However, when constructing the vibration waveform, game developers do not accurately know the specific physical characteristics and control algorithms of the motor, so it is difficult to ensure that the driving voltage amplitude required for the vibration waveform is always within the range of the peak value of the output voltage of the motor hardware drive circuit. When the required driving voltage exceeds the peak value of the output voltage of the hardware drive circuit, the actual driving voltage will be limited to the peak value, resulting in a large deviation from the expected driving voltage. The actual vibration fluctuations finally generated are quite different from the constructed vibration waveform, affecting the actual vibration effect. Summary of the invention

[0003] The main purpose of the present invention is to provide a motor control method, device, equipment and computer-readable storage medium, aiming to solve the technical problem that when the required driving voltage is limited by the voltage peak output of the motor hardware driving circuit, the actual vibration waveform generated is significantly different from the constructed vibration waveform, thereby causing the actual vibration effect of the motor to be significantly different from the expected vibration effect.

[0004] To achieve the above object, the present invention provides a motor control method, the method comprising the following steps:

[0005] Sampling the target acceleration waveform to obtain first acceleration data, wherein the first acceleration data includes a plurality of acceleration sampling values;

[0006] Calculating first driving voltage data according to the first acceleration data;

[0007] According to the output voltage peak value of the hardware driving circuit of the motor, the first driving voltage data is linearly adjusted to obtain the second driving voltage data, and the motor is driven to vibrate based on the second driving voltage data, wherein the absolute value of the voltage value in the second driving voltage data is not greater than the output voltage peak value.

[0008] Optionally, the step of linearly adjusting the first driving voltage data to obtain the second driving voltage data according to the output voltage peak value of the hardware driving circuit of the motor includes:

[0009] Dividing the output voltage peak value by the absolute peak value of each voltage value in the first driving voltage data to obtain an adjustment coefficient, and determining whether the adjustment coefficient is less than 1;

[0010] If the adjustment coefficient is greater than or equal to 1, the first driving voltage data is used as the second driving voltage data;

[0011] If the adjustment coefficient is less than 1, each voltage value in the first driving voltage data is multiplied by the adjustment coefficient to obtain each adjusted voltage value, and each adjusted voltage value is used as the second driving voltage data.

[0012] Optionally, the step of sampling the target acceleration waveform to obtain first acceleration data includes:

[0013] Sampling the target acceleration waveform according to a first duration to obtain first acceleration data, wherein the time span of the first acceleration data is the first duration;

[0014] After the step of driving the motor to vibrate based on the second driving voltage data, the method further includes:

[0015] Obtaining user feedback information, and extracting the motor vibration state carried in the user feedback information;

[0016] If the motor vibration state is a delayed state, the first time length is adjusted to obtain a second time length, so as to continue sampling the target acceleration waveform based on the second time length, wherein the second time length is shorter than the first time length.

[0017] Optionally, after the step of obtaining user feedback information and extracting the motor vibration state carried in the user feedback information, the method further includes:

[0018] If the motor vibration state is a distorted state, the first duration is adjusted to obtain a third duration, so as to continue sampling the target acceleration waveform based on the third duration, wherein the third duration is greater than the first duration.

[0019] Optionally, before the step of sampling the target acceleration waveform to obtain the first acceleration data, the method further includes:

[0020] Acquire the original acceleration waveform and the sweep frequency characteristic bandwidth of the motor;

[0021] After setting the filter parameters according to the frequency sweep characteristic bandwidth, the filter is used to filter the original acceleration waveform to obtain a target acceleration waveform.

[0022] Optionally, the step of calculating the first driving voltage data according to the first acceleration data includes:

[0023] Acquire motor parameters of the motor, wherein the motor parameters include vibrator mass, magnetic field strength, spring stiffness coefficient, damping coefficient, and coil DC resistance;

[0024] The first driving voltage data is calculated according to the first acceleration data and the motor parameters according to a conversion formula between the voltage and acceleration of the motor.

[0025] Optionally, the step of driving the motor to vibrate based on the second driving voltage data includes:

[0026] calculating second acceleration data based on the second driving voltage, and adjusting and outputting the target acceleration waveform according to the second acceleration data;

[0027] The third driving voltage data is calculated according to the second acceleration data, the third driving voltage data is input into the power amplifier of the motor, and the third driving voltage data is power-amplified by the power amplifier to drive the motor to vibrate.

[0028] To achieve the above object, the present invention further provides a motor control device, the device comprising:

[0029] A sampling module, used for sampling a target acceleration waveform to obtain first acceleration data, wherein the first acceleration data includes a plurality of acceleration sampling values;

[0030] A calculation module, configured to calculate first driving voltage data according to the first acceleration data;

[0031] An adjustment driving module is used to linearly adjust the first driving voltage data to obtain second driving voltage data according to the output voltage peak value of the hardware driving circuit of the motor, and drive the motor to vibrate based on the second driving voltage data, wherein the absolute value of the voltage value in the second driving voltage data is not greater than the output voltage peak value.

[0032] To achieve the above objectives, the present invention also provides a motor control device, which includes: a memory, a processor, and a motor control program stored in the memory and executable on the processor, and the motor control program implements the steps of the motor control method described above when executed by the processor.

[0033] In addition, to achieve the above-mentioned purpose, the present invention also proposes a computer-readable storage medium, on which a motor control program is stored, and when the motor control program is executed by a processor, the steps of the motor control method as described above are implemented.

[0034] In the present invention, acceleration data is obtained by sampling a target acceleration waveform, required driving voltage data is predicted based on the acceleration data, and the required driving voltage data is linearly adjusted so that the absolute value of the adjusted voltage value is not greater than the output voltage peak value of the hardware driving circuit, and the waveform of the driving voltage is consistent with the driving voltage waveform corresponding to the target acceleration. The motor is driven to vibrate according to the predicted driving voltage, so that when the driving voltage required by the target acceleration waveform is greater than the output voltage peak value of the hardware driving circuit, the voltage can be linearly adjusted to avoid the driving voltage required by the acceleration waveform exceeding the output voltage peak value of the hardware driving circuit. When the actual driving voltage is limited by the voltage peak value output by the hardware driving circuit, the difference between the actual vibration waveform and the expected vibration waveform can be reduced to ensure that the actual vibration effect of the motor is less different from the expected vibration effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A schematic diagram of the structure of the hardware operating environment involved in the embodiment of the present invention;

[0036] Figure 2 A schematic flow chart of a first embodiment of a motor control method according to the present invention;

[0037] Figure 3 FIG. 4 is a schematic diagram of functional modules of a preferred embodiment of a motor control device of the present invention.

[0038] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0039] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0040] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.

[0041] It should be noted that the motor control device of the embodiment of the present invention can be arranged in electronic devices such as smart phones, personal computers, game consoles, VR / AR devices, etc., and no specific limitation is made here.

[0042] like Figure 1As shown, the motor control device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0043] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation on the motor control device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0044] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a motor control program. The operating system is a program that manages and controls the hardware and software resources of the device and supports the operation of the motor control program and other software or programs. Figure 1 In the device shown, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used for establishing a communication connection with the server; and the processor 1001 can be used to call the motor control program stored in the memory 1005 and perform the following operations:

[0045] Sampling the target acceleration waveform to obtain first acceleration data, wherein the first acceleration data includes a plurality of acceleration sampling values;

[0046] Calculating first driving voltage data according to the first acceleration data;

[0047] According to the output voltage peak value of the hardware driving circuit of the motor, the first driving voltage data is linearly adjusted to obtain the second driving voltage data, and the motor is driven to vibrate based on the second driving voltage data, wherein the absolute value of the voltage value in the second driving voltage data is not greater than the output voltage peak value.

[0048] Furthermore, the step of linearly adjusting the first driving voltage data to obtain the second driving voltage data according to the output voltage peak value of the hardware driving circuit of the motor includes:

[0049] Dividing the output voltage peak value by the absolute peak value of each voltage value in the first driving voltage data to obtain an adjustment coefficient, and determining whether the adjustment coefficient is less than 1;

[0050] If the adjustment coefficient is greater than or equal to 1, the first driving voltage data is used as the second driving voltage data;

[0051] If the adjustment coefficient is less than 1, each voltage value in the first driving voltage data is multiplied by the adjustment coefficient to obtain each adjusted voltage value, and each adjusted voltage value is used as the second driving voltage data.

[0052] Furthermore, the step of sampling the target acceleration waveform to obtain the first acceleration data includes:

[0053] Sampling the target acceleration waveform according to a first duration to obtain first acceleration data, wherein the time span of the first acceleration data is the first duration;

[0054] After the step of driving the motor to vibrate based on the second driving voltage data, the method further includes:

[0055] Obtaining user feedback information, and extracting the motor vibration state carried in the user feedback information;

[0056] If the motor vibration state is a delayed state, the first time length is adjusted to obtain a second time length, so as to continue sampling the target acceleration waveform based on the second time length, wherein the second time length is shorter than the first time length.

[0057] Furthermore, after the step of obtaining user feedback information and extracting the motor vibration state carried in the user feedback information, the method further includes:

[0058] If the motor vibration state is a distorted state, the first duration is adjusted to obtain a third duration, so as to continue sampling the target acceleration waveform based on the third duration, wherein the third duration is greater than the first duration.

[0059] Furthermore, before the step of sampling the target acceleration waveform to obtain the first acceleration data, the method further includes:

[0060] Acquire the original acceleration waveform and the sweep frequency characteristic bandwidth of the motor;

[0061] After setting the filter parameters according to the frequency sweep characteristic bandwidth, the filter is used to filter the original acceleration waveform to obtain a target acceleration waveform.

[0062] Further, the step of calculating the first driving voltage data according to the first acceleration data includes:

[0063] Acquire motor parameters of the motor, wherein the motor parameters include vibrator mass, magnetic field strength, spring stiffness coefficient, damping coefficient, and coil DC resistance;

[0064] The first driving voltage data is calculated according to the first acceleration data and the motor parameters according to a conversion formula between the voltage and acceleration of the motor.

[0065] Further, the step of driving the motor to vibrate based on the second driving voltage data includes:

[0066] calculating second acceleration data based on the second driving voltage, and adjusting and outputting the target acceleration waveform according to the second acceleration data;

[0067] The third driving voltage data is calculated according to the second acceleration data, the third driving voltage data is input into the power amplifier of the motor, and the third driving voltage data is power-amplified by the power amplifier to drive the motor to vibrate.

[0068] Based on the above structure, various embodiments of a motor control method are proposed.

[0069] Reference Figure 2 , Figure 2 FIG. 4 is a flow chart of a first embodiment of a motor control method according to the present invention.

[0070] The embodiments of the present invention provide embodiments of the motor control method. It should be noted that although the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different from that here. In this embodiment, the execution subject of the motor control method may be a motor control device for driving the motor to vibrate, which may specifically include but is not limited to components such as a motor drive circuit and a filter. The motor control device can be provided in electronic devices such as smart phones, personal computers, game consoles, VR / AR devices, etc., which is not limited in this embodiment. The following omits the execution subject to explain each embodiment. In this embodiment, the motor control method includes:

[0071] Step S10, sampling the target acceleration waveform to obtain first acceleration data, wherein the first acceleration data includes a plurality of acceleration sampling values;

[0072] In this embodiment, the motor may be various vibration motors, such as a rotor motor and a linear motor. In order to achieve a certain vibration effect of the motor, a target acceleration waveform (i.e., a target vibration waveform) may be input, and the driving voltage may be predicted based on the target acceleration waveform. It is expected that the actual acceleration waveform achieved by driving the motor to vibrate through the driving voltage may be as consistent as possible with the target acceleration waveform, thereby achieving the expected vibration effect. In a specific application scenario, the target acceleration waveform may be a broadband signal customized according to the game scenario, or it may be the sound effect actually output by the game application.

[0073] In order to avoid the driving voltage required to achieve the target acceleration waveform exceeding the output voltage peak range of the hardware driving circuit, in this embodiment, the driving voltage corresponding to the target acceleration waveform is adjusted according to the output voltage peak of the hardware driving circuit, and the acceleration corresponding to the target acceleration waveform is adjusted by adjusting the driving voltage, so that the driving voltage required for the adjusted acceleration does not exceed the output voltage peak of the hardware driving circuit, thereby avoiding the actual acceleration waveform of the motor being too different from the target acceleration waveform due to being limited by the output voltage peak of the hardware driving circuit.

[0074] Specifically, the input target acceleration waveform is sampled. When sampling, one frame of the target acceleration waveform may be sampled each time, or multiple frames of the target acceleration waveform may be sampled simultaneously, which is not limited here. Taking sampling of one frame of the target acceleration waveform as an example, one frame of acceleration data is obtained for each sampling, and the sampled frame of acceleration data is processed to obtain one frame of driving voltage data, and the motor is driven to vibrate according to the frame of driving voltage data. Among them, the sampling frequency can be set in advance as needed, for example, set to 48kHz; in the process of sampling the target acceleration waveform, the sampling frequency can also be dynamically adjusted as needed, that is, the sampling frequency of the first acceleration data of the previous frame may be different from the sampling frequency of the first acceleration data of the next frame; the time span of a single frame of acceleration data can be set in advance as needed, for example, set to 1ms, then when the sampling frequency is 48kHz, a frame of first acceleration data includes 48 acceleration sampling values; a frame of first acceleration data includes multiple acceleration sampling values, and adjusting the time span and sampling frequency of a single frame of acceleration data can change the number of acceleration sampling values ​​included in a frame of first acceleration data; in the process of sampling the target acceleration waveform, the time span can also be dynamically adjusted as needed, that is, the time span of the first acceleration data of the previous frame may be different from the time span of the first acceleration data of the next frame.

[0075] Since the processing method for each frame of acceleration data obtained by sampling is the same, one frame of acceleration data is taken as an example for explanation below, and is called the first acceleration data for distinction.

[0076] Step S20, calculating and obtaining first driving voltage data according to the first acceleration data;

[0077] For the first acceleration data obtained by sampling, the driving voltage data (hereinafter referred to as the first driving voltage data for distinction) is first calculated based on the first acceleration data. It can be understood that the first driving voltage data is the voltage data calculated so that the actual acceleration waveform of the motor vibration can be consistent with the acceleration waveform corresponding to the first acceleration data. In a specific implementation, according to the transfer characteristics between voltage and acceleration, a conversion formula between voltage and acceleration can be pre-set, and each acceleration sampling value in the first acceleration data is brought into the conversion formula to calculate the driving voltage value corresponding to each acceleration sampling value, and each driving voltage value is the calculated first driving voltage data. Among them, the conversion formula between voltage and acceleration can be obtained by using a bilinear transformation method, a unit impulse response invariant method or an Euler discrete method energy conversion method, and is obtained according to the transfer characteristics between the voltage and acceleration of the motor. In this embodiment, the conversion formula is not limited.

[0078] Step S30, according to the output voltage peak value of the hardware driving circuit of the motor, linearly adjust the first driving voltage data to obtain second driving voltage data, and drive the motor to vibrate based on the second driving voltage data, wherein the absolute value of the voltage value in the second driving voltage data is not greater than the output voltage peak value.

[0079] After the first driving voltage data is calculated, the first driving voltage data can be linearly adjusted according to the output voltage peak value of the hardware driving circuit of the motor to obtain the second driving voltage data, and the absolute value of the voltage value in the adjusted second driving voltage data is not greater than the output voltage peak value. That is, when the absolute value of the voltage value in the first driving voltage data is greater than the output voltage peak value, the first driving voltage data needs to be adjusted so that the absolute value of the voltage value in the adjusted second driving voltage data is not greater than the output voltage peak value. In this embodiment, the manner of linearly adjusting the first driving voltage data is not limited. For example, in one embodiment, the voltage value in the first driving voltage data can be scaled in the same proportion so that the voltage value with the largest absolute value in the first driving voltage data is not greater than the output voltage peak value after scaling, and then retaining its original sign, thereby obtaining the second driving voltage data. Since the second driving voltage data is obtained by linearly adjusting the driving voltage corresponding to the target acceleration waveform, the acceleration waveform corresponding to the second driving voltage data is not much different from the target acceleration waveform. When the motor is driven to vibrate based on the second driving voltage data, it can be ensured that the actual vibration effect is less different from the expected vibration effect.

[0080] Furthermore, in one embodiment, the refinement of step S30 further includes:

[0081] Step S31, calculating second acceleration data based on the second driving voltage, and adjusting and outputting the target acceleration waveform according to the second acceleration data;

[0082] Step S32, calculating third driving voltage data according to the second acceleration data, inputting the third driving voltage data into the power amplifier of the motor, and amplifying the third driving voltage data by the power amplifier to drive the motor to vibrate.

[0083] After the second driving voltage data is adjusted, the acceleration data (hereinafter referred to as the second acceleration data for distinction) can be calculated based on the second driving voltage data. It can be understood that the second driving voltage data is voltage data that can make the actual acceleration waveform of the motor vibration consistent with the acceleration waveform corresponding to the second acceleration data; since the second driving voltage data is obtained by linearly adjusting the first driving voltage data, there will be a certain difference between the acceleration waveform corresponding to the second acceleration data and the acceleration waveform corresponding to the first acceleration data (a section of the target acceleration waveform), that is, the actual acceleration waveform of the motor vibration will be different from the expected acceleration waveform, but since the absolute value of the voltage value of the second driving voltage data is not greater than the output voltage peak value, and it is obtained by linearly adjusting the output voltage peak value based on the first driving voltage data, it will not occur that the driving voltage required for the acceleration waveform exceeds the output voltage peak value of the hardware driving circuit, resulting in a large difference between the actual acceleration waveform and the expected acceleration waveform, and therefore, there will be no situation where the actual vibration effect of the motor is too different from the expected vibration effect.

[0084] In a specific implementation, a conversion formula between acceleration and voltage can be pre-set, and each driving voltage value in the second driving voltage data is brought into the conversion formula to calculate the acceleration value corresponding to each voltage value, and each acceleration value is the calculated second acceleration data. Among them, the conversion formula between acceleration and voltage can be obtained by using a bilinear transformation method, a unit impulse response invariance method, or an Euler discrete method energy transformation method, according to the transfer characteristics between the voltage and acceleration of the motor. In this embodiment, the conversion formula is not limited.

[0085] After the second acceleration data is calculated, in order to make the actual acceleration waveform of the motor consistent with the acceleration waveform corresponding to the second acceleration data, the target acceleration waveform is adjusted based on the calculated second acceleration data, and the expected target acceleration waveform is adjusted to the actual acceleration waveform and output for the user to consult when he wants to understand the acceleration waveform of the motor when it actually vibrates, wherein the actual acceleration waveform output can be a waveform, or it can be the acceleration data or waveform parameter corresponding to the actual acceleration waveform. Further, the driving voltage data (hereinafter referred to as the third driving voltage data for distinction) can be calculated again according to the second acceleration data. It can be understood that the third driving voltage data is the calculated voltage data that can make the actual acceleration waveform of the motor vibrate consistent with the acceleration waveform corresponding to the second acceleration data. In a specific embodiment, the method for calculating the third driving voltage data according to the second acceleration data can refer to the method for calculating the first driving voltage data according to the first acceleration data, and will not be repeated here.

[0086] After obtaining the third driving voltage data, the third driving voltage data can be input into a power amplifier in the motor hardware driving circuit, and the third driving voltage data can be power amplified by the power amplifier, that is, the power amplifier converts each voltage value in the third driving voltage data into an actual voltage to drive the motor to vibrate. The power amplifier can use an amplifier that matches the power of the input signal, for example, a common class A, class B, class AB or class D driver can be used, and the input signal can be an analog signal or a customized digital signal.

[0087] In this embodiment, acceleration data is obtained by sampling the target acceleration waveform, required driving voltage data is predicted based on the acceleration data, and the required driving voltage data is linearly adjusted so that the absolute value of the adjusted voltage value is not greater than the output voltage peak value of the hardware driving circuit. The motor is then driven to vibrate based on the adjusted voltage data, so that when the driving voltage required for the target acceleration waveform is greater than the output voltage peak value of the hardware driving circuit, the voltage can be linearly adjusted to avoid a large difference between the actual vibration waveform and the expected vibration waveform due to the driving voltage required for the acceleration waveform exceeding the output voltage peak value of the hardware driving circuit, thereby ensuring that the actual vibration effect of the motor is less different from the expected vibration effect.

[0088] Furthermore, in one embodiment, before step S10, the method further includes:

[0089] Step S50, obtaining the original acceleration waveform and the sweep frequency characteristic bandwidth of the motor;

[0090] Step S60, after setting the filter parameters according to the frequency sweep characteristic bandwidth, the filter is used to filter the original acceleration waveform to obtain a target acceleration waveform.

[0091] When the frequency of the input acceleration waveform exceeds the sweep frequency characteristic bandwidth of the motor, the input original acceleration waveform can be filtered, and the filtered acceleration waveform is used as the target acceleration waveform, and then subsequent sampling operations are performed on the target acceleration waveform.

[0092] Specifically, the original acceleration waveform and the sweep frequency characteristic bandwidth of the motor can be obtained first. The sweep frequency characteristic of the motor refers to the frequency domain response characteristic of the acceleration amplitude under a unit driving voltage. The parameters of the filter are set according to the sweep frequency characteristic bandwidth, and the original acceleration waveform is filtered according to the filter with the set parameters, and the acceleration waveform obtained by filtering is used as the target acceleration waveform. By setting the parameters of the filter according to the sweep frequency characteristic bandwidth, the frequency of the target acceleration waveform obtained by filtering can be within the sweep frequency characteristic bandwidth.

[0093] Specifically, in one embodiment, the upper limit frequency of the sweep frequency characteristic bandwidth can be set as the cutoff frequency of the low-pass filter, and the lower limit frequency of the sweep frequency characteristic bandwidth can be set as the cutoff frequency of the high-pass filter, and the low-pass filter and the high-pass filter are used to perform low-pass filtering and high-pass filtering on the original acceleration waveform in sequence to obtain the target acceleration waveform. For example, the sweep frequency characteristic bandwidth is [f aL , f aH ], the cutoff frequency of the low-pass filter can be set to f aH , set the cutoff frequency of the high-pass filter to f aL .

[0094] Alternatively, in another embodiment, the upper limit frequency of the sweep frequency characteristic bandwidth can be set as the upper limit cutoff frequency of the bandpass filter, and the lower limit frequency of the sweep frequency characteristic bandwidth can be set as the lower limit cutoff frequency of the bandpass filter, and then the bandpass filter is used to perform bandpass filtering on the original acceleration waveform to obtain the target acceleration waveform. For example, the sweep frequency characteristic bandwidth is [f aL , f aH ], the bandwidth of the bandpass filter can be set to [f aL , f aH ].

[0095] Further, based on the above first embodiment, a second embodiment of the motor control method of the present invention is proposed. In this embodiment, the step S30 includes:

[0096] Step S301, dividing the output voltage peak value by the absolute peak value of each voltage value in the first driving voltage data to obtain an adjustment coefficient, and determining whether the adjustment coefficient is less than 1;

[0097] In order to achieve the situation where the driving voltage required for the acceleration waveform avoids exceeding the output voltage peak value of the hardware driving circuit, while ensuring that the difference between the actual acceleration waveform of the motor and the target acceleration waveform is relatively small, in this embodiment, the time span of a single frame of acceleration data can be set so that the sampled first acceleration data includes multiple acceleration sampling values, so that the first driving voltage data includes multiple voltage values, and each voltage value of the first driving voltage data is linearly adjusted so that the adjusted second driving voltage data is linearly related to the first driving voltage data, so that the actual acceleration waveform finally achieved by driving the motor vibration based on the second driving voltage data is relatively small in difference from the target acceleration waveform.

[0098] In one embodiment, the linear adjustment method can be to first extract the maximum value of the absolute values ​​of each voltage value in the first driving voltage data, that is, the absolute peak value. For example, the first driving voltage data includes n voltage values ​​u1(1), u1(2), ... u1(n), and the absolute values ​​are taken to obtain |u1(1)|, |u1(2)|, ... |u1(n)|, and then the maximum value is detected by the sequential comparison method, that is, comparing |u1(1)| and |u1(2)|, and taking the larger value as u1(1)|. 1max ; Compare u 1max and |u1(3)|, take the larger value as the new u 1max ; and so on, until we compare u 1max and |u1(n)|, take the larger value as the final u 1max , that is, the absolute peak value. After the absolute peak value is obtained, the output voltage peak value of the hardware driving circuit is divided by the absolute peak value, and the result is used as the adjustment coefficient.

[0099] After obtaining the adjustment coefficient, it can be determined whether the adjustment coefficient is less than 1, which is used to limit the voltage peak value actually output by the drive circuit to ensure the safety of the motor and its drive circuit.

[0100] Step S302: if the adjustment coefficient is greater than or equal to 1, the first driving voltage data is used as the second driving voltage data;

[0101] When the adjustment coefficient is greater than or equal to 1, it means that the absolute values ​​of each voltage value in the first drive voltage data do not exceed the output voltage peak value. At this time, the drive voltage required by the motor will not exceed the output voltage peak value of the hardware drive circuit. The first drive voltage data can be directly used as the second drive voltage data required for the target acceleration. That is, there is no need to adjust the first drive voltage data so that the actual acceleration waveform of the motor is consistent with the target acceleration waveform.

[0102] Step S303: if the adjustment coefficient is less than 1, then multiply each voltage value in the first driving voltage data by the adjustment coefficient to obtain each adjusted voltage value, and use each adjusted voltage value as the second driving voltage data.

[0103] When the adjustment coefficient is less than 1, it means that the absolute value of at least one voltage value in the first drive voltage data exceeds the output voltage peak value. At this time, the voltage value needs to be adjusted. The voltage values ​​in the first drive voltage data can be multiplied by the adjustment coefficient to obtain the adjusted voltage values, and the adjusted voltage values ​​are used as the second drive voltage data. It can be understood that since the adjustment coefficient is obtained by dividing the output voltage peak value of the hardware drive circuit by the absolute peak value, the absolute values ​​of the voltage values ​​in the adjusted second drive voltage data are not greater than the output voltage peak value, and while ensuring that the second drive voltage data is linearly related to the first drive voltage data, the difference between the second drive voltage data and the first drive voltage data is small, so that the actual acceleration waveform achieved by driving the motor vibration based on the second drive voltage data is relatively small.

[0104] Furthermore, in one embodiment, step S10 includes:

[0105] Step S101, sampling a target acceleration waveform according to a first duration to obtain first acceleration data, wherein the time span of the first acceleration data is the first duration;

[0106] In this embodiment, when sampling the target acceleration waveform, sampling can be performed according to the time span of the currently set single-frame acceleration data (hereinafter referred to as the first time span for distinction), that is, the time span of the sampled first acceleration data is the first time span.

[0107] After step S40, the method further includes:

[0108] Step A10, obtaining user feedback information, and extracting the motor vibration state carried in the user feedback information;

[0109] An input device for receiving user feedback information, such as a display screen or a control handle of a game console, can be set up. The user can provide feedback on the vibration state of the motor, for example, whether the vibration state of the motor is a delayed state or a distorted state. Among them, the delayed state means that there is a delay between the vibration of the motor and the user's operation. For example, an operation of the user will trigger a vibration effect of the motor, but the motor will not produce the vibration effect until the user has operated for a period of time. This state is the delayed state. The distorted state means that there is a large difference between the vibration of the motor and the expected vibration effect.

[0110] In the process of driving the motor to vibrate, user feedback information is obtained from the input device, and the user feedback information carries the motor vibration state. Specifically, the motor vibration state may be a delayed state or a non-delayed state.

[0111] Step A20, if the motor vibration state is a delayed state, the first time length is adjusted to obtain a second time length, so as to continue sampling the target acceleration waveform based on the second time length, wherein the second time length is smaller than the first time length.

[0112] After the motor vibration state is extracted, it is determined whether the motor vibration state is a delayed state. If so, the first duration can be adjusted to obtain a second duration that is smaller than the first duration. When the target acceleration waveform is sampled for the next time, the second duration is sampled, that is, the time span of the first acceleration data obtained by the next sampling is the second duration. It should be noted that since the motor vibration is driven based on the second driving voltage data after the sampled first acceleration data is processed to obtain the second driving voltage data, when the motor vibration state is a delayed state, it means that the first duration is too long, resulting in a delay in the motor vibration perceived by the user. At this time, the time span of the single acceleration data is shortened for subsequent sampling, which can make the delay in the motor vibration perceived by the user shorter or no delay in the motor vibration is perceived. Specifically, in one embodiment, the first duration may be adjusted to obtain the second duration by subtracting a preset value from the first duration, that is, taking the preset value as a step, and each time when it is determined that the motor vibration state is a delayed state according to user feedback information, the time span of the currently set single-frame acceleration data is subtracted from the preset value to shorten the time span; further, a minimum threshold may be set, and when the first duration minus the preset value is less than the minimum threshold, the first duration is not adjusted, and the first duration is still maintained to ensure that there are at least multiple acceleration sampling values ​​in the sampled first acceleration data.

[0113] Furthermore, in one embodiment, after step A10, the method further includes:

[0114] Step A30: If the motor vibration state is a distorted state, the first time length is adjusted to obtain a third time length, so as to continue sampling the target acceleration waveform based on the third time length, wherein the third time length is greater than the first time length.

[0115] After extracting the motor vibration state, determine whether the motor vibration state is a distorted state. If so, the first duration can be adjusted to obtain a third duration that is longer than the first duration. When the target acceleration waveform is sampled for the next time, the third duration is used for sampling, that is, the time span of the first acceleration data obtained by the next sampling is the third duration. It should be noted that when the time span of the acceleration data sampled once is short, the adjusted second drive voltage data and the first drive voltage data may not maintain a strong linear relationship due to the small number of acceleration sampling values ​​in a frame, resulting in the motor vibration effect being distorted for the user. Therefore, when the motor vibration state is a distorted state, the time span of the single frame acceleration data is increased and subsequent sampling is performed, so that the motor vibration distortion perceived by the user is not obvious or the motor vibration distortion is not perceived. Specifically, in one embodiment, the first duration may be adjusted to obtain the third duration by adding a preset value to the first duration, that is, taking the preset value as a step, and each time when it is determined that the motor vibration state is a distorted state based on user feedback information, the time span of the currently set single-frame acceleration data is added to the preset value to increase the time span; further, a maximum threshold may be set, and when the first duration plus the preset value is greater than the maximum threshold, the first duration is not adjusted, and the first duration is still maintained to ensure that the motor vibration delay is not serious due to the single-frame acceleration time span being too long.

[0116] It can be understood that the fewer the number of frames in a single sampling, the more timely the adjustment of sampling parameters such as time span according to user feedback information. When only one frame of acceleration waveform is sampled each time, after obtaining the user's feedback information, the next frame of acceleration waveform can be sampled using the adjusted sampling parameters according to the user's feedback information, thereby improving the response timeliness of the user feedback information.

[0117] Further, based on the above-mentioned first and / or second embodiments, a third embodiment of the motor control method of the present invention is proposed. In this embodiment, the step of calculating the first driving voltage data according to the first acceleration data in step S20 includes:

[0118] Step S201, obtaining motor parameters of the motor, wherein the motor parameters include vibrator mass, magnetic field strength, spring stiffness coefficient, damping coefficient, and coil DC resistance;

[0119] Step S202: Calculate first driving voltage data according to the first acceleration data and the motor parameters according to the conversion formula between the motor voltage and acceleration.

[0120] In this embodiment, a conversion formula between voltage and acceleration can be set according to the motor parameters of the motor, the motor parameters of the motor can be obtained, and the motor parameters and the first acceleration data can be brought into the conversion formula for calculation to obtain the first driving voltage data. The motor parameters may include vibrator mass, magnetic field strength, spring stiffness coefficient, damping coefficient, and coil DC resistance.

[0121] Specifically, in one implementation, the first driving voltage data may be calculated according to the following conversion formula.

[0122]

[0123]

[0124]

[0125]

[0126]

[0127]

[0128]

[0129]

[0130] Wherein, u1(n) represents the nth driving voltage value in the first driving voltage data, a1(n) represents the nth acceleration sampling value in the first acceleration data. m is the vibrator mass, Bl is the magnetic field strength, k is the spring stiffness coefficient, r is the damping coefficient, Re is the coil DC resistance, and T is the sampling period. aL It is the lower limit frequency of the motor sweep characteristic bandwidth. When n is 1, u1(n-1), u1(n-2), a1(n-1) and a1(n-2) are 0. When n is 2, u1(n-2) and a1(n-2) are 0.

[0131] After calculating the first driving voltage data, the first driving voltage data is linearly adjusted based on the voltage peak value output by the hardware driving circuit to obtain the second driving voltage data. Then, when driving the motor to vibrate based on the second driving voltage data, the second acceleration data is first calculated based on the second driving voltage data, and then the third driving voltage data is calculated based on the second acceleration data. The third driving voltage data is input into the power amplifier in the hardware driving circuit, and after power amplification of the third driving voltage data, the motor is driven to vibrate.

[0132] In one implementation, the second acceleration data may be calculated according to the following conversion formula.

[0133]

[0134] b0=4K3

[0135] b1=-8K3

[0136] b2=4K3

[0137]

[0138]

[0139]

[0140]

[0141] Wherein, a2(n) represents the nth acceleration value in the second acceleration data, i2(n) represents the nth voltage value in the second driving voltage data. m is the vibrator mass, Bl is the magnetic field intensity, k is the spring stiffness coefficient, r is the damping coefficient, Re is the coil DC resistance, and T is the sampling period. aL It is the lower limit frequency of the motor sweep characteristic bandwidth. When n is 1, a2(n-1), a2(n-2), i2(n-1) and i2(n-2) are 0. When n is 2, a2(n-2) and i2(n-2) are 0.

[0142] In one implementation, the third driving voltage data may be calculated according to the following conversion formula.

[0143]

[0144]

[0145]

[0146]

[0147]

[0148]

[0149]

[0150]

[0151] Wherein, a2(n) represents the nth acceleration value in the second acceleration data, u3(n) represents the nth driving voltage value in the third driving voltage data. m is the vibrator mass, Bl is the magnetic field strength, k is the spring stiffness coefficient, r is the damping coefficient, Re is the coil DC resistance, and T is the sampling period. aL It is the lower limit frequency of the motor sweep characteristic bandwidth. When n is 1, a2(n-1), a2(n-2), u3(n-1) and u3(n-2) are 0. When n is 2, a2(n-2) and u3(n-2) are 0.

[0152] In addition, the present invention also provides a motor control device, referring to Figure 3 , the device comprises:

[0153] A sampling module 10, configured to sample a target acceleration waveform to obtain first acceleration data, wherein the first acceleration data includes a plurality of acceleration sampling values;

[0154] A calculation module 20, configured to calculate first driving voltage data according to the first acceleration data;

[0155] The adjustment drive module 30 is used to linearly adjust the first drive voltage data to obtain second drive voltage data according to the output voltage peak value of the hardware drive circuit of the motor, and drive the motor to vibrate based on the second drive voltage data, wherein the absolute value of the voltage value in the second drive voltage data is not greater than the output voltage peak value.

[0156] Furthermore, the adjustment driving module 30 includes:

[0157] a first calculation unit, configured to obtain an adjustment coefficient by dividing the output voltage peak value by the absolute peak value of each voltage value in the first driving voltage data, and determine whether the adjustment coefficient is less than 1;

[0158] a determining unit, configured to use the first driving voltage data as second driving voltage data if the adjustment coefficient is greater than or equal to 1;

[0159] The second calculation unit is used for, if the adjustment coefficient is less than 1, multiplying each voltage value in the first driving voltage data by the adjustment coefficient to obtain each adjusted voltage value, and using each adjusted voltage value as the second driving voltage data.

[0160] Furthermore, the sampling module 10 is further used to sample the target acceleration waveform according to a first duration to obtain first acceleration data, wherein the time span of the first acceleration data is the first duration;

[0161] The device also includes:

[0162] A first acquisition module, used to acquire user feedback information and extract the motor vibration state carried in the user feedback information;

[0163] The adjustment drive module 30 is also used to adjust the first duration to obtain a second duration if the motor vibration state is a delayed state, so as to continue sampling the target acceleration waveform based on the second duration, wherein the second duration is smaller than the first duration.

[0164] Furthermore, the adjustment drive module 30 is also used to adjust the first duration to obtain a third duration if the motor vibration state is a distorted state, so as to continue sampling the target acceleration waveform based on the third duration, wherein the third duration is greater than the first duration.

[0165] Furthermore, the device also includes:

[0166] A second acquisition module is used to acquire the original acceleration waveform and the sweep frequency characteristic bandwidth of the motor;

[0167] A filtering module is used to set the parameters of the filter according to the bandwidth of the frequency sweep characteristic and then use the filter to filter the original acceleration waveform to obtain the target acceleration waveform.

[0168] Furthermore, the calculation module 20 includes:

[0169] An acquisition unit, used for acquiring motor parameters of the motor, wherein the motor parameters include vibrator mass, magnetic field strength, spring stiffness coefficient, damping coefficient, and coil DC resistance;

[0170] The third calculation unit is used to calculate the first driving voltage data according to the first acceleration data and the motor parameters according to the conversion formula between the voltage and acceleration of the motor.

[0171] Furthermore, the adjustment driving module 30 is also used for:

[0172] calculating second acceleration data based on the second driving voltage, and adjusting and outputting the target acceleration waveform according to the second acceleration data;

[0173] The third driving voltage data is calculated according to the second acceleration data, the third driving voltage data is input into the power amplifier of the motor, and the third driving voltage data is power-amplified by the power amplifier to drive the motor to vibrate.

[0174] The extended contents of the specific implementation of the motor control device of the present invention are basically the same as the above-mentioned embodiments of the motor control method, and will not be elaborated here.

[0175] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which a motor control program is stored. When the motor control program is executed by a processor, the steps of the motor control method described below are implemented.

[0176] The various embodiments of the motor control device and the computer-readable storage medium of the present invention may refer to the various embodiments of the motor control method of the present invention, and will not be described in detail here.

[0177] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0178] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0179] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0180] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A motor control method, characterized in that: The method comprises the following steps: Sampling the target acceleration waveform to obtain first acceleration data, wherein the first acceleration data includes a plurality of acceleration sampling values; Calculating first driving voltage data according to the first acceleration data; According to the output voltage peak value of the hardware driving circuit of the motor, linearly adjust the first driving voltage data to obtain second driving voltage data, and drive the motor to vibrate based on the second driving voltage data, wherein the absolute value of the voltage value in the second driving voltage data is not greater than the output voltage peak value; The step of sampling the target acceleration waveform to obtain first acceleration data comprises: Sampling the target acceleration waveform according to a first duration to obtain first acceleration data, wherein the time span of the first acceleration data is the first duration; After the step of driving the motor to vibrate based on the second driving voltage data, the method further includes: Obtaining user feedback information, and extracting the motor vibration state carried in the user feedback information; If the motor vibration state is a delayed state, adjusting the first duration to obtain a second duration, so as to continue sampling the target acceleration waveform based on the second duration, wherein the second duration is shorter than the first duration; If the motor vibration state is a distorted state, the first duration is adjusted to obtain a third duration, so as to continue sampling the target acceleration waveform based on the third duration, wherein the third duration is greater than the first duration.

2. The motor control method according to claim 1, wherein: The step of linearly adjusting the first driving voltage data to obtain the second driving voltage data according to the output voltage peak value of the hardware driving circuit of the motor comprises: Dividing the output voltage peak value by the absolute peak value of each voltage value in the first driving voltage data to obtain an adjustment coefficient, and determining whether the adjustment coefficient is less than 1; If the adjustment coefficient is greater than or equal to 1, the first driving voltage data is used as the second driving voltage data; If the adjustment coefficient is less than 1, each voltage value in the first driving voltage data is multiplied by the adjustment coefficient to obtain each adjusted voltage value, and each adjusted voltage value is used as the second driving voltage data.

3. The motor control method according to claim 1, wherein: Before the step of sampling the target acceleration waveform to obtain the first acceleration data, the method further includes: Acquire the original acceleration waveform and the sweep frequency characteristic bandwidth of the motor; After setting the filter parameters according to the frequency sweep characteristic bandwidth, the filter is used to filter the original acceleration waveform to obtain a target acceleration waveform.

4. The motor control method according to claim 1, wherein: The step of calculating the first driving voltage data according to the first acceleration data comprises: Acquire motor parameters of the motor, wherein the motor parameters include vibrator mass, magnetic field strength, spring stiffness coefficient, damping coefficient, and coil DC resistance; The first driving voltage data is calculated according to the first acceleration data and the motor parameters according to a conversion formula between the voltage and acceleration of the motor.

5. The motor control method according to claim 1, wherein: The step of driving the motor to vibrate based on the second driving voltage data comprises: calculating second acceleration data based on the second driving voltage, and adjusting and outputting the target acceleration waveform according to the second acceleration data; The third driving voltage data is calculated according to the second acceleration data, the third driving voltage data is input into the power amplifier of the motor, and the third driving voltage data is power-amplified by the power amplifier to drive the motor to vibrate.

6. A motor control device, characterized in that: The device comprises: A sampling module, used for sampling the target acceleration waveform to obtain first acceleration data, wherein the first acceleration data includes a plurality of acceleration sampling values; the sampling module is also used for sampling the target acceleration waveform according to a first duration to obtain first acceleration data, wherein the time span of the first acceleration data is the first duration; A first acquisition module, used to acquire user feedback information and extract the motor vibration state carried in the user feedback information; A calculation module, configured to calculate first driving voltage data according to the first acceleration data; An adjustment driving module is used to linearly adjust the first driving voltage data to obtain second driving voltage data according to the output voltage peak value of the hardware driving circuit of the motor, and drive the motor to vibrate based on the second driving voltage data, wherein the absolute value of the voltage value in the second driving voltage data is not greater than the output voltage peak value; the adjustment driving module is also used to adjust the first duration to obtain a second duration if the vibration state of the motor is a delayed state, so as to continue sampling the target acceleration waveform based on the second duration, wherein the second duration is less than the first duration; if the vibration state of the motor is a distorted state, adjust the first duration to obtain a third duration, so as to continue sampling the target acceleration waveform based on the third duration, wherein the third duration is greater than the first duration.

7. A motor control device, characterized in that: The motor control device comprises: a memory, a processor, and a motor control program stored in the memory and executable on the processor, wherein the motor control program implements the steps of the motor control method according to any one of claims 1 to 5 when executed by the processor.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a motor control program, and when the motor control program is executed by a processor, the steps of the motor control method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Haptic effect realization method and device, and computer readable storage medium

    CN111694437A