Encoder system-based circle counting method and encoder system

By setting the gear ratio to N:1 in the encoder system, the task of calculating the number of spindles is transferred from the spindle to the driven shaft, which solves the problem of high power consumption when the spindle rotates quickly or the rotation state changes frequently, and achieves the effect of extending the battery life and accurately calculating the number of spindles.

CN120043558APending Publication Date: 2025-05-27GEEHY SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510143445.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-08
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

When the spindle rotation speed is fast or the rotation state changes frequently, the Gray code changes frequently, resulting in frequent wake-up of the encoder system, increasing power consumption, which is not conducive to extending the battery life.

Method used

By setting the gear transmission ratio to N:1 in the encoder system, the pinion gear is mounted on the spindle and the large gear is mounted on the driven shaft. The controller calculates the current number of turns of the spindle based on the rotation state information of the driven shaft, and reduces the number of wake-up times of the spindle.

Benefits of technology

Reduces the power consumption of the encoder system, reduces the number of wake-up times, extends the battery life, and accurately calculates the number of spindle rings when the main power is powered down and powered on.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120043558A_ABST
    Figure CN120043558A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a circle counting method based on an encoder system and the encoder system. The encoder system comprises a main shaft, a driven shaft and a controller, the main shaft is provided with a small gear, the driven shaft is provided with a large gear, and the small gear is meshed with the large gear; the method is applied to the controller. The method comprises the following steps: calculating the current main shaft turn number of the main shaft according to the acquired rotation state information of the driven shaft; according to the embodiment of the invention, a circle counting method based on the encoder system is transferred to the driven shaft from the main shaft, so that the awakening frequency of the encoder system is reduced, the power consumption of the encoder system is reduced, and the service life of a battery is prolonged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of encoders, and particularly to a revolution counting method based on an encoder system and an encoder system. Background Art

[0002] With the continuous improvement of the quality and the extension of the service life of automated equipment, a longer service life of the encoder battery is also required. Currently, the low-power revolution counting methods of electronic multi-turn encoders include optical multi-turn and magnetic multi-turn, and the passively awakened magnetic multi-turn has lower power consumption. The revolution counting method of the encoder can include: dividing the main shaft of 0° to 360° into 2N equal parts, and each equal part is numbered in the form of Gray code. When the Gray code changes, the encoder is awakened once, switches to the working mode, and calculates the number of revolutions. After the revolution counting is completed, it enters the sleep mode again. Each time the encoder is awakened, the power consumption increases.

[0003] In the prior art, when the rotation speed of the main shaft is relatively fast or the rotation state of the main shaft changes frequently, the Gray code changes frequently, resulting in frequent awakening of the encoder system. Whenever the Gray code changes frequently, the encoder system must switch from the sleep mode to the working mode and perform revolution counting. This kind of switching will increase the power consumption of the system and is not conducive to extending the service life of the battery. Summary of the Invention

[0004] In view of this, the embodiments of the present application provide a revolution counting method based on an encoder system and an encoder system, so as to reduce the power consumption of the encoder system and thus extend the service life of the battery.

[0005] In a first aspect, a revolution counting method based on an encoder system is provided. The encoder system includes a main shaft, a driven shaft and a controller. A pinion gear is provided on the main shaft, and a large gear is provided on the driven shaft. The pinion gear and the large gear are meshed; the method is applied to the controller; The method includes: Calculating the current number of revolutions of the main shaft according to the obtained rotation state information of the driven shaft.

[0006] In a possible implementation manner, the rotation state information of the driven shaft includes: Gray codes at different rotation moments, the position information of the driven shaft when power is on, and the position information of the driven shaft when power is off; The calculating the current number of revolutions of the main shaft according to the obtained rotation state information of the driven shaft includes: Judging whether the main power is off; If it is judged that the main power is off, obtaining the position area of the driven shaft when power is off and the number of revolutions of the main shaft when power is off, and calculating the number of revolutions of the driven shaft according to the change state of the Gray code; Judging whether the main power is on; If it is determined that the main power is powered on, control the encoder system to enter the working mode, and calculate the current spindle revolution count according to the obtained position area of the slave shaft at power-on, the number of revolutions of the slave shaft, the position area of the slave shaft at power-off, and the number of revolutions of the main shaft at power-off.

[0007] In a possible implementation, before determining whether the main power is powered on, it further includes: Determine whether the Gray code has changed; If it is determined that the Gray code has not changed, continue to execute the step of determining whether the main power is powered on; If it is determined that the Gray code has changed, control the encoder system to enter the working mode, and continue to execute the step of calculating the number of revolutions of the slave shaft according to the change state of the Gray code.

