Motor closed-loop control method and electronic equipment

文档序号:1888568 发布日期:2021-11-26 浏览:5次 中文

阅读说明:本技术 一种马达闭环控制方法及电子设备 (Motor closed-loop control method and electronic equipment ) 是由 高营 程孝仁 于 2021-08-30 设计创作,主要内容包括:本申请公开了一种马达闭环控制方法及电子设备,通过在触摸装置接收到触摸操作时,为了模拟实体按键的震动,通过加速度传感器检测马达的第一震动参数,并与特定震动参数进行比较,从而对马达的驱动参数进行调节,以便于基于调节后的驱动参数实现马达的震动,从而实现了对马达震动参数的自动闭环调节,通过在马达震动时,只要震动参数不满足预设条件,就对马达的驱动参数进行调节,避免了马达的震动效果在模拟实体按键效果时不匹配的问题,提高了用户体验。(The application discloses motor closed-loop control method and electronic equipment, when touch operation is received by a touch device, in order to simulate vibration of an entity button, a first vibration parameter of a motor is detected through an acceleration sensor and is compared with a specific vibration parameter, so that a driving parameter of the motor is adjusted, vibration of the motor is realized based on the adjusted driving parameter, automatic closed-loop adjustment of the vibration parameter of the motor is realized, when the motor vibrates, the driving parameter of the motor is adjusted as long as the vibration parameter does not meet a preset condition, the problem that the vibration effect of the motor is not matched when the effect of the entity button is simulated is avoided, and user experience is improved.)

1. A motor closed-loop control method, comprising:

obtaining a first vibration parameter of a motor detected by an acceleration sensor, wherein the first vibration parameter of the motor is a parameter for simulating the vibration of an entity key generated when a touch device receives a touch operation;

comparing the detected first vibration parameter of the motor with a preset specific vibration parameter to obtain a comparison result;

and if the comparison result shows that the first vibration parameter does not meet the first preset condition, adjusting the driving parameter of the motor so as to control the vibration of the motor based on the adjusted driving parameter of the motor.

2. The method of claim 1, wherein the comparison result indicates that the first shock parameter does not satisfy a first preset condition, comprising:

and the difference value between the first vibration parameter and the preset specific vibration parameter exceeds a preset range, which indicates that the first vibration parameter does not meet a first preset condition.

3. The method according to claim 1, wherein the comparing the detected first vibration parameter of the motor with a preset specific vibration parameter to obtain a comparison result comprises:

and comparing the detected first vibration parameter of the motor at the first moment with a preset specific vibration parameter at the first moment to obtain a comparison result at the first moment.

4. The method of claim 1, wherein the adjusting the drive parameter of the motor comprises:

and adjusting the driving voltage of the motor based on the comparison result, and realizing the control of the vibration parameters of the motor by adjusting the amplitude and the frequency of the driving voltage of the motor.

5. The method of claim 1, wherein the adjusting the drive parameter of the motor comprises:

adjusting a driving voltage and a driving current of the motor based on a difference between the first vibration parameter and the specific vibration parameter.

6. The method of claim 5, wherein said adjusting a drive voltage and a drive current of the motor based on a difference between the first vibration parameter and the particular vibration parameter comprises:

determining a voltage offset and a current offset respectively based on a difference between the first vibration parameter and the specific vibration parameter;

determining a first driving voltage and a first driving current of the motor when the vibration parameter of the motor is a first vibration parameter;

an adjusted second drive voltage is determined based on a sum of the first drive voltage and the voltage offset, and an adjusted second drive current is determined based on a sum of the first drive current and the current offset.

7. The method of claim 6, further comprising:

controlling vibration of the motor based on a second driving voltage and a second driving current to obtain a second vibration parameter of the motor at the next moment detected by the acceleration sensor;

and comparing the second vibration parameter of the motor at the next moment with the specific vibration parameter at the moment corresponding to the next moment in the preset specific vibration parameters.

8. The method of claim 1, further comprising:

when a second preset condition is met, controlling the acceleration sensor arranged at the first position of the touch device to detect the vibration parameter of the motor positioned at the second position of the touch device;

wherein the second preset condition at least comprises: the structure of the electronic device provided with the touch device is changed, or an adjustment instruction for manually adjusting the driving parameters of the motor is received.

