A motor vibration frequency calibration method, controller, and computing device
By determining and storing calibration values when the electronic device is started, the motor vibration frequency is adjusted in real time, which solves the problem of poor vibration effect caused by changes in the structure of the electronic device, and improves the vibration effect of the motor and the user experience.
Patent Information
- Application Number
- CN202410649424.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-05-23
AI Technical Summary
In the prior art, the motor vibration frequency calibration value of electronic devices cannot adapt after aging and structural changes, resulting in poor vibration effect and affecting user experience.
During the initialization phase of the electronic device startup, the controller determines the calibration value based on the fixed waveform and the first vibration frequency, and stores it in the storage device to adjust the vibration frequency of the motor in real time, ensuring that the calibration value adapts to the current device state each time the device is powered on.
It improves the vibration control and operational stability of the motor, reduces unnecessary vibration during startup, and enhances the user experience.
Smart Images

Figure CN118646313B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal, and in particular to a motor vibration frequency calibration method, a controller and a computing device. BACKGROUND
[0002] With the wide application and increasing functions of electronic devices, the vibration function plays an important role in improving user experience. After the electronic device identifies the vibration application scenario, the controller of the included motor chip, that is, the motor, determines the vibration frequency and drives the motor to vibrate according to the vibration frequency. However, the structural differences of each electronic device will cause differences in the vibration effect of different electronic devices, so it is necessary to calibrate the vibration frequency of the motor in each electronic device. Currently, the calibration process of the motor vibration frequency in the electronic device is carried out in the factory production process, and the calibrated value of the motor is saved in the partition of the electronic device, so that the electronic device determines the vibration frequency of the motor according to the calibrated value of the motor in the partition.
[0003] However, as the electronic device ages and deforms, the fixed calibrated value of the motor determined by the above motor vibration frequency calibration method cannot be applied to the constantly changing electronic device, and the motor vibration frequency cannot be adjusted to the optimal vibration frequency, thereby affecting the vibration effect of the motor in the electronic device. SUMMARY
[0004] The present application provides a motor vibration frequency calibration method, a controller and a computing device, which determines the calibrated value in the initialization stage of the electronic device startup, and then stores the calibrated value in the storage device to determine the vibration frequency of the motor, thereby controlling the vibration of the motor, which can adjust the motor vibration frequency to the optimal vibration frequency as much as possible, and improves the vibration effect of the motor in the electronic device.
[0005] In a first aspect, the present application provides a motor vibration frequency calibration method for determining and storing the calibrated value of the motor vibration in an electronic device, the electronic device comprising a controller, the controller being connected with the motor, and the method comprising:
[0006] The controller determines a first calibrated value according to a fixed waveform and a first vibration frequency in the initialization stage of the electronic device startup, wherein the fixed waveform and the first vibration frequency are determined according to the controller;
[0007] The controller stores the first calibrated value in the storage device, and controls the vibration of the motor according to the vibration frequency determined by the first calibrated value.
[0008] In the method, the controller determines the first calibration value according to the fixed waveform and the first vibration frequency in an initialization stage when the electronic device starts, then stores the first calibration value in the storage device, and controls the vibration of the motor according to the vibration frequency determined according to the first calibration value. Compared with the conventional scheme of using a fixed calibration value to calibrate the vibration frequency of the motor, the application calculates the calibration value and adjusts the vibration frequency of the motor in real time each time the electronic device starts, so that the calibration value calculated each time can be more suitable for the current state of the electronic device, thereby adjusting the vibration frequency of the motor to the optimal state, improving the vibration effect and operation stability, and enhancing the vibration effect of the motor in the electronic device.
[0009] In a possible implementation of the first aspect, the controller determines the first calibration value according to the fixed waveform and the first vibration frequency in an initialization stage when the electronic device starts, and the specific process is as follows:
[0010] The controller determines the waveform frequency corresponding to the fixed waveform in an initialization stage when the electronic device starts, and the waveform frequency is a value that changes according to the electronic device.
[0011] The controller determines the difference between the waveform frequency and the first vibration frequency as the first calibration value.
[0012] The application determines the first calibration value according to the fixed waveform and the first vibration frequency in an initialization stage when the electronic device starts, which can avoid triggering vibration again in a kernel loading stage or a kernel starting stage of the electronic device, thereby reducing the number of vibrations in the starting process of the electronic device. In this way, the user will only feel one vibration in the starting process, reducing unnecessary interference. By reducing the additional vibration, the starting process of the electronic device can be made more natural and smooth. It can also reduce the confusion and discomfort that the user may have during the starting process. The user will not feel that the electronic device vibrates frequently, so it is easier for the user to understand and accept the vibration in the starting process, thereby improving the overall experience of the user.
[0013] Based on the first aspect, in a possible implementation, the specific process in which the controller stores the first calibration value in the storage device is as follows:
[0014] The controller adds the first calibration value to the kernel command line in a kernel loading stage of the electronic device.
[0015] The controller obtains the first calibration value in the kernel command line in a kernel starting stage of the electronic device, and stores the first calibration value in the storage device.
[0016] It can be seen that, in the embodiment of the application, the first calibration value is obtained from the initialization stage of the electronic device starting in the kernel loading stage of the electronic device, and the first calibration value is added to the kernel command line; in the kernel starting stage of the electronic device, the first calibration value in the kernel command line is obtained, and the first calibration value is stored in the storage device. In the traditional scheme, the first calibration value is saved in the variable partition inside the electronic device, however, the variable partition may be accessed or operated without authorization, resulting in the calibration value being tampered with or deleted, once the calibration value is lost, it may cause the electronic device to run abnormally or performance degradation, and even may affect the user experience or cause loss. The calibration value transmission and storage scheme of the application ensures the stability and reliability of the calibration value in the system starting process.
[0017] Based on the first aspect, in possible implementation manners, before the first calibration value is added to the kernel command line, the method further includes:
[0018] The controller determines whether the first calibration value is within the target range;
[0019] In a case where it is determined that the first calibration value is within the target range, the controller adds the first calibration value to the kernel command line; or,
[0020] In a case where it is determined that the first calibration value is not within the target range, the controller sets the first calibration value to a target value, and adds the target value to the kernel command line.
[0021] It can be seen that, in the embodiment of the application, before the first calibration value is added to the kernel command line, by determining whether the first calibration value is within the target range, it can be ensured that the calibration value added to the kernel command line is effective and reliable. This helps to prevent the electronic device from having problems or performance degradation due to abnormal calibration value.
[0022] Based on the first aspect, in possible implementation manners, the storage device includes a register.
[0023] Based on the first aspect, in possible implementation manners, the method further includes:
[0024] The controller determines a second calibration value according to the fixed waveform and the first vibration frequency after the electronic device is powered off and restarted;
[0025] The controller stores the second calibration value in the storage device, so that the controller vibrates at a vibration frequency determined according to the second calibration value and the first vibration frequency.
[0026] It can be seen that, in the embodiment of the application, after the electronic device is powered off and restarted, the new calibration value is applied to the current electronic device by re-determining and storing the calibration value, so as to ensure the accuracy, stability and consistency of the electronic device in the vibration process, thereby improving the vibration effect of the motor and improving the user experience.
[0027] In a second aspect, the embodiment of the application provides a controller, comprising a determination module and a control module. The determination module is configured to determine a first calibration value according to a fixed waveform and a first vibration frequency in an initialization stage of starting of an electronic device, wherein the fixed waveform and the first vibration frequency are determined according to the controller; and the control module is configured to store the first calibration value into a storage device, and control vibration of a motor according to a vibration frequency determined according to the first calibration value.
[0028] Based on the second aspect, in possible implementation manners, the determination module is configured to:
[0029] determine a corresponding waveform frequency according to the fixed waveform in the initialization stage of starting of the electronic device, the waveform frequency being a value changed according to the electronic device;
[0030] determine a difference between the waveform frequency and the first vibration frequency as the first calibration value.
[0031] Based on the second aspect, in possible implementation manners, the controller further comprises a storage module, and the storage module is configured to:
[0032] add the first calibration value into a kernel command line in a kernel loading stage of the electronic device;
[0033] obtain the first calibration value in the kernel command line in a kernel starting stage of the electronic device, and store the first calibration value into the storage device.
[0034] Based on the second aspect, in possible implementation manners, the determination module is configured to:
[0035] determine whether the first calibration value is in a target range;
[0036] in a case where it is determined that the first calibration value is in the target range, add the first calibration value into the kernel command line; or
[0037] in a case where it is determined that the first calibration value is not in the target range, set the first calibration value as a target value, and add the target value into the kernel command line.
[0038] Based on the second aspect, in possible implementation manners, the storage device comprises a register.
[0039] Based on the second aspect, in possible implementation manners, the determination module is configured to:
[0040] After the electronic device is powered off and restarted, a second calibration value is determined according to the fixed waveform and the first vibration frequency;
[0041] The second calibration value is stored in the storage device, so that the controller vibrates at a vibration frequency determined according to the second calibration value and the first vibration frequency.
[0042] Each functional module in the second aspect is used to implement the method of the first aspect and possible implementation manners of the first aspect.
[0043] In a third aspect, an embodiment of the present application provides a computing device, including a memory and a processor, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to implement the method described in the first aspect and any possible implementation manner of the first aspect.
[0044] In a fourth aspect, an embodiment of the present application provides a computer storage medium, including program instructions, when the program instructions are executed by a controller, the controller is caused to execute the method described in the first aspect and any possible implementation manner of the first aspect.
[0045] In a fifth aspect, the present application provides a computer program product, including program instructions, when the computer program product is executed by a controller, the controller is used to execute the method of the first aspect and any possible implementation manner of the first aspect. The computer program product can be a software installation package, and when the method provided by the first aspect and any possible implementation manner of the first aspect is needed, the computer program product can be downloaded and executed on the controller to implement the method of the first aspect and any possible implementation manner of the first aspect.
[0046] On the basis of the implementation manners of the aspects provided by the present application, further combinations can be made to provide more implementation manners. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background art, the drawings needed to be used in the embodiments of the present application or the background art will be described below.
[0048] Figure 1 is a flowchart of a motor vibration frequency calibration method provided by the present application;
[0049] Figure 2 is a schematic diagram of the electrical connection between the motor chip and the motor provided by the present application;
[0050] Figure 3 is a structural schematic diagram of a controller provided by the present application;
[0051] Figure 4 is a structural schematic diagram of a computing device provided by the present application. DETAILED DESCRIPTION
[0052] The embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0053] It should be noted that the terms used in the embodiments of the present application are merely for the purpose of describing the specific embodiments, and are not intended to limit the present application. The singular forms "a", "an" and "the" used in the embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein means and includes any or all possible combinations of one or more associated listed items.
[0054] It should be noted that when used in the specification and the appended claims, the term "comprise" and any variations thereof are intended to cover non-exclusive inclusion. For example, a system, product or device comprising a series of units / devices is not limited to the listed units / devices, but can optionally further comprise units / devices not listed, or can optionally further comprise other units / devices inherent to the product or device.
[0055] It should also be understood that the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting" or "in the event that" depending on the context.
[0056] Before introducing the embodiments of the present application, the technical terms related to the embodiments of the present application will be introduced.
[0057] Motor: a device that converts electrical energy into mechanical energy. A motor usually consists of one or more coils, when current passes through the coil, the magnetic field in the coil interacts with the magnetic field of the permanent magnet in the motor, generating Lorentz force, which makes the rotor in the motor rotate, thereby driving the motor to vibrate.
[0058] Extensible boot loader (XBL) stage: the first stage in the boot process of an electronic device, the main tasks include initializing the processor, memory and peripherals, etc. hardware, and loading the bootloader, handing over the control to the bootloader to continue the subsequent boot process.
[0059] Application boot loader (ABL) stage: This is the second stage in the boot process of an electronic device. The main tasks include loading the operating system kernel, initializing the system environment, and starting user applications.
[0060] Kernel stage: This is the third stage in the boot process of an electronic device. The main tasks include initializing device drivers, managing system resources, scheduling processes, and providing system call interfaces, etc., to ensure that the electronic device can run normally and provide the required functions and services for users.
[0061] Before introducing the motor vibration frequency calibration method provided by the present application, the use scenario of the motor in the electronic device will be introduced first.
[0062] For electronic devices equipped with motors, the motor can be used to implement multiple types of vibration services in different business scenarios. The electronic devices include personal computers, smartphones, palm processing devices, tablets, mobile notebooks, augmented reality (AR) devices, virtual reality (VR) devices, etc. The specific form of the electronic device is not limited in the present application.
[0063] Taking a smartphone as an example, the vibration scenario of the motor in the smartphone will be introduced.
[0064] For example, when the smartphone receives an incoming call, the motor will be driven to produce vibration, thereby reminding the user of the incoming call. This vibration reminder method can effectively notify the user of the incoming call in silent or vibration mode.
[0065] For another example, when the smartphone receives a message such as a short message or application information, the motor can also be triggered to vibrate to prompt the user of the arrival of new messages. This vibration reminder method can allow the user to view and reply to the message in time.
[0066] For another example, the alarm function of the smartphone usually uses the motor to vibrate for reminder. When the set alarm time arrives, the motor will vibrate to help the user wake up in time or remind important events.
[0067] For another example, when using map navigation, the smartphone can use the motor to vibrate to indicate when to turn or arrive at the destination. This vibration navigation function can help drivers or pedestrians obtain navigation information more conveniently.
[0068] As can be seen, the motor plays a crucial role in electronic devices, and its application scenarios are widespread, making it an indispensable component of electronic devices.
[0069] It should be noted that when the actual operating power of the motor is close to or equal to the ideal frequency of the motor, the motor vibration system will be affected by the resonance effect, and the amplitude of the motor will increase significantly, thereby producing the best vibration effect. When the actual operating power of the motor is less than or greater than the ideal frequency of the motor, the amplitude of the motor will decrease, and the vibration effect produced by the motor will be poor.
[0070] In addition, individual differences in electronic devices can result in different vibration effects for different electronic devices. For example, one electronic device can have a more stable structural design to reduce the damping of the vibration transmission path, while another electronic device can have a looser structure, resulting in lower vibration transmission efficiency. Therefore, the difference in structural design will directly affect the performance of the motor vibration effect. For another example, the length of the vibration transmission path inside different electronic devices can be different. Some electronic devices can have a more direct and efficient vibration transmission path, so that the vibration produced by the motor can be transmitted faster and more accurately to the surface of the device, thereby producing a better vibration effect. For another example, the mass and material of the electronic device can also affect the vibration effect of the motor. High-quality materials and superior manufacturing processes can reduce energy loss in the vibration transmission path and improve the performance of the vibration effect. Conversely, low-quality materials and manufacturing processes can result in greater loss of vibration energy, affecting the strength and duration of the vibration effect.
[0071] In addition, the structure of the electronic device can deform during use, causing the calibration values determined during the production stage to be less applicable to the current structure. Specifically, as the electronic device is used for a longer period of time, the internal materials of the electronic device can age, such as plastic becoming brittle, metal becoming soft, etc., causing the stability and strength of the electronic device structure to decrease. This material aging can cause the calibration values determined when the electronic device is shipped to no longer be applicable to the current electronic device, the vibration transmission path changes, and the vibration effect is affected; the electronic device can be affected by external impact, pressure, etc. during long-term use, causing the structure to deform. For example, the shell of the electronic device can have a small deformation or crack, causing the vibration transmission path to change, so that the original vibration calibration value cannot accurately transmit the vibration signal, affecting the stability and strength of the vibration effect.
[0072] Therefore, in order to solve the above-mentioned differences in vibration effects of different electronic devices, and the problem that the calibration value cannot be applied to the current electronic device, the present application provides a motor vibration frequency calibration method. The controller determines the calibration value during the initialization stage when the electronic device is started and stores the calibration value in the storage device, and then determines the vibration frequency of the motor according to the calibration value to control the vibration of the motor, which can adjust the motor vibration frequency to the best vibration frequency as much as possible, thereby improving the vibration effect of the motor in the electronic device.
[0073] Reference Figure 1, Figure 1 A flowchart of a motor vibration frequency calibration method provided by the present application is shown in the figure, which includes but is not limited to the following description.
[0074] S101: In the initialization stage of the electronic device startup, the motor chip determines the first calibration value according to the fixed waveform and the first vibration frequency.
[0075] In the initialization stage of the electronic device startup, the motor chip (controller) determines the first calibration value according to the fixed waveform and the first vibration frequency. Wherein, the frequency corresponding to the fixed waveform is a value according to the change of the electronic device. In other words, even if the fixed waveform input to the motor controller remains unchanged, the frequency corresponding to the fixed waveform obtained each time will be different due to the change of the electronic device.
[0076] It should be noted that the above-mentioned fixed waveform can be provided by the supplier of the motor chip, or can be obtained by experiment. The present application does not make specific limitations on the acquisition method of the fixed waveform and the specific parameters of the fixed waveform.
[0077] Wherein, the initialization stage of the electronic device startup is the XBL stage, which usually performs hardware initialization and system boot. In the XBL stage, the electronic device will vibrate once to show the startup and prepare for subsequent system operation.
[0078] If the motor vibration frequency calibration process is placed in the kernel stage or the ABL stage, the electronic device startup will appear twice vibration, that is, the first vibration in the XBL stage and the second vibration in the kernel stage or the ABL stage. In this case, the user may feel that the electronic device vibrates frequently, which affects the user experience, and even makes the user feel confused or uncomfortable.
[0079] In order to avoid this situation, the motor vibration frequency calibration process is placed in the XBL stage. In this way, only one vibration will occur when the electronic device starts, that is, the vibration in the XBL stage. By integrating the motor vibration frequency calibration process into the vibration in the XBL stage, the user can feel that the electronic device startup process is more natural and smooth, reducing unnecessary interference and discomfort, and improving the user experience.
[0080] In one possible implementation, the waveform information of the fixed waveform is pre-stored in the software and represented in digital form. When the code is executed, the waveform information is converted into the format of the I2C communication protocol, which involves data packaging, address allocation, verification, and other steps to ensure that the data can be correctly transmitted on the I2C bus. Once the waveform information is converted into the data format conforming to the I2C protocol, the software sends the data to the motor chip connected thereto through the I2C bus. In this process, the software sends instructions and data packets to the I2C bus to indicate the transmission and reception of data.
[0081] After the waveform information is transmitted to the motor chip, the motor chip performs digital signal processing on the received waveform information, including filtering, sampling, and quantization. Then, the motor chip analyzes and converts the waveform information according to the preset control algorithm and logic, converts the processed waveform information into a pulse signal through the pulse width modulation (PWM) technology, and sends the pulse signal to the driving circuit. The driving circuit drives the rotor of the motor to rotate according to the received pulse signal.
[0082] It should be noted that the waveform information can also be transmitted to the motor chip through other ways, such as a serial peripheral interface or a control area network. The application does not make specific limitations on the transmission method.
[0083] The motor chip transmits an electric signal to the motor to control the rotation of the rotor of the motor. The motor produces a specific frequency response during vibration. The motor chip can monitor the vibration of the motor through a sensor or a feedback mechanism, and accordingly deduce the frequency corresponding to the current waveform information.
[0084] It should be noted that the motor chip and the motor are electrically connected. See Figure 2 , Figure 2 The motor chip provided in the application is electrically connected to the motor. The electrical connection is achieved through wires or cables on the circuit board. Through the electrical connection, the motor chip can transmit an electric signal to the motor to control the rotation of the rotor of the motor.
[0085] The motor chip obtains the frequency corresponding to the waveform information through the above-mentioned way, and calculates a first calibration value for the vibration frequency calibration of the motor according to the frequency corresponding to the waveform information and the ideal frequency of the motor.
[0086] Specifically, the motor chip subtracts the frequency corresponding to the waveform information obtained through the above-mentioned way from the first vibration frequency (ideal frequency) of the motor, and the absolute value of the difference is taken as the first calibration value for the vibration frequency calibration of the motor.
[0087] For example, the first vibration frequency of the motor is 171 Hz, the frequency corresponding to the waveform information is 167 Hz, the absolute value of the difference between the frequency corresponding to the waveform information and the first vibration frequency of the motor is 4 Hz, and 4 Hz is the first calibration value of the motor vibration frequency calibration this time.
[0088] It should be noted that the first frequency of the motor can usually be provided by the supplier of the motor chip. The supplier will give a recommended ideal frequency value according to the design specifications and performance characteristics of the motor. This value can be used as a reference standard for motor F0 calibration to help users ensure that the motor is running in the best state. In addition, the first vibration frequency of the motor can also be obtained by experiment. By testing and observing the motor in actual operation, the optimal frequency range of the motor under different working conditions can be determined, and thus an ideal frequency value suitable for the specific motor can be obtained. The application does not make specific limitations on the way of obtaining the first vibration frequency of the motor.
[0089] If the obtained calibration value is within the target range, the calibration can proceed smoothly, and the vibration of the motor will achieve the expected vibration effect. If the obtained calibration value is not within the target range, it means that there may be a problem in the motor chip, which will not only cause the motor vibration effect to deviate from the expected effect, resulting in a decline in user experience, but also increase the risk of damage to the electronic device.
[0090] In order to avoid such a situation, the obtained first calibration value is compared with the target range. When the obtained calibration value is within the target range, it means that the first calibration value is within a reasonable range, and the subsequent operation can be performed normally to achieve the expected vibration effect.
[0091] For example, two constants, cali_min (lower limit) and cali_max (upper limit), can be set in the software code. The value of cali_min can be 0 Hz, and the value of cali_max can be 5 Hz. The obtained first calibration value is compared with cali_min and cali_max respectively. When the obtained first calibration value is greater than or equal to cali_min and less than or equal to cali_max, it means that the calibration value meets the conditions.
[0092] It should be noted that the above target range can be obtained through a large number of experiments, or can be set according to the design specifications and working requirements of the motor. The application does not make specific limitations on the target range.
[0093] Optionally, a flag bit can be set. When the above obtained first calibration value is within the target range, the flag bit is set to 1, indicating that the calibration value is reasonable. When the above obtained calibration value is not within the target range, the flag bit is set to 0, indicating that the calibration value is not reasonable.
[0094] It should be noted that the application can also calculate the calibration value in other ways, which is not limited in the application.
[0095] S102: The obtained first calibration value is transmitted to the kernel loading stage started by the electronic device.
[0096] The motor chip transmits the obtained first calibration value from the initialization stage (XBL stage) started by the electronic device to the kernel loading stage (ABL stage) of the electronic device through the protocol protocol.
[0097] Among them, Protocol is a set of rules in the field of computer communication that specifies data exchange between communication devices. The protocol specifies the format, sequence, error detection and correction method of data transmission to ensure that both parties of communication can correctly send, receive and interpret information. The protocol can include physical layer electrical characteristics, data transmission rate, and can also include logical layer message format, command and response rules, etc.
[0098] In an implementation, in software implementation, the application calibrates motor vibration based on a high-pass platform. Since the codes of the XBL stage and the ABL stage are both implemented based on the unified extensible firmware interface (uefi), the XBL and the ABL can share the same memory address space, which enables direct data transmission and information sharing between the XBL and the ABL without additional complex processing or data copying. The steps and processes of transmitting the first calibration value from the XBL stage to the ABL stage are as follows:
[0099] A protocol structure body for communication with the ABL is defined in the XBL, and a function is added in the structure body, which is used to determine whether to obtain the above calibration value or flag bit and other parameters from the XBL according to the input parameters. For example, set the enumeration as a parameter to pass into the function, when the parameter is a flag bit, the function returns the value of the flag bit, and when the parameter is a calibration value, the function returns the calibration value. Among them, the enumeration contains two enumeration members, one is a flag bit and one is a calibration value, in the code implementation, the flag bit is assigned a value of 0 and the calibration value is assigned a value of 1.
[0100] It should be noted that only the protocol structure body needs to be declared in the ABL, and different repeated definitions.
[0101] Wherein, the uefi is a new generation of firmware interface standard, responsible for initializing the hardware devices of the computer, establishing the running environment of the system, and loading the boot loader of the operating system. The uefi provides more flexible, safe and powerful boot and system management functions, supports larger hard disk capacity, faster boot speed and more security features. The uefi also supports graphical interface and network function, so that users can more conveniently manage and configure the computer system.
[0102] S103: In the kernel loading stage of the electronic device, the first calibration value is added to the kernel command line.
[0103] In the kernel loading stage (ABL stage) of the electronic device, before the first calibration value is added to the kernel command line, it is necessary to determine whether the first calibration value is within the target range.
[0104] In a possible implementation, the parameter of the function defined in the incoming protocol structure is set as a flag bit, and whether the first calibration value is within the target range is determined according to the value of the flag bit. If the value of the flag bit is 1, it means that the first calibration value is within the target range, at this time, the function defined in the protocol structure is called again, the parameter of the function is set as the calibration value, the first calibration value is obtained from the XBL, and the first calibration value is added to the kernel command line (cmdline). If the value of the flag bit is 0, it means that the first calibration value is not within the target range, the first calibration value is set as the target value, and the target value is added to the kernel command line. Wherein, the target value can be set as "NA" to indicate that the first calibration value is not within the target range.
[0105] Wherein, in the embedded system, the cmdline refers to the parameter string passed to the kernel when the operating system kernel starts. The string usually contains the configuration information and parameters required for the operating system to start. The kernel command line is passed to the operating system kernel by the XBL at startup, which includes startup parameters, device information, file system configuration and other key information. These parameters are crucial for the correct startup and configuration of the operating system, ensuring that the system can run normally and interact correctly with hardware devices.
[0106] It should be noted that the above-described method of obtaining the first calibration value in the ABL stage is only a representative implementation and is not the only way. As long as the same result can be achieved, that is, the first calibration value is obtained in the ABL stage, the specific implementation is not limited in the present application.
[0107] The first calibration value is transmitted from the kernel loading stage of the electronic device to the kernel startup stage of the electronic device through the kernel command line.
[0108] Specifically, the obtained first calibration value needs to be encoded into the format of command line parameters in the ABL stage, and it is ensured that the parameters passed to the kernel are correct. Among them, the command line parameters are usually separated by spaces, and each parameter has a specific format. For example, a parameter can be calidata_value = 123, where calidata_value is the name of the parameter and 123 is the actual value of the calibration value. After the first calibration value is encoded into the format of the command line parameter, the relevant function started by the kernel is called to start the operating system kernel. In this process, the ABL passes the command line parameters to the kernel.
[0109] S104: In the kernel start-up stage of the electronic device, obtain the first calibration value in the kernel command line, and store the first calibration value in the storage device.
[0110] In the kernel start-up stage of the electronic device, the first calibration value in the kernel command line is obtained by parsing the kernel command line parameters, and the first calibration value is stored in the storage device. Specifically, in the kernel start-up stage of the electronic device, the string of the command line parameters is read, and the command line parameter string is parsed and divided into individual parameters and values. In the parsing process, it is determined which parameter corresponds to the first calibration value according to the pre-set rules and conventions. After determining the parameter corresponding to the first calibration value, the motor chip stores this value in the storage device according to a certain data structure. The storage device is located in the motor chip, and the storage device can be a register. A register is a small storage unit used for storing and transmitting data, and is usually used for temporarily storing instructions, addresses or data. The specific form of the storage device is not limited in the present application.
[0111] In the process of parsing the first calibration value, the first calibration value also needs to be determined. Specifically, if the obtained first calibration value is "NA", the first calibration value is re-assigned to 0. If the obtained first calibration value is not "NA", the first calibration value is the value corresponding to the received first calibration value.
[0112] It should be noted that before writing the parsed first calibration value into the storage device, some conversion of the parsed first calibration value is usually required to meet the requirements of the storage device. For example, before writing the parsed first calibration value into the storage device, the value of the first calibration value is converted to hexadecimal to ensure the integrity and accuracy of the written data. For another example, some storage devices may have specific requirements for the format of data, such as byte order or data alignment. Before writing, it is necessary to ensure that the data format of the parsed first calibration value meets the requirements of the storage device. For another example, some storage devices may have data range limitations, and it is necessary to ensure that the parsed first calibration value is within the appropriate range. If it is out of range, data adjustment or standardization is required.
[0113] S105: The motor chip stores the first calibration value into the storage device, and controls the vibration of the motor according to the vibration frequency determined according to the first calibration value.
[0114] After the motor chip stores the first calibration value into the storage device, the vibration of the motor is controlled according to the vibration frequency determined according to the first calibration value. Once the first calibration value is stored and applied to the vibration frequency control, the motor chip sends corresponding control signals to the motor according to the set frequency parameter, so as to drive the motor to vibrate at the specified frequency. In this way, the motor can accurately control the vibration frequency according to the first calibration value, so as to realize the required vibration effect and running state.
[0115] It should be noted that after the electronic device is powered off and restarted, the motor chip determines a second calibration value according to the fixed waveform and the first vibration frequency, and then stores the second calibration value into the storage device, so that the motor chip vibrates according to the vibration frequency determined according to the second calibration value and the first vibration frequency.
[0116] It can be seen that in the embodiment of the present application, first, in the initialization phase of starting the electronic device, the first calibration value is determined according to the fixed waveform and the first vibration frequency; then the first calibration value is stored into the storage device, and the vibration of the motor is controlled according to the vibration frequency determined according to the first calibration value. Compared with the traditional scheme of using a fixed calibration value to calibrate the vibration frequency of the motor, the present application calculates the calibration value in real time and adjusts the vibration frequency of the motor each time the electronic device is started. This can make the calibration value calculated each time more suitable for the current state of the electronic device, so as to adjust the vibration frequency of the motor to the best state, improve the vibration effect and running stability, and thus enhance the vibration effect of the motor in the electronic device.
[0117] The present application provides a controller, please refer to Figure 3 , Figure 3 The present application provides a controller 300, and the structure schematic diagram of the controller 300 can be Figures 1-2 The motor chip in the method embodiment is used to realize Figure 1 The steps in the embodiments, the controller 300 comprises:
[0118] The determination module 310 is used to determine the first calibration value according to the fixed waveform and the first vibration frequency in the initialization phase of starting the electronic device, wherein the fixed waveform and the first vibration frequency are determined according to the controller;
[0119] The control module 320 is used to store the first calibration value into the storage device, and control the vibration of the motor according to the vibration frequency determined according to the first calibration value.
[0120] In a possible implementation manner, the determination module 310 is used to:
[0121] In the initialization stage of the electronic device, the corresponding waveform frequency is determined according to the fixed waveform, and the waveform frequency is a value that changes according to the electronic device;
[0122] The difference between the waveform frequency and the first vibration frequency is determined as the first calibration value.
[0123] In a possible implementation, the controller further includes a storage module 330, and the storage module 330 is configured to:
[0124] In the kernel loading stage of the electronic device, the first calibration value is added to the kernel command line.
[0125] In the kernel starting stage of the electronic device, the first calibration value in the kernel command line is obtained, and the first calibration value is stored in the storage device.
[0126] In a possible implementation, the determination module 310 is configured to:
[0127] It is determined whether the first calibration value is within the target range.
[0128] In a case where it is determined that the first calibration value is within the target range, the first calibration value is added to the kernel command line; or
[0129] In a case where it is determined that the first calibration value is not within the target range, the first calibration value is set as the target value, and the target value is added to the kernel command line.
[0130] In a possible implementation, the storage device includes a register.
[0131] In a possible implementation, the determination module 310 is configured to:
[0132] After the electronic device is powered off and restarted, a second calibration value is determined according to the fixed waveform and the first vibration frequency.
[0133] The second calibration value is stored in the storage device, so that the controller vibrates at a vibration frequency determined according to the second calibration value and the first vibration frequency.
[0134] Figure 3 The various functional modules in the method embodiment are configured to implement the steps of the method embodiment, and specific implementation can be referred to the description of the related content in the method embodiment, which will not be described here for the sake of brevity of the description. Figures 1-2 Figures 1-2 The various functional modules in the method embodiment are configured to implement the steps of the method embodiment, and specific implementation can be referred to the description of the related content in the method embodiment, which will not be described here for the sake of brevity of the description.
[0135] The application further provides a computing device, which can be referred to Figure 4 , Figure 4 a structural schematic diagram of a computing device 400 provided by the application, and the computing device is configured to implement Figures 1-2 The method embodiment, the computing device 400 includes: a processor 410, a communication interface 420 and a memory 430. Wherein, the processor 410, the communication interface 420 and the memory 430 can be connected with each other through an internal bus 440, and also can realize communication through wireless transmission and other means.
[0136] Taking the connection through the bus 440 as an example, the bus 440 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 440 can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 4 In the figure, only one thick line is used to represent, but it does not mean that there is only one bus or one type of bus.
[0137] The processor 410 can be composed of at least one general-purpose processor, such as a CPU, or a combination of a CPU and a hardware chip. The above-mentioned hardware chip can be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The processor 410 executes various types of digital storage instructions, such as software or firmware programs stored in the memory 430, which can enable the computing device 400 to provide a wide variety of services.
[0138] The memory 430 is used to store program codes and is controlled by the processor 410 to execute the above-mentioned Figures 1-2 The steps of the embodiment described above can be specifically referred to the related description of the above-mentioned embodiment, which will not be expanded here.
[0139] The memory 430 can include a volatile memory, such as a RAM; the memory 430 can also include a non-volatile memory, such as a ROM, a flash memory; the memory 430 can also include a combination of the above-mentioned kinds.
[0140] The communication interface 420 can be a wired interface (for example, an Ethernet interface), can be an internal interface (for example, a peripheral component interconnect express (PCIE) bus interface), a wired interface (for example, an Ethernet interface), or a wireless interface (for example, a cellular network interface or a wireless local area network interface), for communication with other devices or modules.
[0141] The processor 410, the communication interface 420, and the like in the computing device 400 can implement the functions and / or the various steps and methods implemented in the above-described various method embodiments, and for brevity, will not be described here. The determination module 310, the control module 320, and the storage module 330 in the controller 300 can be located in the processor 410 in the computing device 400.
[0142] It should be noted that, Figure 4 Only one possible implementation of the embodiments of the present application is described herein, and in actual applications, the computing device can further include more or fewer components, which are not limited herein. For the content not shown or described in the embodiments of the present application, reference can be made to the related descriptions in the above-described method embodiments, which will not be described here.
[0143] The present application also provides a computer storage medium, including program instructions, when the program instructions are executed by a controller, the controller executes part or all of the steps described in the above motor vibration frequency calibration method embodiments.
[0144] The present application also provides a computer program product, including program instructions, when the program instructions are executed by a controller, the controller executes part or all of the steps described in the above motor vibration frequency calibration method embodiments.
[0145] In the above-described embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0146] In the above embodiments, all or part of the embodiments can be implemented by software, hardware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product can contain codes. When the computer program product is read and executed by a computer, part or all of the steps of the methods described in the above method embodiments can be implemented. The computer can be a general purpose computer, a special purpose computer, a computer network or other programmable apparatus. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media sets. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium, or a semiconductor medium, etc.
[0147] The steps in the method of the embodiments of the present application can be adjusted in sequence, combined or deleted according to actual needs; the units in the device of the embodiments of the present application can be divided, combined or deleted according to actual needs.
[0148] The embodiments of the present application are described in detail above, and the specific examples are applied to explain the principles and implementation modes of the present application; the above embodiment descriptions are only used to help understand the method and core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed; in view of the above, the content of the specification should not be understood as the limitation of the present application.
Claims
1. A method for calibrating the vibration frequency of a motor, characterized in that, The method is used to determine and store calibration values for motor vibration in an electronic device, the electronic device including a controller connected to the motor, and the method includes: During the initialization phase of the electronic device startup, the controller determines a first calibration value based on the waveform frequency corresponding to a fixed waveform and a first vibration frequency, wherein the waveform frequency corresponding to the fixed waveform is a value that changes according to the electronic device, and the fixed waveform and the first vibration frequency are determined by the controller. The controller adds the first calibration value to the kernel command line during the kernel loading phase of the electronic device; During the kernel startup phase of the electronic device, the controller obtains the first calibration value from the kernel command line, stores the first calibration value in the storage device, and controls the vibration of the motor according to the vibration frequency determined by the first calibration value.
2. The method according to claim 1, characterized in that, The step of determining the first calibration value based on the waveform frequency corresponding to the fixed waveform and the first vibration frequency includes: The controller determines the difference between the waveform frequency and the first vibration frequency as the first calibration value.
3. The method according to claim 1, characterized in that, Before adding the first calibration value to the kernel command line, the method further includes: The controller determines whether the first calibration value is within the target range; If the controller determines that the first calibration value is within the target range, it adds the first calibration value to the kernel command line; or, If the controller determines that the first calibration value is not within the target range, it sets the first calibration value to the target value and adds the target value to the kernel command line.
4. The method according to any one of claims 1 to 3, characterized in that, The storage device includes registers.
5. The method according to claim 1, characterized in that, The method further includes: After the electronic device is powered off and restarted, the controller determines a second calibration value based on the fixed waveform and the first vibration frequency. The controller stores the second calibration value in the storage device so that the controller vibrates according to the second calibration value and the vibration frequency determined by the first vibration frequency.
6. A controller, characterized in that, include: A determination module is used to determine a first calibration value based on the waveform frequency corresponding to a fixed waveform and a first vibration frequency during the initialization phase of the electronic device startup, wherein the waveform frequency corresponding to the fixed waveform is a value that changes according to the electronic device, and the fixed waveform and the first vibration frequency are determined by the controller; A storage module is configured to add the first calibration value to the kernel command line during the kernel loading phase of the electronic device, and to obtain the first calibration value from the kernel command line during the kernel startup phase of the electronic device. The control module is used to store the first calibration value in a storage device and control the vibration of the motor according to the vibration frequency determined by the first calibration value.
7. A computing device, characterized in that, The controller includes a processor and a memory, the memory being used to store instructions, and the processor being used to execute the instructions stored in the memory to implement the method as described in any one of claims 1 to 5.
8. A computer storage medium, characterized in that, Includes program instructions, which, when executed by a computing device, implement the method as described in any one of claims 1 to 5.
9. A computer program product, characterized in that, The computer program product includes program instructions that, when executed by a controller, cause the computer to perform the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Method and device for determining resonant frequency of linear vibration device
CN108429507A