[0008] In a possible implementation, the method further includes: If it is determined that the main power is not powered on, continue to execute the step of determining whether the Gray code has changed.

[0009] In a possible implementation, after calculating the number of revolutions of the slave shaft according to the change state of the Gray code, it further includes: controlling the encoder system to enter the sleep mode.

[0010] In a possible implementation, before determining whether the main power is powered off, it further includes: Calculate the number of revolutions of the main shaft according to the single-revolution position of the main shaft.

[0011] In a possible implementation, after calculating the current spindle revolution count according to the obtained position area of the slave shaft at power-on, the number of revolutions of the slave shaft, the position area of the slave shaft at power-off, and the number of revolutions of the main shaft at power-off, continue to execute the step of calculating the number of revolutions of the main shaft according to the single-revolution position of the main shaft.

[0012] In a second aspect, an encoder system is provided, including: a main shaft, a slave shaft, and a controller. A pinion gear is provided on the main shaft, and a large gear is provided on the slave shaft, and the pinion gear meshes with the large gear; The controller is configured to calculate the current spindle revolution count of the main shaft according to the obtained rotation state information of the slave shaft.

[0013] In a possible implementation, the rotation state information of the slave shaft includes: Gray codes at different rotation times, slave shaft position information at power-on, and slave shaft position information at power-off; The controller is used to determine whether the main power supply is powered off; when it is determined that the main power supply is powered off, the position area of the driven shaft and the number of turns of the main shaft at the time of power-off are obtained, and the number of turns of the driven shaft is calculated according to the change state of the Gray code; it is determined whether the main power supply is powered on; when it is determined that the main power supply is powered on, the encoder system is controlled to enter the working mode, and the current number of turns of the main shaft is calculated according to the obtained position area of the driven shaft at the time of power-on, the number of turns of the driven shaft, the position area of the driven shaft at the time of power-off, and the number of turns of the main shaft at the time of power-off.

[0014] In a possible implementation manner, the controller is used to determine whether the Gray code changes; when it is determined that the Gray code does not change, the step of determining whether the main power supply is powered on is continued; when it is determined that the Gray code changes, the encoder system is controlled to enter the working mode, and the step of calculating the number of turns of the driven shaft according to the change state of the Gray code is continued.

[0015] In the technical solution of the embodiment of the present application, the encoder system includes a main shaft, a driven shaft and a controller. A small gear is arranged on the main shaft, a large gear is arranged on the driven shaft, the small gear and the large gear are meshed, and the controller calculates the current number of turns of the main shaft according to the obtained rotation state information of the driven shaft. In the embodiment of the present application, the counting method based on the encoder system is transferred from the main shaft to the driven shaft, reducing the wake-up times of the encoder system, reducing the power consumption of the encoder system, and thus prolonging the battery service life. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a schematic structural diagram of an encoder system provided by an embodiment of the present application; Figure 2A It is a schematic diagram of the angular relationship between the multi-turn zero point of the driven shaft and the single-turn zero point of the main shaft provided by an embodiment of the present application; Figures 2B to 2E It is a schematic diagram of the corresponding relationship between the rotation angle of the main shaft and the change position of the Gray code of the driven shaft during forward rotation in the embodiment of the present application; Figure 3 It is a schematic diagram of the corresponding relationship between the rotation angle of the main shaft and the position of the driven shaft provided by an embodiment of the present application; Figure 4 It is another schematic diagram of the corresponding relationship between the rotation angle of the main shaft and the position of the driven shaft provided by an embodiment of the present application; Figure 5A It is another schematic diagram of the corresponding relationship between the rotation angle of the main shaft and the position of the driven shaft provided by an embodiment of the present application; Figure 5B It is another schematic diagram of the corresponding relationship between the rotation angle of the main shaft and the position of the driven shaft provided by an embodiment of the present application; Figure 6 It is another schematic diagram of the corresponding relationship between the rotation angle of the main shaft and the position of the driven shaft provided by an embodiment of the present application; Figure 7 Another schematic diagram of the corresponding relationship between the rotation angle of the main shaft and the position of the driven shaft provided by the embodiment of the present application; Figure 8 Another schematic diagram of the corresponding relationship between the rotation angle of the main shaft and the position of the driven shaft provided by the embodiment of the present application; Figure 9 A flowchart of a revolution counting method based on an encoder system provided by the embodiment of the present application. Detailed implementation manners

[0017] To better understand the technical solution of the present application, the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0018] It should be clear that the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.