9. An electronic device, comprising:

a touch panel for receiving a touch operation;

the motor is used for generating vibration simulating the entity key when the touch panel receives touch operation;

the acceleration sensor is used for detecting a first vibration parameter of the motor, wherein the first vibration parameter is a parameter for simulating the vibration of an entity key generated when the touch panel receives touch operation;

the processor is used for obtaining a first vibration parameter of the motor detected by the acceleration sensor, and comparing the detected first vibration parameter with a preset specific vibration parameter to obtain a comparison result; and if the comparison result shows that the first vibration parameter does not meet the first preset condition, adjusting the driving parameter of the motor so as to control the vibration of the motor based on the adjusted driving parameter of the motor.

10. The electronic device of claim 9, wherein the processor adjusts drive parameters of the motor, comprising:

the processor adjusts a driving voltage and a driving current of the motor based on a difference between the first vibration parameter and the specific vibration parameter.

Technical Field

The present disclosure relates to the field of electronic information technologies, and in particular, to a motor closed-loop control method and an electronic device.

Background

When the touch device detects a touch, a motor arranged inside the touch device usually generates vibration, and a physical key is simulated in a vibration mode.

However, the vibration of the motor is fixed, and when the vibration effect of the motor needs to be adjusted, the adjusted vibration effect of the motor may not meet the vibration demand of the user.

Disclosure of Invention

In view of the above, the present application provides a motor closed-loop control method and an electronic device, and the specific scheme is as follows:

a motor closed-loop control method, comprising:

obtaining a first vibration parameter of a motor detected by an acceleration sensor, wherein the first vibration parameter of the motor is a parameter for simulating the vibration of an entity key generated when a touch device receives a touch operation;

comparing the detected first vibration parameter of the motor with a preset specific vibration parameter to obtain a comparison result;

and if the comparison result shows that the first vibration parameter does not meet the first preset condition, adjusting the driving parameter of the motor so as to control the vibration of the motor based on the adjusted driving parameter of the motor.

Further, the comparison result shows that the first vibration parameter does not satisfy a first preset condition, including:

and the difference value between the first vibration parameter and the preset specific vibration parameter exceeds a preset range, which indicates that the first vibration parameter does not meet a first preset condition.

Further, the comparing the detected first vibration parameter of the motor with a preset specific vibration parameter to obtain a comparison result, including:

and comparing the detected first vibration parameter of the motor at the first moment with a preset specific vibration parameter at the first moment to obtain a comparison result at the first moment.

Further, the adjusting the driving parameter of the motor includes:

and adjusting the driving voltage of the motor based on the comparison result, and realizing the control of the vibration parameters of the motor by adjusting the amplitude and the frequency of the driving voltage of the motor.

Further, the adjusting the driving parameter of the motor includes:

adjusting a driving voltage and a driving current of the motor based on a difference between the first vibration parameter and the specific vibration parameter.

Further, the adjusting the driving voltage and the driving current of the motor based on the difference between the first vibration parameter and the specific vibration parameter includes:

determining a voltage offset and a current offset respectively based on a difference between the first vibration parameter and the specific vibration parameter;

determining a first driving voltage and a first driving current of the motor when the vibration parameter of the motor is a first vibration parameter;

an adjusted second drive voltage is determined based on a sum of the first drive voltage and the voltage offset, and an adjusted second drive current is determined based on a sum of the first drive current and the current offset.

Further, the method also comprises the following steps:

controlling vibration of the motor based on a second driving voltage and a second driving current to obtain a second vibration parameter of the motor at the next moment detected by the acceleration sensor;

and comparing the second vibration parameter of the motor at the next moment with the specific vibration parameter at the moment corresponding to the next moment in the preset specific vibration parameters.

Further, the method also comprises the following steps:

when a second preset condition is met, controlling the acceleration sensor arranged at the first position of the touch device to detect the vibration parameter of the motor positioned at the second position of the touch device;

wherein the second preset condition at least comprises: the structure of the electronic device provided with the touch device is changed, or an adjustment instruction for manually adjusting the driving parameters of the motor is received.

An electronic device, comprising:

a touch panel for receiving a touch operation;

the motor is used for generating vibration simulating the entity key when the touch panel receives touch operation;

