US-20260128697-A1 - MOTOR SPEED CONTROL METHOD, APPARATUS, DEVICE, AND STORAGE MEDIUM
Abstract
The present application provides a motor speed control method, apparatus, device, and storage medium. The method includes: acquiring a current speed of a target motor and a predetermined desired speed; calculating a target driving voltage value of the target motor according to a speed difference between the current speed and the desired speed; and generating a corresponding control instruction and transmitting the control instruction to a corresponding motor driving module. The control instruction instructs the motor driving module to output a corresponding driving voltage to control the speed of the target motor. The current speed of the target motor is monitored in real time and the speed error is calculated in real-time, realizing real-time closed-loop control of the target motor, ensuring that the target motor can always work in a better performance range, thereby effectively improving the haptic feedback effect and enhancing the user experience.
Inventors
- Xin Guo
- Yajun ZHENG
Assignees
- AAC Acoustic Technologies (Shanghai) Co., Ltd.
Dates
- Publication Date
- 20260507
- Application Date
- 20250909
Claims (15)
- 1 . A motor speed control method, comprising: acquiring a current speed of a target motor and a predetermined desired speed; calculating a target driving voltage value of the target motor according to a speed difference between the current speed and the desired speed; and generating a corresponding control instruction according to the target driving voltage value and transmitting the control instruction to a corresponding motor driving module, wherein the control instruction is configured to instruct the motor driving module to output a corresponding driving voltage to the target motor to control the speed of the target motor.
- 2 . The motor speed control method of claim 1 , wherein before the step of acquiring the current speed of the target motor and the predetermined desired speed, the method further comprises: establishing a corresponding motor mathematical model according to characteristic parameters of the target motor; and inputting a predetermined desired voltage value into the motor mathematical model to obtain the desired speed.
- 3 . The motor speed control method of claim 1 , wherein before the step of acquiring the current speed of the target motor and the predetermined desired speed, the method further comprises: acquiring, by a preset speed acquisition module, real-time speeds of the target motor for a plurality of times within a predetermined duration; and determining the current speed of the target motor according to the plurality of the real-time speeds.
- 4 . The motor speed control method of claim 1 , wherein the step of calculating the target driving voltage value of the target motor according to the speed difference between the current speed and the desired speed comprises: acquiring a first historical speed difference value corresponding to a first historical moment and a second historical speed difference value corresponding to a second historical moment; wherein the first historical moment differs from the current moment by a unit length of time, and the second historical moment differs from the first historical moment by the unit length of time; performing a proportional integral differentiation calculation on a speed difference between the current speed and the desired speed, the first historical speed difference and the second historical speed difference to obtain an incremental voltage value; and summing the historical driving voltage value corresponding to the first historical moment and the incremental voltage value to obtain the target driving voltage value of the target motor.
- 5 . The motor speed control method of claim 4 , wherein the step of performing the proportional integral differentiation calculation on the speed difference between the current speed and the desired speed, the first historical speed difference and the second historical speed difference to obtain the incremental voltage value comprises: performing a discrete proportional integral differentiation calculation on the speed difference between the current speed and the desired speed, the first historical speed difference and the second historical speed difference according to a discrete proportional integral differentiation formula to obtain the incremental voltage value; wherein the discrete proportional integral differentiation formula is Δu(k)=k p (e(k)−e(k−1))+k i e(k)+k d (e(k)−2e(k−1)+e(k−2)), Δu(k) is the incremental voltage value, k p is a proportional coefficient, k i is an integral coefficient, k d is a differentiation coefficient, e(k) is the speed error; e(k−1) is the first historical speed difference, and e(k−2) is the second historical speed difference.
- 6 . The motor speed control method of claim 1 , wherein before the step of calculating the target driving voltage value of the target motor according to the speed difference between the current speed and the desired speed, the method further comprises: comparing the speed difference between the current speed and the desired speed with a predetermined error allowable range; and calculating the target driving voltage value of the target motor according to the speed difference between the current speed and the desired speed when the speed difference does not satisfy the error allowable range.
- 7 . The motor speed control method of claim 1 , wherein before the step of calculating the target driving voltage value of the target motor according to the speed difference between the current speed and the desired speed, the method further comprises: acquiring a current output voltage value of the motor driving module; determining a matching relationship between the output voltage value and the current speed according to a predetermined motor driving speed index table; wherein the motor driving speed index table contains a mapping relationship between a driving voltage range and a motor speed range; and calculating the target driving voltage value of the target motor according to the speed difference between the current speed and the desired speed when the output voltage value does not match the current speed.
- 8 . An electronic device, comprising: a memory; and a processor configured to execute a computer program stored on the memory; wherein the processor, when executing the computer program, realizes the steps of: acquiring a current speed of a target motor and a predetermined desired speed; calculating a target driving voltage value of the target motor according to a speed difference between the current speed and the desired speed; and generating a corresponding control instruction according to the target driving voltage value and transmitting the control instruction to a corresponding motor driving module, wherein the control instruction is configured to instruct the motor driving module to output a corresponding driving voltage to the target motor to control the speed of the target motor.
- 9 . The electronic device of claim 8 , wherein before the step of acquiring the current speed of the target motor and the predetermined desired speed, the processor further realizes the steps of: establishing a corresponding motor mathematical model according to characteristic parameters of the target motor; and inputting a predetermined desired voltage value into the motor mathematical model to obtain the desired speed.
- 10 . The electronic device of claim 8 , wherein before the step of acquiring the current speed of the target motor and the predetermined desired speed, the processor further realizes the steps of: acquiring, by a preset speed acquisition module, real-time speeds of the target motor for a plurality of times within a predetermined duration; and determining the current speed of the target motor according to the plurality of the real-time speeds.
- 11 . The electronic device of claim 8 , wherein the step of calculating the target driving voltage value of the target motor according to the speed difference between the current speed and the desired speed comprises: acquiring a first historical speed difference value corresponding to a first historical moment and a second historical speed difference value corresponding to a second historical moment; wherein the first historical moment differs from the current moment by a unit length of time, and the second historical moment differs from the first historical moment by the unit length of time; performing a proportional integral differentiation calculation on a speed difference between the current speed and the desired speed, the first historical speed difference and the second historical speed difference to obtain an incremental voltage value; and summing the historical driving voltage value corresponding to the first historical moment and the incremental voltage value to obtain the target driving voltage value of the target motor.
- 12 . The electronic device of claim 11 , wherein the step of performing the proportional integral differentiation calculation on the speed difference between the current speed and the desired speed, the first historical speed difference and the second historical speed difference to obtain the incremental voltage value comprises: performing a discrete proportional integral differentiation calculation on the speed difference between the current speed and the desired speed, the first historical speed difference and the second historical speed difference according to a discrete proportional integral differentiation formula to obtain the incremental voltage value; wherein the discrete proportional integral differentiation formula is Δu(k)=k p (e(k)−e(k−1))+k i e(k)+k d (e(k)−2e(k−1)+e(k−2)), Δu(k) is the incremental voltage value, k p is a proportional coefficient, k i is an integral coefficient, k d is a differentiation coefficient, e(k) is the speed error; e(k−1) is the first historical speed difference, and e(k−2) is the second historical speed difference.
- 13 . The electronic device of claim 8 , wherein before the step of calculating the target driving voltage value of the target motor according to the speed difference between the current speed and the desired speed, the processor further realizes the steps of: comparing the speed difference between the current speed and the desired speed with a predetermined error allowable range; and calculating the target driving voltage value of the target motor according to the speed difference between the current speed and the desired speed when the speed difference does not satisfy the error allowable range.
- 14 . The electronic device of claim 8 , wherein the step of calculating the target driving voltage value of the target motor according to the speed difference between the current speed and the desired speed further comprises: acquiring a current output voltage value of the motor driving module; determining a matching relationship between the output voltage value and the current speed according to a predetermined motor driving speed index table; wherein the motor driving speed index table contains a mapping relationship between a driving voltage range and a motor speed range; and calculating the target driving voltage value of the target motor according to the speed difference between the current speed and the desired speed when the output voltage value does not match the current speed.
- 15 . A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, realizes the steps in the motor speed control method of claim 1 .
Description
CROSS-REFERENCE TO RELATED APPLICATIONS This application is a continuation of International Application No. PCT/CN2024/130080, filed on Nov. 6, 2024, the entire contents of which are incorporated herein by reference. TECHNICAL FIELD The present application relates to the field of motor control technologies, in particular to a motor speed control method, apparatus, device, and storage medium. BACKGROUND The linear resonant actuator (LRA), also known as a linear motor, has been now widely used in a series of consumer electronic products, such as smartphones, tablets, VR, and smart wearable devices, which can provide haptic feedback, such as vibration alerts, touch feedback, etc. This haptic feedback can enhance the user's interactive experience with the device. Therefore, the linear motors are regarded as an important component in these consumer electronic products and play an important role in enhancing the user experience. However, motors in practical applications may suffer from, for example, parameter uptake and nonlinear distortion due to low manufacturing precision and the motor's own physical characteristics, which can affect the experiential effect of the originally designed drive signals on haptic feedback. Therefore, it is necessary to control the motor in real-time so that the motor can always work within a good performance range and improve the user experience. SUMMARY A main object of the present application is to provide a motor speed control method, apparatus, device, and storage medium, which can at least solve the problem of degradation of motor performance and influence of haptic feedback effect due to situations such as motor parameter regression and non-linear distortion in the related art. In order to realize the above purpose, a first aspect of the present application provides a motor speed control method, including: acquiring a current speed of a target motor and a predetermined desired speed; calculating a target driving voltage value of the target motor according to a speed difference between the current speed and the desired speed; and generating a corresponding control instruction according to the target driving voltage value and transmitting the control instruction to a corresponding motor driving module, wherein the control instruction is configured to instruct the motor driving module to output a corresponding driving voltage to the target motor to control the speed of the target motor. A second aspect of the present application provides a motor speed control apparatus, wherein the motor speed control apparatus includes: an acquisition module configured to acquire a current speed of a target motor and a predetermined desired speed; an error calculation module configured to calculate a target driving voltage value of the target motor according to a speed difference between the current speed and the desired speed; and an instruction generation module configured to generate a corresponding control instruction according to the target driving voltage value and transmit the control instruction to a corresponding motor driving module, wherein the control instruction is configured to instruct the motor driving module to output a corresponding driving voltage to the target motor to control the speed of the target motor. A third aspect of the present application provides an electronic device including a memory and a processor configured to execute a computer program stored in the memory; wherein the processor, when executing the computer program, realizes the steps in the above-described motor speed control method provided in the first aspect of the present application. A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, realizes the steps in the above-described motor speed control method provided in the first aspect of the present application. As can be seen from the above, according to the motor speed control method, apparatus, device, and readable storage medium provided in solutions of the present application, a current speed of a target motor and a predetermined desired speed are acquired; a target driving voltage value of the target motor is calculated according to a speed difference between the current speed and the desired speed; a corresponding control instruction is generated according to the target driving voltage value and transmitted to the corresponding motor driving module. The control instruction is configured to instruct the motor driving module to output a corresponding driving voltage to the target motor to control the speed of the target motor. Through the implementation of the scheme provided in the present application, the current speed of the target motor is monitored in real-time and the speed error is calculated in real-time, and the driving signal of the target motor is corrected so that the speed of the target motor can reach th