[0019] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "the" and "said" 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.

[0020] It should be understood that the term " / and / " used herein is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the front and rear associated objects.

[0021] The embodiment of the present application provides an encoder revolution counting method and an encoder system. Figure 1 A schematic structural diagram of an encoder system provided by the embodiment of the present application, as Figure 1 shown, the encoder system includes a main shaft, a driven shaft and a controller. A small gear is provided on the main shaft, a large gear is provided on the driven shaft, and the small gear and the large gear are meshed. The gear transmission ratio of the large gear to the small gear is N:1. According to the gear transmission principle, when the main shaft rotates N circles, the driven shaft rotates 1 circle. As an optional solution, for example, N = 3, then the gear transmission ratio is 3:1, and when the main shaft rotates 3 circles, the driven shaft rotates 1 circle.

[0022] The controller is used to calculate the current number of revolutions of the main shaft according to the obtained rotation state information of the driven shaft.

[0023] As an alternative, the rotational state information of the driven shaft includes: Gray codes at different rotation times, the position information of the driven shaft when power is applied, and the position information of the driven shaft when power is removed. The controller is used to determine whether the main power is removed; if it is determined that the main power is removed, obtain the position area of the driven shaft when power is removed and the number of turns of the main shaft when power is removed, and calculate the number of turns of the driven shaft according to the change state of the Gray code; determine whether the main power is applied; if it is determined that the main power is applied, control the encoder system to enter the working mode, and calculate the current number of turns of the main shaft according to the obtained position area of the driven shaft when power is applied, the number of turns of the driven shaft, the position area of the driven shaft when power is removed, and the number of turns of the main shaft when power is removed.

[0024] As an alternative, the controller is used to determine whether the Gray code changes; if it is determined that the Gray code does not change, continue to execute the step of determining whether the main power is applied; if it is determined that the Gray code changes, control the encoder system to enter the working mode, and continue to execute the step of calculating the number of turns of the driven shaft according to the change state of the Gray code.

[0025] The power consumption of the encoder system in the working mode after waking up is higher than that in the sleep mode. The fewer the wake-up times and the longer the sleep time, the lower the average power consumption. In the embodiments of the present application, by adopting a design with a gear transmission ratio of N:1, the small gear is installed on the main shaft and the large gear is installed on the driven shaft. Due to the gear transmission ratio relationship, when the main shaft rotates N turns, the driven shaft only rotates 1 turn. The controller calculates the actual number of turns of the main shaft (i.e., the current number of turns of the main shaft) by reading the rotational state information of the driven shaft. The method of counting the number of turns by the encoder is transferred from the main shaft to the driven shaft, thereby reducing the wake-up times. When the rotation speed of the main shaft remains unchanged, the method of counting the number of turns based on the encoder system provided in the embodiments of the present application is 1 / N of the wake-up times of the traditional method of counting the number of turns, which can significantly reduce the power consumption of the encoder system and extend the battery life. And it can accurately calculate the current number of turns of the main shaft in the case of main power removal and power-on.

[0026] First, the principle of the method for counting the number of turns of the encoder provided in the embodiments of the present application will be described in detail.

[0027] As shown in Figure 1 In the embodiments of the present application, two types of gears are combined. The small gear is installed on the main shaft and is used for the single-turn system; the large gear is installed on the driven shaft and is used for the multi-turn system; according to the gear transmission principle, when the main shaft rotates N turns, the driven shaft rotates 1 turn.

[0028] Figure 2A FIG. is a schematic diagram of the angular relationship between the multi-turn zero point of the driven shaft and the single-turn zero point of the main shaft provided in the embodiments of the present application. As shown in Figure 2AAs shown, the method of calculating the number of turns of the main shaft in the related art is transferred to the driven shaft. The driven shaft is provided with four Gray code regions, and each Gray code region corresponds to a Gray code. The four Gray code regions are respectively the Gray code 00 region, the Gray code 01 region, the Gray code 10 region, and the Gray code 11 region. All four positions where the Gray code region mutates can be used as the positions of the multi-turn zero point. For example, as Figure 2A shown, the changing position from the Gray code 00 region to the Gray code 10 region is used as the position of the multi-turn zero point. In the embodiments of the present application, it is described with the main shaft rotating clockwise and the driven shaft rotating counterclockwise as the positive rotation direction. Figures 2B to 2E This is a schematic diagram of the corresponding relationship between the rotation angle of the main shaft and the changing position of the Gray code of the driven shaft during positive rotation in the embodiments of the present application. As Figures 2B to 2E shown, the four Gray code regions of the driven shaft respectively correspond to different angles when the main shaft rotates positively. As Figure 2B shown, when the rotation angle of the main shaft is 0°, the rotation angle 0° of the main shaft corresponds to the changing position from the Gray code 00 region to the Gray code 10 region. As shown in 2C, when the rotation angle of the main shaft is 90°, the rotation angle 90° of the main shaft corresponds to the changing position from the Gray code 10 region to the Gray code 00 region. As Figure 2D shown, when the rotation angle of the main shaft is 180°, the rotation angle 180° of the main shaft corresponds to the changing position from the Gray code 11 region to the Gray code 01 region. As Figure 2E shown, when the rotation angle of the main shaft is 270°, the rotation angle 270° of the main shaft corresponds to the changing position from the Gray code 10 region to the Gray code 11 region.