the acceleration sensor is used for detecting a first vibration parameter of the motor, wherein the first vibration parameter is a parameter for simulating the vibration of an entity key generated when the touch panel receives touch operation;

the processor is used for obtaining a first vibration parameter of the motor detected by the acceleration sensor, and comparing the detected first vibration parameter with a preset specific vibration parameter to obtain a comparison result; and if the comparison result shows that the first vibration parameter does not meet the first preset condition, adjusting the driving parameter of the motor so as to control the vibration of the motor based on the adjusted driving parameter of the motor.

Further, the processor adjusts a drive parameter of the motor, including:

the processor adjusts a driving voltage and a driving current of the motor based on a difference between the first vibration parameter and the specific vibration parameter.

According to the technical scheme, the motor closed-loop control method and the electronic device disclosed by the application can be used for obtaining the first vibration parameter of the motor detected by the acceleration sensor, wherein the first vibration parameter of the motor is a parameter simulating the vibration of an entity key when the touch device receives touch operation, comparing the detected first vibration parameter of the motor with a preset specific vibration parameter to obtain a comparison result, and if the comparison result shows that the first vibration parameter does not meet a first preset condition, adjusting the driving parameter of the motor so as to control the vibration of the motor based on the adjusted driving parameter of the motor. This scheme is through when touch device receives the touch operation, in order to simulate the vibrations of entity button, detect the first vibrations parameter of motor through acceleration sensor, and compare with specific vibrations parameter, thereby adjust the drive parameter of motor, so that realize the vibrations of motor based on the drive parameter after adjusting, thereby realized the automatic closed loop to motor vibrations parameter and adjusted, through when the motor shakes, as long as the vibrations parameter is unsatisfied and predetermines the condition, just adjust the drive parameter of motor, the unmatched problem of the vibrations effect of motor when simulating entity button effect has been avoided, user experience has been improved.

Drawings

In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.

FIG. 1 is a flow chart of a method for closed-loop control of a motor according to an embodiment of the present disclosure;

FIG. 2 is a flow chart of a method for closed-loop control of a motor according to an embodiment of the present disclosure;

FIG. 3 is a schematic diagram illustrating a comparison between a current vibration curve and a specific vibration curve according to an embodiment of the present disclosure;

FIG. 4 is a schematic diagram illustrating a comparison between a current vibration curve and a specific vibration curve according to an embodiment of the present disclosure;

FIG. 5 is a schematic diagram illustrating a comparison between a current vibration curve and a specific vibration curve according to an embodiment of the present disclosure;

fig. 6 is a schematic diagram illustrating a comparison between a vibration curve of a motor and a specific vibration curve according to an embodiment of the present disclosure;

FIG. 7 is a flowchart of a method for closed-loop control of a motor according to an embodiment of the present disclosure;

FIG. 8 is a schematic diagram illustrating a comparison between an initial driving waveform and a specific driving waveform according to an embodiment of the present application;

fig. 9 is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

The application discloses a motor closed-loop control method, a flow chart of which is shown in figure 1, comprising the following steps:

step S11, obtaining a first vibration parameter of the motor detected by the acceleration sensor, wherein the first vibration parameter of the motor is a parameter for simulating the vibration of the entity key generated when the touch device receives the touch operation;

step S12, comparing the detected first vibration parameter of the motor with a preset specific vibration parameter to obtain a comparison result;

and step S13, if the comparison result indicates that the first vibration parameter does not satisfy the first preset condition, adjusting the driving parameter of the motor so as to control the vibration of the motor based on the adjusted driving parameter of the motor.

For a touch device, a motor is usually disposed inside the device, and the vibration of the physical key is simulated by the vibration of the motor. Specifically, when a user touches the touch device, the touch device detects the touch, and controls the motor to vibrate based on the touch.

The vibration of the motor is fixed, and when the vibration effect of the motor needs to be adjusted, no matter how the vibration effect is adjusted by a user, the adjusted vibration effect may cause the problem that the vibration requirement of the user cannot be met.

In order to solve the problem, in the scheme, an area needing vibration on the touch device is determined, the acceleration sensor is arranged on the basis of the area, so that the vibration parameter of the motor can be detected through the acceleration sensor, and when the vibration parameter of the motor is determined to meet a preset condition, the driving parameter of the motor is adjusted, so that the vibration parameter of the motor after the driving parameter is adjusted under the driving of the driving parameter can meet the preset condition.

