This application claims priority to Taiwan Application Serial Number 110145541, filed Dec. 6, 2021, which is herein incorporated by reference in its entirety.
This disclosure relates to the input device and control method thereof, and in particular to the input device, which has the relative encoder and the absolute encoder, and control method thereof.
There are two kinds of rotary encoder in current mouse: relative encoder (e.g., mechanical rotary encoder or optical rotary encoder) and absolute encoder (e.g., magnetic rotary encoder).
The relative encoder often abnormally outputs due to mechanical damage and dust accumulation. Therefore, the service life of the mouse which adapts the relative encoder is usually short.
The absolute encoder often occurs output error due to the mismatch between the magnetic field and Hall device. Therefore, the absolute encoder needs to be calibrated according to the motion of the mouse's roller before leaving factory generally. However, if there is a problem (for example, incorrect magnetic induction due to temperature change, mechanical structure damaged due to drop of the mouse) after the absolute encoder leaves factory, the mouse cannot be normally used because it is unable to calibrate the absolute encoder again.
An aspect of present disclosure relates to a control method of an input device. The control method includes: obtaining current angle data outputted by an absolute encoder according to a target phase of at least one signal outputted by a relative encoder; obtaining a current position number corresponding to the current angle data according to the current angle data; calculating a number difference according to the current position number and a previous position number; and outputting the number difference.
Another aspect of present disclosure relates to a control method of an input device. The control method includes: obtaining first angle data and second angle data outputted by an absolute encoder according to two adjacent target phases of at least one signal outputted by a relative encoder; if a difference value between the first angle data and the second angle data is smaller than or equal to a predetermined angle value, using the first angle data or the second angle data as current angle data; obtaining a current position number corresponding to the current angle data according to the current angle data; calculating a number difference according to the current position number and a previous position number; and outputting the number difference.
Another aspect of present disclosure relates to an input device. The input device is coupled to a computer device, wherein the computer device is configured to display a displayed screen, and the input device includes a roller module, a relative encoder, an absolute encoder, and a processor. The roller module is configured to generate a motion in response to a user operation. The relative encoder is configured to generate at least one signal according to the motion of the roller module. The absolute encoder is configured to output a rotation angle of the roller module with respect to a reference position according to the motion of the roller module. The processor is configured to execute following steps: obtaining current angle data outputted by an absolute encoder when the at least one signal is in a target phase; obtaining a current position number corresponding to the current angle data according to the current angle data; calculating a number difference according to the current position number and a previous position number; and outputting the number difference.
The embodiments are described in detail below with reference to the appended drawings to better understand the aspects of the present disclosure. However, the provided embodiments are not intended to limit the scope of the disclosure, and the description of the structural operation is not intended to limit the order in which they are performed. Any device that has been recombined by components and produces an equivalent function is within the scope covered by the disclosure.
The terms used in the entire specification and the scope of the patent application, unless otherwise specified, generally have the ordinary meaning of each term used in the field, the content disclosed herein, and the particular content.
The terms “coupled” or “connected” as used herein may mean that two or more elements are directly in physical or electrical contact, or are indirectly in physical or electrical contact with each other. It can also mean that two or more elements interact with each other.
Referring to
As shown in
In some embodiments, the relative encoder 102 can be implemented by mechanical rotary encoder or optical rotary encoder. The absolute encoder 103 can be implemented by magnetic rotary encoder. The processor 104 can be implemented by one or more central processing unit (CPU), application-specific integrated circuit (ASIC), microprocessor, system on a Chip (SoC) or other suitable processing units. The storage 105 can be implemented by memory.
It can be appreciated that the roller module 101 can generate a motion (e.g., rotation) in response to the user operation. When generating the motion, the roller module 101 would drive the relative encoder 102 and the absolute encoder 103 to act synchronously. In such way, the relative encoder 102 can generate at least one signal Sp according to the motion of the roller module 101, and the absolute encoder 103 can output a rotation angle Sa according to the motion of the roller module 101. In some embodiments, the rotation angle Sa is an angle at which the roller module 101 rotates around an axle center with respect to a reference position (for example, a position that the roller module 101 has not been rotated). In other words, the rotation angle Sa is a kind of absolute information.
In some embodiments, the storage 105 can store a lookup list. Referring to Table 1, Table 1 depicts a lookup list in accordance with some embodiments of the present disclosure. In particular, the lookup list includes a plurality of angle values Va and a plurality of position numbers Np corresponding to the angle values Va. Each of the position number Np is corresponding to a specific position of the roller module 101. For example, the number (1) represents that the roller module 101 is at the aforementioned reference position, thereby corresponding to the angle of 0°. It can be appreciated that the numerical values in Table 1 are only for descriptive purpose and are not used to limit the present disclosure.
In some embodiments, the signal Sp outputted by the relative encoder 102 has multiple different phases (which would be described in detail later). The phases of the signal Sp include at least one target phase (which would be described in detail later), and the target phase is configured to trigger the processor 104 to perform related operations. In particular, the processor 104 can obtain the rotation angle Sa currently outputted by the absolute encoder 103 when the signal Sp is in the target phase. Then, the processor 104 can find the position number Np (which would be described in detail later) corresponding to the currently outputted rotation angle Sa by the lookup list (e.g., Table 1) stored in the storage 105 and can generate a number difference as the output signal Sout according to the currently found position number Np and the previously found position number Np, so as to output the output signal Sout to the computer device 20. It can be appreciated that the number difference can be positive or negative integer. In some practical applications, the computer device 20 controls a page of a window in the displayed screen 201 to scroll upwards or downwards according to the positive or negative integer.
In some embodiments, when the relative encoder 102 normally operates, the absolute encoder 103 might output incorrect rotation angle Sa due to the influence of the magnetic field and Hall device. In other words, there might be error in the rotation angle Sa. In view of this, the processor 104 can calculate an angle difference according to the currently outputted rotation angle Sa and the angle value Va corresponding to the currently found position number Np and can determine whether or not the angle difference is smaller than or equal to an error range (e.g., ±3°). In addition, the processor 104 can further selectively update the angle value Va corresponding to the currently found position number Np according to the determination result, so as to solve the error problem of the rotation angle Sa.
In some embodiments, the relative encoder 102 would output abnormal signal Sp due to the influence of mechanical damage or dusts (that is, the relative encoder 102 abnormally operates), which results in the processor 104 reading the output of the absolute encoder 103 at the wrong time. In particular, since a time difference between two adjacent target phases of the abnormal signal Sp might be too small, two rotation angles Sa that the processor 104 obtains according to the two adjacent target phases might be close. In other words, a difference value between the two rotation angles Sa might be smaller than normal value. In view of this, the processor 104 can determine whether or not the difference value between the two rotation angles Sa obtained according to the two adjacent target phases is smaller than or equal to a predetermined angle value (for example 10°). If the determination result shows that the difference value between the two rotation angles Sa is smaller than or equal to the predetermined angle value, the processor 104 can further perform related operations (which would be described in detail later) to avoid performing calculation based on wrong information.
The operation of the input device 10 when the relative encoder 102 normally operates is described below with reference to
In step S201, current angle data outputted by the absolute encoder is obtained according to the target phase of at least one signal outputted by the relative encoder. Referring to
In step S202, a current position number corresponding to the current angle data is obtained according to the current angle data. In some embodiments, the processor 104 can obtain the current position number corresponding to the current angle data by the lookup list. For example, the current angle data is 37°. The processor 104 would compare the current angle data with multiple angle values Va in the lookup list to find one angle value Va (e.g., 30°) closest to the current angle data. Then, the processor 104 obtains the number (3) corresponding to the angle value Va of 30° as the current position number. For another example, the current angle data is 67.5°. The angle value Va closest to 67.5° in the lookup list might be 60° or 75°. At this time, the processor 104 is further configured to determine the angle value Va closest to 67.5° to be 60° or 75° according to a determination trend of the processor 104 when obtaining the position numbers corresponding to previous sets of angle data. It is assumed that a previous angle data is 37° and the processor 104 determines the angle value Va closet to the previous angle data in the lookup list to be 30°. Since last time the processor 104 chooses the angle value Va which is smaller than the angle data outputted by the absolute encoder 103, the processor 104 this time would also choose the angle value Va (i.e., 60°) which is smaller than the current angle data and would regard the number (5) corresponding to the angle value Va of 60° in the lookup list as the current position number.
In step S203, a number difference is calculated according to the current position number and a previous position number. It can be appreciated that the previous position number is the current positon number that the processor 104 obtains last time and can be stored in the storage 105. For example, the current position number that the processor 104 obtains last time is the number (5). The processor 104 would subtract “5” (i.e., the previous position number) from “3” (i.e., the current position number), so as to calculate that the number difference is “−2”.
In step S204, the number difference is outputted. In some embodiments, as shown in
As shown in
In step S206, it is determined whether the angle difference is in an error range. In some embodiments, the error range is ±3°. The description is made by taking the above-described example, since the angle difference of 7° is greater than 3°, the processor 104 determines that the angle difference exceeds the error range. Since the angle difference exceeds the error range, the processor 104 performs step S207.
In step S207, the previous angle data is replaced with the current angle data. The description is made by taking the above-described example, the processor 104 updates the angle value Va corresponding to the current position number (e.g., the number (3)) in the lookup list from 30° (i.e., the previous angle data) to 37° (i.e., the current angle data).
In another example, the processor 104 determines that the angle difference does not exceed the error range, and thereby performing step S208. In step S208, the previous angle data is reserved. For example, the processor 104 would not update the angle value Va in the lookup list, so that the angle value Va corresponding to the current position number (e.g., the number (3)) in the lookup list is still 30° (i.e., the previous angle data). In other embodiments, step S208 is omitted. In other words, after determining the angle difference does not exceed the error range, the processor 104 can perform no operation.
It can be seen from the description of the control method 200 that in the condition that the relative encoder 102 normally operates, the input device 10 not only can accurately generate the output signal Sout according to the outputs of the relative encoder 102 and the absolute encoder 103, but also can calibrate the output error of the absolute encoder 103 according to the output of the relative encoder 102.
The operation of the input device 10 when the relative encoder 102 might abnormally operate is described below with reference to
Referring to
In order to avoid reading the output of the absolute encoder 103 at the wrong time, the processor 104 performs step S401. In step S401, first angle data and second angle data outputted by the absolute encoder are obtained according to two adjacent target phases of at least one signal outputted by the relative encoder. In some embodiments, as shown in
Since the time difference between two adjacent target phases of the abnormal signal (i.e., the third signal Sp3 and the fourth signal Sp4) might be too small (which might result in that the first angle data and the second angle data are close to each other), the processor 104 then performs step S402. In step S402, it is determined whether or not a difference value between the first angle data and the second angle data is smaller than or equal to a predetermined angle value. For example, the predetermined angle value is 10°. In some embodiments, since the first angle data subtracted from the second angle data is 8.6°, the processor 104 determines that the difference value between the first angle data and the second angle data is smaller than the predetermined angle value, so as to perform step S403. It can be appreciated that if the first angle data subtracted from the second angle data is negative value, the processor 104 can first perform an absolute value calculation on the difference value between the first angle data and the second angle data, and then compare the absolute value of the difference value with the predetermined angle value.
In step S403, the first angle data or the second angle data is used as a current angle data. In some embodiments, the processor 104 uses the second angle data as the current angle data. In other embodiments, the processor 104 uses the first angle data as the current angle data. It can be appreciated that the determination result of step S402 shows that the first angle data and the second angle data are close to each other, so that the first angle data and the second angle data might correspond to the same position number Np in the lookup list. Therefore, the processor 104 can use one of the first angle data and the second angle data as the current angle data.
In step S404, a current position number corresponding to the current angle data is obtained according to the current angle data. In step S405, a number difference is calculated according to the current position number and a previous position number. In step S406, the number difference is outputted. It can be appreciated that the descriptions of steps S404-S406 are same or similar to those of step S202-S204, and therefore are omitted herein.
As shown in
In step S408, an angle difference is calculated according to the interpolation angle data and a previous angle data corresponding to the current position number. In step S409, it is determined whether the angle difference is in an error range. In step S410, the previous angle data is replaced with the interpolation angle data. In step S411, the previous angle data is reserved. It can be appreciated that the descriptions of steps S408-S411 are same or similar to those of step S205-S208, and therefore are omitted herein. In other embodiments, step S411 is omitted. In other words, after determining the angle difference does not exceed the error range, the processor 104 can perform no operation.
In other embodiments, the determination result of step S402 shows that the difference value between the first angle data and the second angle data is not smaller than or equal to the predetermined angle value, so that the processor 104 can then perform step S202 of the control method 200 of
It can be seen from the description of the control method 400 that in the condition that the relative encoder 102 abnormally operates, the input device 10 can still accurately generate the output signal Sout according to the output of the absolute encoder 103. In addition, in comparison to the operation of calibrating the lookup list (i.e., steps S205-S208) in the control method 200, the control method 400 determines whether to calibrate the lookup list or not (i.e., steps S408-S411) according to the interpolation angle data generated in step S407, so as to solve the error problem of the absolute encoder 103.
In the above embodiments, as shown in
It can be seen from the above embodiments of the present disclosure that the input device 10 of the present disclosure can calibrate the output error of the absolute encoder 103 according to the output of the relative encoder 102 when the relative encoder 102 normally operates, and can generate the output signal Sout according to the output of the absolute encoder 103 when the relative encoder 102 abnormally operates. In addition, when the relative encoder 102 abnormally operates, the input device 10 of the present disclosure can calculate the interpolation angle by the lookup list to calibrate the output error of the absolute encoder 103. In such way, the input device 10 of the present disclosure has the advantages of longer service life and ability to self-calibrate after leaving factory.
Although the present disclosure has been described in considerable detail with reference to certain embodiments thereof, other embodiments are possible. Therefore, the spirit and scope of the appended claims should not be limited to the description of the embodiments contained herein. It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present disclosure without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims.
Number | Date | Country | Kind |
---|---|---|---|
110145541 | Dec 2021 | TW | national |