[0029] In the embodiments of the present application, as an optional solution, the gear transmission ratio is limited to 3:1. For specific reasons, please refer to the following description.

[0030] Figure 3 This is a schematic diagram of the corresponding relationship between the rotation angle of the main shaft and the position of the driven shaft provided by the embodiments of the present application. As Figure 3 shown, assuming that the gear transmission ratio is not an integer multiple, taking the gear transmission ratio of 3.5:1 as an example, when the main shaft rotates 3.5 turns, the driven shaft rotates 1 turn. As Figure 3 shown, the angle of the first turn of the main shaft corresponds to "0°(1)" to "360°(1)", the angle of the second turn of the main shaft corresponds to "0°(2)" to "360°(2)", the angle of the third turn of the main shaft corresponds to "0°(3)" to "360°(3)", and the angle of the fourth turn of the main shaft corresponds to "0°(4)" to "360°(4)". At different positions within the Gray code 00 region of the driven shaft, there are corresponding different single-turn angles of the main shaft. As Figure 3At the positions of "90°(1), 270°(4)" and "270°(1), 90°(5)", the controller will not be able to identify whether the 90° corresponding to one revolution of the main shaft is the 90° of the first revolution or the 90° of the fifth revolution. The same position of the driven shaft corresponds to different single-revolution angles of the main shaft. For example, Figure 3 at the position of "90°(1), 270°(4)" corresponds to two angles of 90° and 270° for one revolution of the main shaft. Moreover, as the number of revolutions of the main shaft increases, there are more different single-revolution angles of the main shaft, and the controller will be even more unable to identify the number of revolutions. When the gear transmission ratio is an integer multiple, the single-revolution angle value corresponding to each position of the driven shaft is unique. Therefore, the gear transmission ratio must be an integer multiple.

[0031] When the main shaft rotates by the same angle, the larger the gear transmission ratio, the smaller the rotation angle of the driven shaft, the fewer the number of wake-up times of the encoder system, and the lower the power consumption. Therefore, the larger the gear transmission ratio, the better the effect.

[0032] Figure 4 Another schematic diagram of the correspondence between the rotation angle of the main shaft and the position of the driven shaft provided by the embodiment of the present application is shown in Figure 4 As shown, if the gear transmission ratio is greater than 4:1, for example, when the gear transmission ratio is 5:1, there will be two identical single-revolution angles in the same Gray code area of the driven shaft. For example, there are two 45° in the Gray code 00 area, namely "45°(1)" and "45°(2)", then the controller cannot determine which revolution the current single-revolution angle belongs to.

[0033] Figure 5A Another schematic diagram of the correspondence between the rotation angle of the main shaft and the position of the driven shaft provided by the embodiment of the present application is Figure 5B Another schematic diagram of the correspondence between the rotation angle of the main shaft and the position of the driven shaft provided by the embodiment of the present application is shown in Figure 5A and Figure 5B As shown, if the gear transmission ratio is 4:1 and it is impossible to ensure that the multi-revolution zero point of the driven shaft coincides exactly with the single-revolution zero point of the main shaft during the actual installation process, there will be Figure 5A and Figure 5B two situations. Figure 5A In Figure 5B the 20° position in the Gray code 00 area belongs to the second revolution; while in

[0034] the 20° position in the Gray code 00 area belongs to the first revolution. Therefore, the 20° position in the Gray code 00 area may belong to the first revolution or the second revolution, and the encoder system cannot determine.