The touch panel of the touch device needs to simulate the vibration of the physical keys, the motor is arranged below the touch panel on the touch device, and similarly, the acceleration sensor is also arranged below the touch panel on the touch device. The motor may be disposed below the middle position of the touch panel, and the acceleration sensor is typically disposed below the touch panel at a position farthest from the motor when contacting the touch panel.

When a touch panel of the touch device receives touch operation, the motor simulates vibration of a physical key based on the touch operation, the acceleration sensor detects vibration parameters of the motor while the motor vibrates, the vibration parameters of the motor detected by the acceleration sensor can indicate the vibration of the motor felt by the touch panel at the position of the acceleration sensor, and whether the vibration of the motor needs to be adjusted or not is determined based on the vibration parameters.

And comparing the first vibration parameter of the motor detected by the acceleration sensor with a preset specific vibration parameter, and determining whether the first vibration parameter meets a first preset condition or not based on the comparison result.

If the first vibration parameter meets the first preset condition, the vibration of the motor is determined to meet the vibration demand of the user when the user touches the touch panel, and at the moment, the vibration of the motor is not required to be adjusted;

if the first vibration parameter does not satisfy the first preset condition, it indicates that the vibration caused by the vibration of the motor when the user touches the touch panel does not meet the vibration requirement of the user, and therefore the vibration of the motor needs to be adjusted, specifically the drive parameter of the motor is adjusted, and the motor is driven by the drive parameter to vibrate, so that the vibration parameter is generated.

Further, determining whether the first vibration parameter satisfies a first preset condition based on the comparison result may be:

if the difference value between the first vibration parameter and the preset specific vibration parameter exceeds the preset range, the first vibration parameter is indicated to not meet a first preset condition; if the difference value between the first vibration parameter and the preset specific vibration parameter does not exceed the preset range, the first vibration parameter is indicated to meet a first preset condition.

Further, the following may be possible: as long as the first vibration parameter is different from the preset specific vibration parameter, the vibration of the motor is adjusted to ensure that the difference between the first vibration parameter and the preset specific vibration parameter is reduced in the subsequent vibration of the motor until the first vibration parameter and the preset specific vibration parameter are approximately the same, so that the vibration effect of the motor is optimal.

Specifically, as long as a first vibration parameter is detected and it is determined that the first vibration parameter is different from a preset specific vibration parameter, a driving parameter of the motor is adjusted, after the adjustment, the vibration parameter of the motor is continuously detected, whether the current vibration parameter of the motor is the same as the preset specific vibration parameter is repeatedly detected, and when the current vibration parameter of the motor is different from the preset specific vibration parameter, the adjustment of the driving parameter of the motor is repeatedly performed until the vibration parameter of the motor is the same as the preset specific vibration parameter after the driving parameter of the motor is adjusted, so that the closed-loop control of the motor is completed.

Specifically, the motor control method disclosed in this embodiment may be applied to a Forcepad touch pad below a physical key in a notebook computer, and when a user touches the Forcepad with a hand, a motor in the Forcepad may generate vibration, so as to simulate the physical key and further adjust a vibration parameter of the vibration, where adjusting the vibration parameter of the vibration may be performed by a processor of the notebook computer, such as: the CPU executes, and can also directly execute the adjusting operation of the vibration parameter of the motor through a Forcepad controller.

The motor closed-loop control method disclosed in this embodiment obtains a first vibration parameter of a motor detected by an acceleration sensor, where the first vibration parameter of the motor is a parameter simulating physical key vibration when a touch device receives a touch operation, compares the detected first vibration parameter of the motor with a preset specific vibration parameter to obtain a comparison result, and adjusts a driving parameter of the motor if the comparison result indicates that the first vibration parameter does not satisfy a first preset condition, so as to control vibration of the motor based on the adjusted driving parameter of the motor. This scheme is through when touch device receives the touch operation, in order to simulate the vibrations of entity button, detect the first vibrations parameter of motor through acceleration sensor, and compare with specific vibrations parameter, thereby adjust the drive parameter of motor, so that realize the vibrations of motor based on the drive parameter after adjusting, thereby realized the automatic closed loop to motor vibrations parameter and adjusted, through when the motor shakes, as long as the vibrations parameter is unsatisfied and predetermines the condition, just adjust the drive parameter of motor, the unmatched problem of the vibrations effect of motor when simulating entity button effect has been avoided, user experience has been improved.