[0035] The solution of the embodiment of the present application allows an assembly error of <±90° at the zero position during the actual installation process. In actual operation, it is very difficult to ensure that the multi-turn zero point and the single-turn zero point are completely aligned. Therefore, in the case of installation errors (the multi-turn zero point and the single-turn zero point do not completely coincide), the encoder system can determine the corresponding spindle angle range according to different coding states, so as to correctly judge and calculate the spindle position and the number of turns. And when the encoder system is powered off and powered on, by recording and comparing the position area and the number of turns of the driven shaft, the number of turns of the spindle is updated and calibrated. For example, when the driven shaft position is in a certain area when powered off and in another area when powered on, the encoder system will adjust and synchronize the spindle number of turns Dn according to a predetermined rule.

[0036] The following will, with reference to the accompanying drawings, detail how the embodiment of the present application achieves "error tolerance". As Figure 2A shown, when the multi-turn zero point and the single-turn zero point coincide, the Gray code 00 area corresponds to the angle of 0° to 270° of the first turn of the spindle rotation, the Gray code 01 area corresponds to the angle of 270° to 360° (01a area) of the first turn of the spindle rotation and 0° to 180° (01b area) of the second turn, the Gray code 11 area corresponds to the angle of 180° to 360° (11a area) of the second turn of the spindle rotation and 0° to 90° (11b area) of the third turn, and the Gray code 10 area corresponds to the angle of 90° to 360° of the third turn of the spindle. Figure 6 It is a schematic diagram of another corresponding relationship between the spindle rotation angle and the position of the driven shaft provided by the embodiment of the present application, Figure 6 It is a schematic diagram of the angle relationship where the multi-turn zero point of the driven shaft corresponds to the spindle angle of 90°. As Figure 6 shown, when the changing position of the Gray code 00-10 corresponds to the spindle 90°, the Gray code 00 area corresponds to the angle of 90° to 360° of the first turn of the spindle rotation, the Gray code 01 area corresponds to the angle of 0° to 270° of the second turn of the spindle rotation, the Gray code 11 area corresponds to the angle of 270° to 360° (11a area) of the second turn of the spindle rotation and 0° to 180° (11b area) of the third turn, and the Gray code 10 area corresponds to the angle of 180° to 360° (10a area) of the third turn of the spindle rotation and 0° to 90° (10b area) of the first turn. Figure 7 It is a schematic diagram of another corresponding relationship between the spindle rotation angle and the position of the driven shaft provided by the embodiment of the present application, Figure 7 It is a schematic diagram of the angle relationship where the multi-turn zero point of the driven shaft corresponds to the spindle angle of -90°. As Figure 7As shown in the figure, when the changing position of Gray code 00 - 10 corresponds to the main shaft at 270°, the Gray code 00 area corresponds to the angles 270° - 0° (00a area) of the 0th revolution of the main shaft rotation and 0° - 180° (00b area) of the 1st revolution, the Gray code 01 area corresponds to the angles 180° - 360° (01a area) of the 1st revolution of the main shaft rotation and 0° - 90° (01b area) of the 2nd revolution, the Gray code 11 area corresponds to the angles 90° - 360° of the 2nd revolution of the main shaft rotation, and the Gray code 10 area corresponds to the angles 0° - 270° of the 3rd revolution of the main shaft rotation.

[0037] Figure 8 Another schematic diagram of the corresponding relationship between the main shaft rotation angle and the driven shaft position provided by the embodiment of the present application Figure 8 Schematic diagram of the angular relationship between the multi - turn zero point of the driven shaft and the main shaft angle of 100°, as Figure 8 shown, when the angular difference between the multi - turn zero point and the single - turn position ≥ 90°, if the main shaft angle read in the Gray code 10 area is 95°, it corresponds to 95° of the 1st revolution. As Figure 2A shown, when the angle between the multi - turn zero point and the single - turn zero point position is 0°, if the main shaft angle read in the Gray code 10 area is 95°, it corresponds to 95° of the 3rd revolution. Therefore, the encoder system cannot determine whether the 95° read in the Gray code 10 area belongs to the 1st revolution or the 3rd revolution. Similarly, when the angular difference between the multi - turn zero point and the single - turn zero point position ≤ - 90°, the encoder system cannot determine whether the 95° read in the Gray code 10 area belongs to the 1st revolution or the 3rd revolution. If the angular difference between the multi - turn zero point and the single - turn zero point is < ±90°, the above - mentioned situation will not occur.

[0038] Based on the above - mentioned principle of the method for calculating the number of turns of the encoder system, the embodiment of the present application provides a method for counting turns based on the encoder system. In the embodiment of the present application, each step of this method can be executed by a controller. Figure 9 A flowchart of a method for counting turns based on the encoder system provided by the embodiment of the present application, as Figure 9 shown, this method includes: Step 102: Calculate the number of turns of the main shaft according to the single - turn position of the main shaft.