The present embodiment discloses a motor closed-loop control method, a flowchart of which is shown in fig. 2, and includes:

step S21, obtaining a first vibration parameter of the motor detected by the acceleration sensor, wherein the first vibration parameter of the motor is a parameter for simulating the vibration of the entity key generated when the touch device receives the touch operation;

step S22, comparing the detected first vibration parameter of the motor at the first moment with a preset specific vibration parameter at the first moment to obtain a comparison result at the first moment;

and step S23, if the comparison result at the first moment indicates that the first vibration parameter does not satisfy the first preset condition, adjusting the driving parameter of the motor so as to control the vibration of the motor based on the adjusted driving parameter of the motor.

The acceleration sensor detects a first vibration parameter of the motor, which actually detects the vibration parameter in a time period, and when the acceleration sensor is compared with a specific vibration parameter, the acceleration sensor compares a detected time in the time period with the specific vibration parameter corresponding to the time.

Specifically, the following may be mentioned: the acceleration sensor detects a first vibration parameter of the motor in a time period, determines a specific vibration parameter corresponding to the time period, determines a first moment according to a time sequence, the first moment is the moment when the first vibration parameter determined for the first time by the processor is different from the specific vibration parameter, compares a difference value between the first vibration parameter and the specific vibration parameter at the moment, and if the difference value exceeds a preset range, needs to adjust the vibration of the motor.

Furthermore, the first vibration parameter detected in a time period can be drawn into a curve, namely a current vibration curve; and drawing the specific vibration parameters in the time period corresponding to the time period into a curve, namely a specific vibration curve, or comparing the two curves to determine different positions of the curve for the optimal vibration curve, and adjusting the driving parameters of the motor at the time corresponding to the position so as to enable the vibration parameters of the adjusted motor to be the same as or approximate to the specific vibration parameters.

As shown in fig. 3, the schematic diagram is a comparison between a current vibration curve corresponding to a detected vibration parameter before the vibration of the motor is adjusted and a specific vibration curve, wherein an abscissa is time and an ordinate is a first vibration parameter detected by the acceleration sensor, and as can be seen from fig. 3, a difference between the current vibration curve and the specific vibration curve is large;

based on the comparison between the current vibration curve and the specific vibration curve in fig. 3, the driving parameters of the motor are automatically adjusted, and after the adjustment, when the user touches the touch panel of the touch device, the acceleration sensor detects the first vibration parameter of the adjusted motor and obtains the corresponding specific vibration parameter.

As shown in fig. 4, the diagram is a schematic diagram of comparing a current vibration curve corresponding to a detected vibration parameter after the vibration of the motor is adjusted for one time with a specific vibration curve, and after the adjustment for one time, a difference between the current vibration curve and the specific vibration curve is reduced;

based on the comparison between the current vibration curve and the specific vibration curve in fig. 4, since the current vibration curve and the specific vibration curve are not completely the same, the driving parameters of the motor are continuously adjusted automatically, and after the adjustment, when the user touches the touch panel of the touch device, the acceleration sensor detects the first vibration parameter of the motor after the adjustment again, and obtains the corresponding specific vibration parameter.

As shown in fig. 5, the schematic diagram of comparing the current vibration curve corresponding to the detected vibration parameter with the specific vibration curve after the vibration of the motor is adjusted again is shown, after the secondary adjustment, the current vibration curve is overlapped with the specific vibration curve, which indicates that the first vibration parameter is the same as the specific vibration parameter, and the vibration effect of the motor meets the user requirement, and reaches the optimum state, and the secondary adjustment is not needed.

Further, as shown in fig. 6, the abscissa is time, and the ordinate is a first vibration parameter, which may specifically be: after the driving parameters of the motor are adjusted for multiple times, the first vibration parameters of the motor are the same as the specific vibration parameters, so that the current vibration curve is overlapped with the specific vibration curve, namely, the driving parameters of the motor are adjusted for multiple times before 10 ms.

It should be noted that the curve matching and adjustment shown in fig. 3-6 are merely an illustration of one expression of the comparison between the first vibration parameter and the specific vibration parameter, and are not limited herein. For example: the first vibration parameter can be the same as the specific vibration parameter after 2 times of adjustment, or multiple times; alternatively, the curve of the first vibration parameter corresponding to the specific vibration parameter is not limited to the waveform shown in the figure, and may be other waveforms not shown.

Further, the method can also comprise the following steps:

when a second preset condition is met, controlling an acceleration sensor arranged at a first position of the touch device to detect a vibration parameter of a motor at a second position of the touch device; wherein the second preset condition at least comprises: the structure of the electronic device provided with the touch device is changed, or an adjustment instruction for manually adjusting the driving parameter of the motor is received.

The acceleration sensor detects a first vibration parameter of the motor, the first vibration parameter is not detected in real time, if the acceleration sensor monitors the first vibration parameter of the motor in real time and compares the first vibration parameter with a specific vibration parameter, the consumption of electric energy caused by real-time operation of the acceleration sensor can be caused, and the occupation of processing resources of a processor for comparing the first vibration parameter with the specific vibration parameter can be caused.

When the structure of the electronic device provided with the touch device is determined to be changed, the structure of the electronic device is changed, which may cause a slight change in structure between the motor and the touch panel on the touch device, so that when a user touches the touch panel, the motor simulates the vibration of the physical key, and the vibration parameter of the motor cannot meet the vibration requirement of the user.

In addition, when the device or the processor receives an adjusting instruction for manually adjusting the driving parameter of the motor, it indicates that the user has adjusted or is adjusting the motor, and in order to ensure that the vibration effect of the motor can still meet the vibration requirement when the touch operation occurs after the user manually adjusts the driving parameter of the motor, the first vibration parameter of the motor needs to be detected, so that the problem that the vibration effect of the motor cannot meet the vibration requirement or is not matched with the vibration of the physical key is avoided.

The motor closed-loop control method disclosed in this embodiment obtains a first vibration parameter of a motor detected by an acceleration sensor, where the first vibration parameter of the motor is a parameter simulating physical key vibration when a touch device receives a touch operation, compares the detected first vibration parameter of the motor with a preset specific vibration parameter to obtain a comparison result, and adjusts a driving parameter of the motor if the comparison result indicates that the first vibration parameter does not satisfy a first preset condition, so as to control vibration of the motor based on the adjusted driving parameter of the motor. This scheme is through when touch device receives the touch operation, in order to simulate the vibrations of entity button, detect the first vibrations parameter of motor through acceleration sensor, and compare with specific vibrations parameter, thereby adjust the drive parameter of motor, so that realize the vibrations of motor based on the drive parameter after adjusting, thereby realized the automatic closed loop to motor vibrations parameter and adjusted, through when the motor shakes, as long as the vibrations parameter is unsatisfied and predetermines the condition, just adjust the drive parameter of motor, the unmatched problem of the vibrations effect of motor when simulating entity button effect has been avoided, user experience has been improved.

The present embodiment discloses a motor closed-loop control method, a flowchart of which is shown in fig. 7, and includes:

step S71, obtaining a first vibration parameter of the motor detected by the acceleration speed sensor, wherein the first vibration parameter of the motor is a parameter for simulating the vibration of the entity key generated when the touch device receives the touch operation;

step S72, comparing the detected first vibration parameter of the motor with a preset specific vibration parameter to obtain a comparison result;

and step S73, if the comparison result shows that the first vibration parameter does not meet the first preset condition, adjusting the driving voltage of the motor based on the comparison result, and realizing the control of the vibration parameter of the motor by adjusting the amplitude and the frequency of the driving voltage of the motor.

The motor driving parameters are adjusted by adjusting the driving voltage of the motor, and the vibration parameters of the motor are adjusted by adjusting the driving voltage of the motor.

The amplitude and the frequency of the driving voltage of the motor are adjusted, so that the driving current of the motor is changed, and the vibration parameter of the motor is changed.