[0039] As an optional solution, before step 102, this method further includes: Step 100: When the encoder system is powered on for the first time, initialize the system and execute step 102.

[0040] Step 102 may specifically include: If it is determined that the single - turn position of the main shaft is greater than 360°, indicating that the main shaft rotates clockwise in the positive direction, then add 1 to the number of turns of the main shaft Dn; if it is determined that the single - turn position of the main shaft is less than 0°, indicating that the main shaft rotates counterclockwise in the negative direction, then subtract 1 from the number of turns of the main shaft Dn.

[0041] Step 104: Determine whether the main power supply is powered off. If so, execute Step 106; if not, execute Step 102.

[0042] Step 106: Obtain the position area of the driven shaft and the number of turns of the main shaft at the time of power-off.

[0043] As an alternative solution, the controller stores the position area of the driven shaft and the number of turns Dn of the main shaft at the time of power-off, and sets the number of turns Dm of the driven shaft to 0. In the embodiment of the present application, Step 102 continuously calculates the number of turns of the main shaft, and when the main power supply is powered off, the controller can obtain the number of turns Dn of the main shaft at the time of power-off.

[0044] For example, the position area of the driven shaft is the 00 area, the 01a area, or the 10 area, etc.

[0045] Step 108: Calculate the number of turns of the driven shaft according to the change state of the Gray code.

[0046] As an alternative solution, Step 108 may specifically include: if the change state of the Gray code changes from 00 to 01, it indicates that the driven shaft rotates clockwise by 1 turn, then the controller adds 1 to the number of turns Dm of the driven shaft; if the change state of the Gray code changes from 10 to 00, it indicates that the driven shaft rotates counterclockwise by 1 turn, then the number of turns Dm of the main shaft is subtracted by 1.

[0047] Step 110: Control the encoder system to enter the sleep mode.

[0048] Step 112: Determine whether the Gray code has changed. If not, execute Step 116; if so, execute Step 114.

[0049] Step 114: Control the encoder system to enter the working mode and continue to execute Step 108.

[0050] When the controller determines that the Gray code has changed, the encoder system wakes up and controls the encoder system to enter the working mode.

[0051] Step 116: Determine whether the main power supply is powered on. If so, execute Step 118; if not, execute Step 112.

[0052] Step 118: Control the encoder system to enter the working mode.

[0053] When the controller determines that the main power supply is powered on, the encoder system wakes up, controls the encoder system to enter the working mode, and stores the position area of the driven shaft and the number of turns of the driven shaft at the time of power-on, so that the controller obtains the position area of the driven shaft and the number of turns of the driven shaft at the time of power-on.

[0054] Step 120: Calculate the current main shaft revolution count based on the obtained position area of the driven shaft at power-on, the number of revolutions of the driven shaft, the position area of the driven shaft at power-off, and the number of revolutions of the main shaft at power-off, and then continue to execute Step 102.

[0055] In the embodiments of the present application, a gear transmission ratio of 3:1 (i.e., N = 3) is taken as an example for description. Dn’ is the current main shaft revolution count, Dn is the main shaft revolution count at power-off, and Dm is the number of revolutions of the driven shaft.

[0056] As an alternative Figure 2A As shown, the position area of the driven shaft at power-off is the 00 area or the 01a area. If the position area of the driven shaft at power-on is the 00 area or the 01a area, then Dn’ = Dn + 3 Dm; if the position area of the driven shaft at power-on is the 01b area or the 11a area, then Dn’ = Dn + 3 Dm + 1; if the position area of the driven shaft at power-on is the 11b or 10 area, then the main shaft revolution count Dn’ = Dn + 3 Dm + 2.

[0057] As another alternative Figure 2A As shown, the position area of the driven shaft at power-off is the 01b area or the 11a area. If the position area of the driven shaft at power-on is the 00 area or the 01a area, then Dn’ = Dn + 3 Dm - 1; if the position area of the driven shaft at power-on is the 01b area or the 11a area, then Dn’ = Dn + 3 Dm; if the position area of the driven shaft at power-on is the 11b area or the 10 area, then Dn’ = Dn + 3 Dm + 1.

[0058] As another alternative Figure 2A As shown, the position area of the driven shaft at power-off is the 11b area or the 10 area. If the position area of the driven shaft at power-on is the 00 area or the 01a area, then Dn’ = Dn + 3 Dm - 2; if the position area of the driven shaft at power-on is the 01b area or the 11a area, then Dn’ = Dn + 3 Dm - 1; if the position area of the driven shaft at power-on is the 11b area or the 10 area, then Dn’ = Dn + 3 Dm.