As shown in fig. 8, the abscissa is time, and the ordinate is driving voltage, and fig. 8 includes: the driving method includes an initial driving waveform and a specific driving waveform, wherein the initial driving waveform is an actual driving voltage value of the motor at different moments, and the specific driving waveform is a specific driving voltage value of the motor at different moments.

The actual driving voltage is different from the amplitude and the duty ratio of the specific driving voltage, and the vibration parameters of the motor based on the driving voltage are changed by adjusting the amplitude and the duty ratio.

Alternatively, the following may be used: and adjusting the driving voltage and the driving current of the motor based on the difference value between the first vibration parameter and the specific vibration parameter.

The driving voltage and the driving current are adjusted simultaneously through the difference between the first vibration parameter and the specific vibration parameter, and the driving current is adjusted through the change of the driving voltage after the driving voltage is not required to be adjusted based on the difference.

Further, respectively determining a voltage offset and a current offset based on a difference value between the first vibration parameter and the specific vibration parameter; determining a first driving voltage and a first driving current of the motor when the vibration parameter of the motor is a first vibration parameter; an adjusted second drive voltage is determined based on the sum of the first drive voltage and the voltage offset, and an adjusted second drive current is determined based on the sum of the first drive current and the current offset.

Specifically, a curve data table C (g, t) is established for representing a relationship curve between the detected vibration parameter and time, and a corresponding driving waveform H (V, I, t) is established for representing a corresponding relationship between the driving voltage and the driving current corresponding to the vibration parameter and the time.

Determining a vibration parameter Gn acquired by an acceleration sensor at the moment Tn, wherein the specific vibration parameter Gcn in a specific curve corresponding to the moment Tn is determined; and determining the difference value delta Gn between the vibration parameter at the moment Tn and the specific vibration parameter, namely Gn-Gcn.

Determining the voltage offset may be determining by a first relationship, the first relationship being: Δ Vn=αΔGnCn(gn,tn) (ii) a Determining the current offset may be determined by a second relationship, the second relationship being: delta In=βΔGnCn(gn,tn) Wherein, alpha and beta are coefficients.

Determining an adjusted second driving voltage based on the voltage offset and an adjusted second driving current based on the current offset, wherein the second driving voltage and the second driving current are respectively TnThe driving voltage and the driving current of the motor at the next moment, i.e. the second driving voltage is Tn+1The second driving current is Tn+1The drive current of the motor at the moment.

Namely: vn+1=Vn+ΔVn,In+1=In+ΔIn

And controlling the vibration of the motor based on the second driving voltage and the second driving current to obtain a second vibration parameter of the motor at the next moment detected by the acceleration sensor when the touch operation exists, and comparing the second vibration parameter of the motor at the next moment with a specific vibration parameter at a moment corresponding to the next moment in preset specific vibration parameters.

And comparing the second vibration parameter of the motor at the next moment with the preset specific vibration parameter at the moment corresponding to the next moment, namely actually comparing whether the vibration curve at the next moment is consistent with the specific vibration curve or not, if not, repeating the process, adjusting the driving voltage and the driving current of the motor until convergence, and taking the adjusted driving waveform as the driving waveform after the touch device is calibrated.

The motor closed-loop control method disclosed in this embodiment obtains a first vibration parameter of a motor detected by an acceleration sensor, where the first vibration parameter of the motor is a parameter simulating physical key vibration when a touch device receives a touch operation, compares the detected first vibration parameter of the motor with a preset specific vibration parameter to obtain a comparison result, and adjusts a driving parameter of the motor if the comparison result indicates that the first vibration parameter does not satisfy a first preset condition, so as to control vibration of the motor based on the adjusted driving parameter of the motor. This scheme is through when touch device receives the touch operation, in order to simulate the vibrations of entity button, detect the first vibrations parameter of motor through acceleration sensor, and compare with specific vibrations parameter, thereby adjust the drive parameter of motor, so that realize the vibrations of motor based on the drive parameter after adjusting, thereby realized the automatic closed loop to motor vibrations parameter and adjusted, through when the motor shakes, as long as the vibrations parameter is unsatisfied and predetermines the condition, just adjust the drive parameter of motor, the unmatched problem of the vibrations effect of motor when simulating entity button effect has been avoided, user experience has been improved.

The embodiment discloses an electronic device, a schematic structural diagram of which is shown in fig. 9, including:

a touch panel 91, a motor 92, an acceleration sensor 93, and a processor 94.

The touch panel 91 is used for receiving a touch operation;

the motor 92 is used for generating vibration simulating a physical key when the touch panel receives touch operation;

the acceleration sensor 93 is configured to detect a first vibration parameter of the motor, where the first vibration parameter is a parameter that simulates physical key vibration generated when the touch panel receives a touch operation;

the processor 94 is configured to obtain a first vibration parameter of the motor detected by the acceleration sensor, and compare the detected first vibration parameter with a preset specific vibration parameter to obtain a comparison result; and if the comparison result shows that the first vibration parameter does not meet the first preset condition, adjusting the driving parameter of the motor so as to control the vibration of the motor based on the adjusted driving parameter of the motor.

Further, the comparison result shows that the first vibration parameter does not satisfy a first preset condition, including:

and if the difference value between the first vibration parameter and the preset specific vibration parameter exceeds the preset range, the first vibration parameter does not meet the first preset condition.

Further, the processor compares the detected first vibration parameter of the motor with a preset specific vibration parameter to obtain a comparison result, including:

the processor compares the detected first vibration parameter of the motor at the first moment with a preset specific vibration parameter at the first moment to obtain a comparison result at the first moment.

Further, the processor adjusts a drive parameter of the motor, including:

the processor adjusts the driving voltage of the motor based on the comparison result, and realizes the control of the vibration parameters of the motor through the adjustment of the amplitude and the frequency of the driving voltage of the motor.

Further, the processor adjusts a drive parameter of the motor, including:

the processor adjusts the driving voltage and the driving current of the motor based on the difference value between the first vibration parameter and the specific vibration parameter.

Further, the processor adjusts the driving voltage and the driving current of the motor based on the difference between the first vibration parameter and the specific vibration parameter, including:

the processor respectively determines a voltage offset and a current offset based on a difference value between the first vibration parameter and the specific vibration parameter; determining a first driving voltage and a first driving current of the motor when the vibration parameter of the motor is a first vibration parameter; an adjusted second drive voltage is determined based on the sum of the first drive voltage and the voltage offset, and an adjusted second drive current is determined based on the sum of the first drive current and the current offset.

Further, the processor is further configured to:

controlling the vibration of the motor based on the second driving voltage and the second driving current to obtain a second vibration parameter of the motor at the next moment detected by the acceleration sensor;

and comparing the second vibration parameter of the motor at the next moment with the specific vibration parameter at the moment corresponding to the next moment in the preset specific vibration parameters.

Further, the processor is further configured to:

when a second preset condition is met, controlling an acceleration sensor arranged at a first position of the touch device to detect a vibration parameter of a motor at a second position of the touch device;

wherein the second preset condition at least comprises: the structure of the electronic device provided with the touch device is changed, or an adjustment instruction for manually adjusting the driving parameters of the motor is received.

The processor in the present embodiment may be a processor of the touch device, or may be a processor of an electronic apparatus provided with the touch device.

The electronic device disclosed in this embodiment is implemented based on the motor closed-loop control method disclosed in the above embodiment, and is not described herein again.

The electronic device disclosed in this embodiment obtains a first vibration parameter of the motor detected by the acceleration sensor, where the first vibration parameter of the motor is a parameter simulating physical key vibration when the touch device receives a touch operation, compares the detected first vibration parameter of the motor with a preset specific vibration parameter to obtain a comparison result, and adjusts a driving parameter of the motor if the comparison result indicates that the first vibration parameter does not satisfy a first preset condition, so as to control vibration of the motor based on the adjusted driving parameter of the motor. This scheme is through when touch device receives the touch operation, in order to simulate the vibrations of entity button, detect the first vibrations parameter of motor through acceleration sensor, and compare with specific vibrations parameter, thereby adjust the drive parameter of motor, so that realize the vibrations of motor based on the drive parameter after adjusting, thereby realized the automatic closed loop to motor vibrations parameter and adjusted, through when the motor shakes, as long as the vibrations parameter is unsatisfied and predetermines the condition, just adjust the drive parameter of motor, the unmatched problem of the vibrations effect of motor when simulating entity button effect has been avoided, user experience has been improved.

The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.

Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.

The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:电子装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类