[0059] As another alternative Figure 6 As shown, the position area of the driven shaft at power-off is in the 00 area. If the position area of the driven shaft at power-on is the 00 area, then Dn’ = Dn + 3 Dm; if the position area of the driven shaft at power-on is the 10b area, then Dn’ = Dn + 3 Dm + 3; If the driven shaft position area is the 01 area or the 11a area when powered on, then Dn’ = Dn + 3 Dm + 1; If the driven shaft position area is the 11b area or the 10a area when powered on, then Dn’ = Dn + 3 Dm + 2.

[0060] As another alternative, as Figure 6 shown, the driven shaft position area is the 10b area when powered off. If the driven shaft position area is the 00 area when powered on, then Dn’ = Dn + 3 Dm - 3; If the driven shaft position area is the 10b area when powered on, then Dn’ = Dn + 3 Dm; If the driven shaft position area is the 01 area or the 11a area when powered on, then Dn’ = Dn + 3 Dm - 2; If the driven shaft position area is in the 11b area or the 10a area when powered on, then Dn’ = Dn + 3 Dm - 1.

[0061] As another alternative, as Figure 6 shown, the driven shaft position area is the 01 area or the 11a area when powered off. If the driven shaft position area is the 00 area when powered on, then Dn’ = Dn + 3 Dm - 1; If the driven shaft position area is the 10b area when powered on, then Dn’ = Dn + 3 Dm + 2; If the driven shaft position area is the 01 area or the 11a area when powered on, then Dn’ = Dn + 3 Dm; If the driven shaft position area is the 11b area or the 10a area when powered on, then Dn’ = Dn + 3 Dm + 1.

[0062] As another alternative, as Figure 6 shown, the driven shaft position area is the 11b area or the 10a area when powered off. If the driven shaft position area is the 00 area when powered on, then Dn’ = Dn + 3 Dm - 2; If the driven shaft position area is the 10b area when powered on, then Dn’ = Dn + 3 Dm + 1; If the driven shaft position area is the 01 area or the 11a area when powered on, then Dn’ = Dn + 3 Dm - 1; If the driven shaft position area is the 11b area or the 10a area when powered on, then Dn’ = Dn + 3 Dm.

[0063] As another alternative, as Figure 7 shown, the driven shaft position area is the 00b area or the 01a area when powered off. If the driven shaft position area is the 00b area or the 01a area when powered on, then Dn’ = Dn + 3 Dm; If the position area of the driven shaft is the 01b area or the 11 area when powered on, then Dn’ = Dn + 3 Dm + 1; If the position area of the driven shaft is the 10 area when powered on, then Dn’ = Dn + 3 Dm + 2; If the position area of the driven shaft is the 00a area when powered on, then Dn’ = Dn + 3 Dm - 1.

[0064] As another alternative, as Figure 7 shown, the position area of the driven shaft is the 01b area or the 11 area when powered off. If the position area of the driven shaft is the 00b area or the 01a area when powered on, then Dn’ = Dn + 3 Dm - 1; If the position area of the driven shaft is the 01b area or the 11 area when powered on, then Dn’ = Dn + 3 Dm; If the position area of the driven shaft is the 10 area when powered on, then Dn’ = Dn + 3 Dm + 1; If the position area of the driven shaft is the 00a area when powered on, then Dn’ = Dn + 3 Dm - 2.

[0065] As another alternative, as Figure 7 shown, the position area of the driven shaft is the 10 area when powered off. If the position area of the driven shaft is the 00b area or the 01a area when powered on, then Dn’ = Dn + 3 Dm - 2; If the position area of the driven shaft is the 01b area or the 11 area when powered on, then Dn’ = Dn + 3 Dm - 1; If the position area of the driven shaft is the 10 area when powered on, then Dn = Dn + 3 Dm; If the position area of the driven shaft is the 00a area when powered on, then Dn’ = Dn + 3 Dm - 3.

[0066] As another alternative, as Figure 7 shown, the position area of the driven shaft is the 00a area when powered off. If the position area of the driven shaft is the 00b area or the 01a area when powered on, then Dn’ = Dn + 3 Dm + 1; If the position area of the driven shaft is the 01b area or the 11 area when powered on, then Dn’ = Dn + 3 Dm + 2; If the position area of the driven shaft is the 10 area when powered on, then Dn’ = Dn + 3 Dm + 3; If the position area of the driven shaft is the 00a area when powered on, then Dn’ = Dn + 3 Dm.

[0067] In the technical solution of the embodiment of the present application, the encoder system includes a main shaft, a driven shaft and a controller. A pinion gear is provided on the main shaft, and a large gear is provided on the driven shaft. The pinion gear and the large gear are meshed. The controller calculates the current number of turns of the main shaft according to the obtained rotation state information of the driven shaft. In the embodiment of the present application, the method of counting turns based on the encoder system is transferred from the main shaft to the driven shaft, reducing the number of wake-up times of the encoder system, reducing the power consumption of the encoder system, and thus extending the battery life.

[0068] In the technical solution provided by the embodiment of the present application, the number of turns of the main shaft can be accurately calculated under power-off and power-on conditions. Even in an unstable power supply environment, the system can ensure the integrity and accuracy of data, increasing the reliability of the system.

[0069] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the scope of protection of the present application.

Claims

1. A lap counting method based on an encoder system, characterized in that: The encoder system comprises a main shaft, a driven shaft and a controller, the main shaft is provided with a pinion gear, the driven shaft is provided with a large gear, and the pinion gear and the large gear are meshed; The method is applied to a controller; The method comprises: The current number of spindle revolutions of the spindle is calculated according to the acquired rotation state information of the driven shaft.

2. The method according to claim 1, characterized in that The rotation state information of the driven shaft includes: Gray codes at different rotation moments, the driven shaft position information when powered on, and the driven shaft position information when powered off; The step of generating the current number of spindle revolutions of the spindle according to the acquired rotation state information of the driven shaft comprises: Determine whether the main power is off; If it is determined that the main power is off, the position area of ​​the driven shaft and the number of revolutions of the main shaft when the power is off are obtained, and the number of revolutions of the driven shaft is calculated according to the change state of the Gray code; Determine whether the main power is powered on; If it is determined that the main power is powered on, the encoder system is controlled to enter the working mode, and the current spindle revolutions are calculated based on the acquired driven shaft position area when powered on, the driven shaft revolutions, the driven shaft position area when powered off, and the spindle revolutions when powered off.

3. The method according to claim 2, characterized in that Before determining whether the main power is powered on, the method further includes: Determine whether the Gray code has changed; If it is determined that the Gray code has not changed, continue to execute the step of determining whether the main power is powered on; If it is determined that the Gray code has changed, the encoder system is controlled to enter the working mode, and the step of calculating the number of revolutions of the driven shaft according to the change state of the Gray code is continued.

4. The method according to claim 3, characterized in that The method further comprises: If it is determined that the main power supply is not powered on, the step of determining whether the Gray code changes is continued.

5. The method according to claim 3, characterized in that: After calculating the number of revolutions of the driven shaft according to the change state of the Gray code, the method further includes: controlling the encoder system to enter a sleep mode.

6. The method according to claim 1, characterized in that Before determining whether the main power is off, the method further includes: Calculate the number of spindle revolutions based on the spindle single-turn position.

7. The method according to claim 6, characterized in that After calculating the current number of spindle revolutions based on the acquired driven shaft position area at power-on, the number of driven shaft revolutions, the driven shaft position area at power-off, and the number of spindle revolutions at power-off, continue to execute the step of calculating the number of spindle revolutions based on the spindle single-turn position.

8. An encoder system, characterized in that include: A main shaft, a driven shaft and a controller, wherein the main shaft is provided with a pinion gear, the driven shaft is provided with a large gear, and the pinion gear and the large gear are meshed; The controller is used to calculate the current spindle revolution number of the spindle according to the acquired rotation state information of the driven shaft.

9. The encoder system according to claim 8, characterized in that The rotation state information of the driven shaft includes: Gray codes at different rotation moments, the driven shaft position information when powered on, and the driven shaft position information when powered off; The controller is used to determine whether the main power is off; if it is determined that the main power is off, obtain the driven shaft position area and the number of spindle turns when the power is off, and calculate the number of driven shaft turns according to the change state of the Gray code; determine whether the main power is powered on; if it is determined that the main power is powered on, control the encoder system to enter the working mode, and calculate the current number of spindle turns according to the obtained driven shaft position area when powered on, the number of driven shaft turns, the driven shaft position area when powered off, and the number of spindle turns when powered off.

10. The encoder system according to claim 9, characterized in that The controller is used to determine whether the Gray code has changed; if it is determined that the Gray code has not changed, continue to execute the step of determining whether the main power is powered on; if it is determined that the Gray code has changed, control the encoder system to enter the working mode, and continue to execute the step of calculating the number of driven shaft turns according to the change state of the Gray code.