Travel detection module, method, and electronic device
By setting a magnet and a Hall sensor on the rotating mechanism, the sliding displacement is detected using rotational parameters, which solves the problem of low accuracy in detecting the stroke of the sliding structure and achieves higher detection accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2022-09-09
- Publication Date
- 2026-05-19
AI Technical Summary
The accuracy of stroke detection in existing electronic devices is not high, especially in limited layout space. When the camera and Hall sensor are close together, magnetic field interference leads to a decrease in detection accuracy.
By setting magnets and Hall sensors on the rotating mechanism, rotational parameters are detected to determine the sliding displacement of the sliding mechanism. The rotational speed ratio between the rotating mechanism and the sliding mechanism is used in conjunction with the processor to obtain rotational parameters to improve detection accuracy.
It achieves higher accuracy in sliding structure stroke detection, reduces the influence of magnetic field interference, and improves the accuracy of slider position detection.
Smart Images

Figure CN115628707B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of detection technology, and more specifically, to a stroke detection module, method, and electronic device. Background Technology
[0002] Currently, with the development of electronic information technology, electronic devices are capable of performing more and more functions, and some existing electronic devices integrate sliding structures. Although the stroke of sliding structures can be detected, the accuracy of stroke detection for sliding structures is currently not high. Summary of the Invention
[0003] This application proposes a travel detection module, method, and electronic device to improve the above-mentioned deficiencies.
[0004] In a first aspect, embodiments of this application provide a stroke detection module for detecting a transmission component. The transmission component includes a motor, a rotating mechanism, and a sliding mechanism. The motor drives the rotating mechanism to rotate, thereby pushing the sliding mechanism to slide. The stroke detection module includes a first detection component and a processor electrically connected to the first detection component. The first detection component detects rotation parameters of the rotating mechanism, including the rotation direction of the rotating mechanism and the rotational displacement corresponding to the rotation direction. The processor acquires the rotation parameters and determines the sliding displacement of the sliding mechanism based on the rotation parameters.
[0005] Secondly, embodiments of this application also provide a stroke detection method applied to a transmission assembly, the transmission assembly including a motor, a rotating mechanism, and a sliding mechanism, the motor driving the rotating mechanism to rotate to push the sliding mechanism to slide; the method includes: obtaining rotation parameters of the rotating mechanism during the sliding process of the sliding mechanism, the rotation parameters including the rotation direction of the rotating mechanism and the rotation displacement corresponding to the rotation direction; and determining the sliding displacement of the sliding mechanism based on the rotation parameters.
[0006] Thirdly, embodiments of this application also provide an electronic device, which includes a transmission component and a stroke detection module as described in the first aspect. The transmission component includes a motor, a rotating mechanism, and a sliding mechanism. The motor is used to drive the rotating mechanism to rotate in order to push the sliding member to slide. The stroke detection module is used for detecting the transmission component.
[0007] The stroke detection module, method, and electronic device provided in this application include a transmission component comprising a motor, a rotating mechanism, and a sliding mechanism. The motor drives the rotating mechanism to rotate, thereby pushing the sliding mechanism to slide. The stroke detection module includes a first detection component and a processor electrically connected to the first detection component. The first detection component detects the rotation parameters of the rotating mechanism, including the rotation direction and the corresponding rotational displacement. The processor acquires the rotation parameters and determines the sliding displacement of the sliding mechanism based on them. Since the rotating mechanism pushes the sliding mechanism to slide, there is a speed ratio between the rotating mechanism and the sliding mechanism. The rotation parameters include the rotation direction and the corresponding rotational displacement of the rotating mechanism. Therefore, this application can determine the sliding displacement of the sliding mechanism through the rotation parameters. This method offers higher accuracy compared to directly detecting the sliding of the sliding module.
[0008] Other features and advantages of the embodiments of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the embodiments of this application. The objects and other advantages of the embodiments of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 A schematic diagram of a stroke detection method in the related art is shown;
[0011] Figure 2 A schematic diagram of the Hall sensor principle is shown;
[0012] Figure 3 This paper shows a structural block diagram of a travel detection module provided in an embodiment of this application;
[0013] Figure 4 A structural diagram of the rotating mechanism provided in an embodiment of this application is shown;
[0014] Figure 5 A structural diagram of a rotating mechanism provided in another embodiment of this application is shown;
[0015] Figure 6 A structural diagram of the first detection component provided in an embodiment of this application is shown;
[0016] Figure 7 A structural diagram of a first detection component provided in yet another embodiment of this application is shown;
[0017] Figure 8 A structural diagram of the transmission assembly provided in an embodiment of this application is shown;
[0018] Figure 9 A structural diagram of a transmission assembly provided in yet another embodiment of this application is shown;
[0019] Figure 10 A structural diagram of a transmission assembly provided in another embodiment of this application is shown;
[0020] Figure 11 The diagram shows the structure of the stroke detection module and transmission assembly provided in the embodiments of this application;
[0021] Figure 12 A flowchart of the travel detection method provided in an embodiment of this application is shown;
[0022] Figure 13 A flowchart of a travel detection method according to another embodiment of this application is shown;
[0023] Figure 14 A flowchart illustrating one embodiment of step S250 is shown.
[0024] Figure 15 A flowchart illustrating the method of pre-calibration implementation provided in this application is shown.
[0025] Figure 16 A structural block diagram of another electronic device provided in an embodiment of this application is shown;
[0026] Figure 17 This paper shows a structural block diagram of a computer-readable storage medium provided in an embodiment of this application;
[0027] Figure 18 A structural block diagram of a computer program product provided in an embodiment of this application is shown.
[0028] Figure label:
[0029] Slider-110, Magnet-111, First Hall Sensor-121, Second Hall Sensor-122, Third Hall Sensor-123, Fourth Hall Sensor-124, Semiconductor Chip-200, First Surface-210, Second Surface-220, Third Surface-230, Fourth Surface-240, Fifth Surface-250, Sixth Surface-260, Transmission Assembly-310, Stroke Detection Module-320, Processor-321, First Detection Assembly-322, Motor-311, Rotating Mechanism-312, Sliding Mechanism-313, Gear-31 21. First gear - 3122, Second gear - 3123, Third gear - 3124, Magnet - 3221, Hall sensor - 3222, Second magnet - 3223, Cavity - 314, First sidewall - 3141, Second sidewall - 3142, Second detection component - 323, Contact spring - 3143, Interruption signal trigger module - 3144, Second contact spring - 3145, Slider - 3131, Lead screw - 3133, Sliding plate - 3132, Sun gear - 3111, Planetary gear - 3112, Internal gear ring - 3113. Detailed Implementation
[0030] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. The components of the embodiments of the present application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without inventive effort are within the scope of protection of the present application.
[0031] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0032] Currently, with the development of electronic information technology, electronic devices are capable of performing increasingly more functions, and some existing electronic devices integrate electrically driven sliding structures. Although the stroke of these sliding structures can be detected, the accuracy of current stroke detection methods is not high. Improving the measurement accuracy of stroke detection for sliding structures is an urgent problem to be solved.
[0033] Currently, some electronic devices include a drive device that drives a slider to slide via a transmission mechanism. For example, the aforementioned electric drive device can be a stepper motor. A module to be slid can be mounted on the slider, such as an image acquisition module; in some embodiments, the image acquisition module can be a camera. Thus, the module to be slid on the slider can slide. However, electric drive devices are prone to failing to drive the slider to its designated position. Therefore, a stroke detection module can be used to detect the slider's stroke.
[0034] For example, a magnet can be placed on the slider, which can slide synchronously with the slider. Then, a Hall sensor array is arranged along the direction of the slider's movement. This Hall sensor array includes multiple Hall sensors spaced apart, where the multiple can be at least two. For example, see... Figure 1 , Figure 1 A travel detection method is shown, wherein Figure 1 The system includes a slider 110, which can slide along the positive or negative x-axis. A magnet 111 is mounted on the slider 110 and slides along with it. A Hall sensor array is arranged along the x-axis, comprising a first Hall sensor 121, a second Hall sensor 122, a third Hall sensor 123, and a fourth Hall sensor 124 spaced apart. A magnetic field is generated around the magnet 111, and the strength of this magnetic field is inversely related to the distance from the magnet 111; that is, the farther away from the magnet 111, the weaker the magnetic field; and the closer to the magnet 111, the stronger the magnetic field. Therefore, as the magnet 111 slides with the slider 110, the distances between the magnet 111 and the first Hall sensor 121, the second Hall sensor 122, the third Hall sensor 123, and the fourth Hall sensor 124 change. Consequently, the magnetic field strength generated by the magnet 111 changes at each Hall sensor. The Hall sensors can convert the magnetic field strength into electrical signals, resulting in different electrical signals generated by each Hall sensor as the magnet 111 slides with the slider 110. Therefore, based on these different electrical signals and the predetermined positional relationships between the first Hall sensor 121, the second Hall sensor 122, the third Hall sensor 123, and the fourth Hall sensor 124, the current position of the magnet 111 can be determined, thereby revealing the current position of the slider 110 and enabling the detection of the slider's travel.
[0035] Hall sensors are based on the Hall effect. The Hall effect refers to the phenomenon where a semiconductor plate carrying a small current is placed in a magnetic field. The magnetic field causes the current to deflect, creating a voltage across the semiconductor in the direction perpendicular to the control current. This voltage is called the Hall voltage, and its magnitude is positively correlated with both the magnetic field strength and the control current flowing through the semiconductor. Therefore, with a constant control current, the Hall voltage is directly proportional to the magnetic field strength. For details, please refer to [link to relevant documentation]. Figure 2 , Figure 2 A schematic diagram of a Hall sensor is shown. It can be defined... Figure 2 The semiconductor wafer 200 has six faces: a first face 210, a second face 220 opposite to the first face 210, a third face 230, a fourth face 240 opposite to the third face 230, a fifth face 250 opposite to the third face 230, and a sixth face 260 opposite to the fifth face 250. Specifically, the semiconductor wafer 200 can be placed in a vertically downward magnetic field B, such that the plane containing the first face 210 of the semiconductor wafer 200 is perpendicular to the magnetic field B. A fixed voltage U is then applied to the fourth face 240 and the third face 230 of the semiconductor wafer 200, causing a constant current I to flow through it. At this time, electrons moving in the magnetic field will be deflected by the Lorentz force. Specifically, the direction of the Lorentz force can be determined using the left-hand rule. Let the magnetic field lines of the magnetic field B pass through the palm of your left hand, and point your four fingers in the direction of the current, i.e., in the direction of the third face 230. Then, the direction of your thumb is the direction of the force on the electrons. Therefore, it can be concluded that... Figure 2 In the semiconductor wafer 200, positive charges move in the direction of the applied force, while negative charges move in the opposite direction. Specifically, positive charges move towards the sixth surface 260, and negative charges move towards the fifth surface 250. At this point, a Hall voltage V is obtained on the fifth surface 250 and its opposite sixth surface 260 of the semiconductor wafer 200. With a constant voltage U, the magnitude of this Hall voltage V is positively correlated with the strength of the magnetic field B; that is, the stronger the magnetic field, the larger the Hall voltage V.
[0036] However, the inventors discovered during their research that, due to the increasing pursuit of thinner and lighter electronic devices, the internal component layout space is becoming increasingly limited. Furthermore, some electronic devices have high demands for imaging capabilities, thus requiring a large number of cameras. Within this limited layout space, as the number of cameras increases and the size of each camera grows, the distance between the cameras and the Hall sensors used for stroke detection inside the electronic device becomes increasingly closer. Since cameras typically integrate multiple magnets, when the distance between the camera and the Hall sensor is small, the magnetic field generated by the magnets inside the camera can interfere with the Hall sensor, thereby reducing the accuracy of slider stroke detection. Therefore, the method described above, which uses magnets on the slider and multiple Hall sensors spaced apart in the sliding direction to detect slider stroke, is affected by the magnetic fields generated by other magnetic devices, resulting in a decrease in stroke detection accuracy.
[0037] Therefore, in order to overcome the above-mentioned defects, this application provides a travel detection module, method, and electronic device.
[0038] For details, please refer to Figure 3 , Figure 3 This diagram illustrates a structural block diagram of a stroke detection module 320 provided in an embodiment of this application. Specifically, the stroke detection module 320 can be applied to the detection of a transmission assembly 310. The stroke detection module 320 includes a processor 321 and a first detection component 322, with the processor 321 electrically connected to the first detection component 322. The transmission assembly 310 includes a motor 311, a rotating mechanism 312, and a sliding mechanism 313. The motor 311 can drive the rotating mechanism 312 to rotate, thereby pushing the sliding mechanism 313 to slide.
[0039] In one implementation, please refer to Figure 4 , Figure 4 A structural diagram of a rotating mechanism 312 is shown. The rotating mechanism 312 may include a gear 3121, and a motor 311 may be used to drive the gear 3121 to rotate, thereby pushing the sliding mechanism 313 to slide. The gear 3121 may include a first gear 3122 and a second gear 3123. The first gear 3122 may be sleeved on the output rotating shaft of the motor 311 and rotate synchronously with the output rotating shaft of the motor 311. The second gear 3123 may be sleeved on the sliding mechanism 313 and meshes with the first gear 3122. Therefore, the second gear 3123 may be driven to rotate by the first gear 3122, thereby driving the sliding mechanism 313 to slide.
[0040] For further details, please refer to Figure 5 , Figure 5Another structural diagram of the rotating mechanism 312 is shown. Specifically, the rotating mechanism 312 may include a gear 3121, which may include a first gear 3122, a second gear 3123, and a third gear 3124. The first gear 3122 can be sleeved on the output rotating shaft of the motor 311, rotating synchronously with the output rotating shaft of the motor 311. The third gear 3124 meshes with both the first gear 3122 and the second gear 3123, and can be driven by the first gear 3122, thereby driving the second gear 3123 to rotate. The second gear 3123 can be sleeved on the output rotating shaft of the motor 311. The third gear 3124 can be a variable speed gear, meaning that the third gear 3124 can have different gear ratios with both the first gear 3122 and the second gear 3123, thereby achieving variable speed transmission between the first gear 3122 and the second gear 3123.
[0041] In one embodiment, since the sliding mechanism 313 is pushed to slide by the rotation of the rotating mechanism 312, it is easy to understand that there is a speed ratio relationship between the rotating mechanism 312 and the sliding mechanism 313. Specifically, the speed ratio can be used to characterize the corresponding relationship between the rotation parameters of the rotating mechanism 312 and the sliding displacement of the sliding mechanism 313. For example, if the rotating mechanism 312 rotates a distance A in the first rotation direction, the sliding displacement generated by the sliding mechanism 313 can be a displacement B in the first sliding direction; if the rotating mechanism 312 rotates 2*A in the first rotation direction, the sliding displacement generated by the sliding mechanism 313 can be a displacement 2*B in the first sliding direction. Therefore, the sliding displacement can include both the direction and the magnitude of the sliding displacement. Furthermore, by adjusting the speed ratio, A can be made greater than B in the above example. In this case, the rotating mechanism needs to rotate a larger displacement for the sliding mechanism to slide a smaller displacement. Therefore, by detecting parameters such as the rotation displacement of the rotating mechanism 312 and then determining the sliding displacement of the sliding mechanism 313, the error will be less than that of directly measuring the sliding displacement of the sliding mechanism. For details on how to determine the sliding displacement of the sliding mechanism 313 during the sliding process, please refer to the subsequent introduction.
[0042] Furthermore, since the rotation direction of the rotating mechanism 312 affects the direction of the sliding displacement generated by the sliding mechanism 313, for example, when the rotation direction of the rotating mechanism 312 is a first rotation direction, the sliding mechanism 313 can slide in the first sliding direction; when the rotation direction of the rotating mechanism 312 is a second rotation direction, the sliding mechanism 313 can slide in the second sliding direction. Therefore, in order to determine the direction of the sliding displacement generated by the sliding mechanism 313 through rotation parameters, the aforementioned rotation parameters may include the rotation direction of the rotating mechanism 312. Furthermore, the magnitude of the rotational displacement affects the magnitude of the sliding displacement generated by the sliding mechanism 313; therefore, in order to determine the magnitude of the sliding displacement generated by the sliding mechanism 313 through rotation parameters, the rotation parameters may include the rotational displacement. Furthermore, even for the same rotational displacement, different rotational directions result in different sliding displacements for the sliding mechanism 313. For example, if the rotating mechanism 312 rotates twice, with each rotational displacement being A, and if the rotational direction of the rotating mechanism 312 is the same each time, for example, the first rotational direction, then the sliding mechanism 313 will generate a displacement B in the first sliding direction both times. That is, the sliding mechanism 313 can slide a sliding displacement of B + B = 2 * B in the first sliding direction. However, if the rotational directions of the rotating mechanism 312 are different in the two rotations, for example, the first rotation is in the first rotational direction and the second rotation is in the second rotational direction, then the sliding mechanism 313 can slide a sliding displacement B in the first sliding direction and a sliding displacement B in the second sliding direction. Since the first and second sliding directions are opposite for the sliding mechanism 313, the sliding displacement of the sliding mechanism 313 in this case is BB = 0. Therefore, the rotational displacement included in the rotational parameters should be the rotational displacement corresponding to the rotational direction.
[0043] As the above analysis shows, the rotation parameters can include the rotation direction of the rotation mechanism 312 and the corresponding rotational displacement. The rotation direction determines the direction of the sliding displacement of the sliding module, and the corresponding rotational displacement determines the magnitude of the sliding displacement. Therefore, the sliding displacement of the sliding mechanism 313 can be determined by acquiring the rotation parameters. Specifically, the processor 321 can acquire the rotation parameters and determine the sliding displacement of the sliding mechanism based on them.
[0044] In some embodiments, the rotation parameters of the rotating mechanism 312 can be detected, thereby determining the sliding displacement of the sliding mechanism 313 based on the rotation parameters, and further determining the position of the sliding mechanism 313, thus realizing the position detection of the sliding mechanism 313. Specifically, the rotation parameters of the rotating mechanism 312 can be detected by the first detection component 322.
[0045] In one implementation, please refer to Figure 6 , Figure 6 A structural diagram of the first detection component 322 is shown. Specifically, the first detection component 322 may include a magnet 3221 and a Hall sensor 3222, wherein the Hall sensor 3222 can be connected to the processor 321 and interact with it. The Hall sensor 3222 can sense magnetic fields and send the acquired magnetic field information to the processor 321. Specifically, the Hall sensor 3222 can generate different Hall voltages based on different magnetic fields, and the magnitude of the Hall voltage characterizes the strength of the acquired magnetic field. The processor 321 can be implemented using at least one of the following hardware forms: Microcontroller Unit (MCU), Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA).
[0046] As can be seen from the foregoing analysis, the first detection component 322 can be used to detect the rotation parameters of the rotating mechanism 312. Therefore, the magnet 3221 can be disposed on the gear 3121, and the Hall sensor 3222 is disposed at an interval from the gear 3121. For example, the magnet 3221 can be disposed on the side of the gear 3121. Thus, when the gear 3121 rotates, the relative position between the Hall sensor 3222 and the gear 3121 changes, thereby the Hall sensor can sense the change in the magnetic field of the magnet 3221 disposed on the gear 3121 and send the magnetic field information to the processor 321. For example, Figure 6 In the illustrated embodiment, magnet 3221 is disposed on the second gear 3123, for example, magnet 3221 may be disposed on the side of the second gear 3123. It should be noted that magnet 3221 may also be disposed on the side of the first gear 3122 or the third gear 3124. The following description focuses on the embodiment in which magnet 3221 is disposed on the second gear 3123.
[0047] Furthermore, the rotation direction and displacement of the second gear 3123, on which the magnet 3221 is mounted, can be detected by the Hall sensor 3222. Specifically, as the foregoing analysis shows, the Hall sensor 3222 can generate different Hall electrical signals, such as Hall voltages, based on different magnetic fields. Therefore, the Hall sensor 3222 and the magnet 3221 can be spaced apart. For example, the rotating mechanism 312 may also include a cavity (…). Figure 10 3124), cavity ( Figure 10 The first inner wall is located inside (3124). Figure 10 Hall sensor 3222 can be disposed on the first inner wall (3125). Figure 10 (3125). Therefore, when the second gear 3123 rotates, the relative position between the Hall sensor 3222 and the second gear 3123 changes; that is, the magnet 3221 moves closer to or further away from the Hall sensor 3222 as the second gear 3123 rotates. Since the magnetic field strength generated by the magnet 3221 is inversely related to its distance, the closer the magnet 3221 is to the Hall sensor 3222, the stronger the magnetic field detected by the Hall sensor 3222; conversely, the farther the magnet 3221 is from the Hall sensor 3222, the weaker the magnetic field detected by the Hall sensor 3222. Therefore, the Hall sensor 3222 can be used to sense the distance relationship between the magnet 3221 and the Hall sensor 3222. Furthermore, the Hall sensor 3222 can also generate magnetic fields in different directions based on the different rotation directions of the magnet 3221; therefore, the Hall sensor 3222 can also be used to sense the rotation direction of the magnet 3221 as the second gear 3123 rotates.
[0048] When the magnet 3221 is installed in the gear 3121, such as the second gear 3123, it can rotate with the gear 3121. During the rotation of the magnet 3221, the Hall sensor 3222 detects a maximum magnetic field strength for each revolution. Therefore, by recording the number of times the maximum magnetic field strength is detected, the number of revolutions the gear 3121 makes can be obtained, and the rotational displacement in the rotation parameters can be determined based on the number of revolutions. Specifically, during the rotation of the magnet 3221 with the gear 3121, the Hall sensor 3222 can collect the magnetic field of the magnet 3221 and send the magnetic field information to the processor 321. The magnetic field signal may include a Hall voltage.
[0049] Furthermore, during the sliding process of the sliding mechanism 313, the processor 321 can determine the rotation parameters based on the magnetic field information sent by the Hall sensor 3222. These rotation parameters include the rotation direction of the rotating mechanism 312 and the corresponding rotational displacement. Since the sliding action of the sliding mechanism 313 is driven by the rotation of the rotating mechanism 312, the sliding action of the sliding mechanism 313 can correspond to the rotation of the rotating mechanism 312. Specifically, the rotation direction of the rotating mechanism 312 can be determined based on the magnetic field information during the sliding process of the sliding mechanism 313. For example, if it is predetermined that the first rotation direction of the rotating mechanism 312 corresponds to the first Hall voltage direction and the second rotation direction corresponds to the second Hall voltage direction, then when the processor 321 obtains the Hall voltage direction in the magnetic field information as the first Hall voltage direction, it can determine that the rotation direction of the rotating mechanism 312 is the first rotation direction; when the processor 321 obtains the Hall voltage direction in the magnetic field information as the second Hall voltage direction, it can determine that the rotation direction of the rotating mechanism 312 is the second rotation direction. In one embodiment, when the magnet 3221 is disposed on the second gear 3123, the rotation direction may include the rotation direction of the second gear 3123. Therefore, the rotation direction of the second gear 3123 can be directly used as the rotation direction of the rotating mechanism 312.
[0050] Furthermore, as the above analysis shows, the processor 321 can determine the rotational displacement in the rotation parameters by confirming the number of rotations of the gear 3121 in the rotating mechanism 312 during the sliding process of the sliding mechanism 313. Specifically, the cumulative number of times the intensity of the magnetic field collected by the Hall sensor 3222 reaches a predetermined range during the sliding process of the sliding mechanism 313 can be used as the number of rotations. For example, the processor 321 can detect the number of times the intensity of the magnetic field of the magnet 3221 set on the gear 3121, sensed by the Hall sensor 3222, reaches a preset maximum value, and the intensity of the magnetic field can be characterized by the magnitude of the Hall voltage in the magnetic field information. Each time the processor 321 detects that the magnetic field strength of the magnet 3221 reaches a preset maximum value, it considers that the number of rotations of the magnet 3221 has increased by one. The number of rotations of the magnet 3221 is equivalent to the number of rotations of the gear 3121, thus it is equivalent to the gear 3121 increasing its rotation by one. Therefore, the number of rotations of the gear 3121 can be determined by accumulating the number of times the magnetic field strength sensed by the Hall sensor 3222 reaches the preset maximum value. For example, if the preset maximum value is M, then each time the processor 321 detects that the Hall voltage in the magnetic field information sent by the Hall sensor 3222 reaches the maximum value M, it increases the number of rotations of the gear 3121. The number of rotations of the gear 3121 can be 0 at the beginning of the sliding process of the sliding component 323.
[0051] Optionally, since errors cannot be avoided when the Hall sensor 3222 senses the magnetic field of the magnet 3221 and sends it to the processor 321, a predetermined range can be preset to improve the accuracy of detecting the number of rotations. Each time the Hall voltage in the information transmitted by the Hall sensor 3222 reaches the preset range, the number of rotations of the gear 3121 is increased. The final number of rotations of the gear 3121 can then be obtained. In other words, the cumulative number of times the intensity of the magnetic field sensed by the Hall sensor reaches the predetermined range during the sliding process of the sliding mechanism can be used as the number of rotations, thereby avoiding detection errors and improving the accuracy of detecting the number of rotations. In one embodiment, when the magnet 3221 is mounted on the second gear 3123, the rotational displacement can include the number of rotations of the second gear 3123. Therefore, the number of rotations of the second gear 3123 can be directly used as the rotational displacement.
[0052] Similarly, if magnet 3221 is mounted on the first gear 3122, it is easy to understand that magnet 3221 can rotate synchronously with the rotation of the first gear 3122. Therefore, detecting the number of rotations of magnet 3221 by Hall sensor 3222 and processor 321 is essentially detecting the number of rotations of the first gear 3122 on which magnet 3221 is mounted; and detecting the rotation direction of magnet 3221 is essentially detecting the rotation direction of the first gear 3122. For specific methods, please refer to the above method for obtaining the number of rotations of gear 3121, which will not be repeated here.
[0053] Similarly, if magnet 3221 is mounted on the third gear 3124, it is easy to understand that magnet 3221 can rotate synchronously with the rotation of the third gear 3124. Therefore, detecting the number of rotations of magnet 3221 by Hall sensor 3222 and processor 321 is essentially detecting the number of rotations of the third gear 3124 on which magnet 3221 is mounted; and detecting the rotation direction of magnet 3221 is essentially detecting the rotation direction of third gear 3124. For specific methods, please refer to the above method for obtaining the number of rotations of gear 3121, which will not be repeated here.
[0054] Optionally, there can be multiple magnets 3221, such as two. See also Figure 7 , Figure 7This diagram illustrates a structure of a first detection component 322 according to another embodiment of this application. Specifically, the first detection component 322 may include a magnet 3221, a Hall sensor 3222, and a second magnet 3223. The Hall sensor 3222 can be connected to a processor 321 for data interaction, for example, sending information about the acquired magnetic field to the processor 321. The magnets 3221 and 3223 can be equidistantly arranged along the circumference of the gear 3121, for example, equidistantly arranged along the circumference of the first gear 3122, the second gear 3123, or the third gear 3124. Since there are two magnets, whenever the processor 321 detects that the Hall voltage reaches a predetermined range in the magnetic field information sent by the Hall sensor 3222, it increases the number of rotations of the gear 3121 by 1 / 2 turn, thus obtaining the final number of rotations of the gear 3121. This embodiment increases the number of magnets on the gear 3121, thereby reducing the minimum detection accuracy of the number of rotations of the gear 3121 from a single rotation with one magnet to 1 / N rotations with N magnets. For example, when two magnets are used, the minimum detection accuracy can be reduced to 1 / 2 rotation, or half a rotation, thus improving the accuracy of detecting the number of rotations.
[0055] Furthermore, the processor 321 can determine the sliding displacement of the sliding mechanism based on the rotation parameters determined during the sliding process of the sliding mechanism 313.
[0056] In some implementations, the end position of the sliding mechanism 313 during the sliding process can be determined by the stroke detection module 320. See also... Figure 8 , Figure 8 The diagram shows the structure of the transmission assembly provided in the embodiment of this application. The transmission assembly 310 may also include a cavity 314. The sliding mechanism 313 is located in the cavity 314 and can slide in the cavity 314. A pre-set target calibration point may exist in the cavity, and the target calibration position corresponding to the target calibration point can be used as a known standard position.
[0057] Furthermore, the cavity 314 may include a first sidewall 3141 and a second sidewall 3142 opposite to each other along the sliding direction of the sliding mechanism 313, wherein the first sidewall 3141 may correspond to a first calibration point, the second sidewall 3142 may correspond to a second calibration point, and the target calibration point may be at least one of the first calibration point and the second calibration point. Optionally, within the cavity 314, there may also be other calibration points between the first sidewall 3141 and the second sidewall 3142, which may also serve as target calibration points.
[0058] In some implementations, the stroke detection module 320 can first obtain the initial position of the sliding mechanism 313 at the start of the sliding action, where the initial position can be the end position corresponding to the previous sliding action. Then, it can obtain the rotation parameters of the rotating mechanism 312 detected by the first detection component 322 during the sliding process of the sliding mechanism 313. The details of obtaining the rotation parameters have been described in detail in the foregoing embodiments and will not be repeated here.
[0059] Furthermore, since determining the ending position of the sliding mechanism 313 through rotation parameters and the initial position may result in cumulative errors, the sliding mechanism 313 can be calibrated by using the target calibration position corresponding to a pre-set target calibration point within the cavity. This improves the accuracy of determining the ending position of the sliding mechanism 313's sliding action. Therefore, the ending position of the sliding mechanism at the end of the sliding motion can be obtained first, and it can be determined whether the ending position is the preset target calibration point.
[0060] If the sliding mechanism 313 ends at a preset target calibration point, since the target calibration position corresponding to the target calibration point can be used as a known standard position, the target calibration position can be directly used as the end position corresponding to the sliding action. Therefore, it is not necessary to obtain the end position through rotation parameters and initial position, thereby improving the accuracy of determining the end position of the sliding action of the sliding mechanism 313.
[0061] In other implementations, if the sliding mechanism 313 does not end at the preset target calibration point at the end of the sliding action, the end position of the sliding mechanism 313 can be determined based on the rotation parameters and the initial position.
[0062] In this scenario, if the sliding mechanism 313's final position during the sliding motion is not the preset target calibration point, it can include situations where the sliding mechanism 313 reaches the target calibration point but has not yet ended the sliding process. In this case, the sliding displacement of the sliding mechanism 313 during the sliding process can be calibrated using the target calibration position corresponding to the target calibration point. Specifically, previously acquired rotational parameters and initial positions can be cleared; for example, the rotational parameters and initial positions acquired before the sliding mechanism 313 passes the target calibration point can be cleared. Then, the sliding operation after the sliding mechanism 313 passes the target calibration point is treated as a new sliding operation, the target calibration position corresponding to the target calibration point is used as the new initial position, and the process returns to acquire rotational parameters. This improves the accuracy of determining the final position of the sliding motion of the sliding mechanism 313 by using the target calibration position.
[0063] Furthermore, the sliding mechanism 313 may not end at the preset target calibration point at the end of the sliding action. In this case, the sliding mechanism 313 may not pass through the calibration point during the sliding process. In this case, the sliding displacement of the sliding mechanism 313 during the sliding process can be determined based on the rotation parameters. Then, the end position of the sliding mechanism 313 can be determined based on the initial position and the sliding displacement.
[0064] For example, if the magnet 3221 is disposed on the second gear 3123, the rotation parameters can be determined based on the second gear 3123. Specifically, the rotation direction corresponding to the rotation parameters is the first direction of rotation of the second gear 3123. The rotational displacement corresponding to the first direction includes the second gear 3123 rotating N1 revolutions. Since the second gear 3123 is sleeved on the sliding mechanism 313, the direction of the sliding displacement generated by the sliding mechanism 313 when the second gear 3123 rotates in the first direction is known, for example, the first sliding direction. The sliding displacement generated by the second gear 3123 rotating 1 revolution on the sliding mechanism 313 is also known, for example, ΔX1. Therefore, it can be determined that the sliding displacement of the sliding mechanism 313 during the sliding process is a displacement of N1*ΔX1 in the first sliding direction.
[0065] For example, if the magnet 3221 is disposed on the first gear 3122, the rotation parameters can be determined based on the first gear 3122. Specifically, the rotation direction corresponding to the rotation parameter is the first direction of rotation of the first gear 31222. The rotational displacement corresponding to this first direction includes N2 rotations of the first gear 3122. Since the second gear 3123 is fitted onto the sliding mechanism 313, the direction of the sliding displacement generated by the sliding mechanism 313 when the first gear 3122 rotates in the first direction can be known in advance through the meshing relationship between the first gear 3122 and the second gear 3123, for example, the first sliding direction. The sliding displacement generated on the sliding mechanism 313 when the second gear 3123 rotates 1 revolution is known, for example, ΔX1. Combined with the gear ratio between the second gear 3123 and the first gear 3122, the sliding displacement generated on the sliding mechanism 313 when the first gear 3122 rotates 1 revolution can be determined through the gear ratio and ΔX1, for example, ΔX2. At this time, it can be determined that the sliding displacement of the sliding mechanism 313 during the sliding process is a displacement of N2*ΔX2 in the first sliding direction.
[0066] Similarly, if the magnet 3221 is disposed on the third gear 3124, the method for determining the sliding displacement of the sliding mechanism 313 during the sliding process is similar to that described above, and will not be repeated here.
[0067] Furthermore, after determining the sliding displacement during the sliding process, the ending position of the sliding mechanism 313 can be determined based on the initial position and the sliding displacement. For example, it can be pre-set that when the sliding displacement is in the first sliding direction, the sliding displacement is increased based on the initial position; and when the sliding displacement is in the second sliding direction, the sliding displacement is decreased based on the initial position. For example, if the initial position is X1, and the previously determined sliding displacement is a displacement N1*ΔX1 in the first sliding direction, then the ending position is X1+N1*ΔX1.
[0068] It should be noted that the sliding direction of the sliding mechanism 313 is not limited to the relationship between the initial position and the sliding displacement in this embodiment of the application, and can be flexibly set as needed.
[0069] In some embodiments, the travel detection module 320 may further include a second detection component 323, wherein the second detection component 323 is used to send an interrupt signal to the processor 321 when it detects that the sliding mechanism 313 is located at the target calibration position corresponding to the target calibration point.
[0070] Specifically, the location of the target calibration point is the target calibration position. When the target calibration point is either the first calibration point corresponding to the first sidewall 3141 or the second calibration point corresponding to the second sidewall 3142, the second detection component 323 can detect whether the sliding mechanism 313 is in the first calibration position corresponding to the first calibration point or the second calibration position corresponding to the second calibration point. Optionally, when the target calibration point is the calibration point between the first sidewall 3141 and the second sidewall 3142 inside the cavity 314, the second detection component 323 can also detect whether the sliding mechanism 313 is in the calibration position corresponding to the calibration point.
[0071] The second detection component 323 may include multiple detection modules and an interrupt signal triggering module. The multiple detection modules and the interrupt signal triggering module are connected. The multiple detection modules can be used to detect whether the sliding mechanism 313 is located at the target calibration position corresponding to the target calibration point. When the sliding mechanism 313 is detected to be located at the target position corresponding to the target calibration point, the detection state of the corresponding detection module can change. At this time, the interrupt signal triggering module can determine that the sliding mechanism 313 is located at the target calibration position corresponding to the target calibration point according to the change in the detection state of the detection module, and then send an interrupt signal to the processor 321.
[0072] For example, please continue reading Figure 8The aforementioned detection module may include a contact spring 3143, meaning the second detection component 323 may include a contact spring 3143 and an interrupt signal triggering module 3144. The interrupt signal triggering module 3144 is connected to both the contact spring 3143 and the processor 321. The contact spring 3143 is positioned at the target calibration position corresponding to the target calibration point. The contact spring 3143 may have a default state and a contact state. When the contact spring 3143 is not in contact with the sliding mechanism 313, it is in the default state. When the contact spring 3143 contacts the sliding mechanism 313, it switches to the contact state. The interrupt signal triggering module can detect the state of the contact spring 3143 to determine whether the sliding mechanism 313 is located at the target calibration position corresponding to the target calibration point. Specifically, when the interrupt signal triggering module detects that the contact spring 3143 has switched from the default state to the contact state, it can send an interrupt signal to the processor 321.
[0073] It is easy to understand that since there can be more than one target calibration point, there can also be more than one contact spring 3143, meaning that the contact spring 3143 can be set at the target calibration position corresponding to each target calibration point. Furthermore, different contact springs 3143 can have different identity information; that is, the interrupt signal triggering module 3144 can determine the target calibration point corresponding to the contact spring 3143 whose state has changed based on different identity information. For example, please refer to [further details omitted]. Figure 8 It also includes a second contact spring 3145. The target calibration points include a first calibration point and a second calibration point. The contact spring 3143 is set at the first calibration position corresponding to the first calibration point, and the second contact spring 3145 is set at the second calibration position corresponding to the second calibration point. If the interrupt signal triggering module 3144 detects that the state of the contact spring 3143 has switched from the default state to the contact state, it can send an interrupt signal with the identification information of the contact spring 3143 to the processor 321.
[0074] Furthermore, the processor 321 is used to determine, based on the interrupt signal, that the sliding mechanism 313 has reached the target calibration point during the sliding process. Optionally, if the target calibration point includes more than one calibration point, the interrupt signal may also include the identity information of the contact spring 3143 that triggered the interrupt signal. Then, based on the identity information, the target calibration point corresponding to the contact spring 3143 can be determined, thereby determining that the sliding mechanism 313 is located at the target calibration position corresponding to the target calibration point.
[0075] For example, please continue reading Figure 8The second detection component 323 may include a contact spring 3143 and a second contact spring 3145. The contact spring 3143 is disposed on the first sidewall 3141, corresponding to the first calibration point; the second contact spring 3145 is disposed on the second sidewall 3142, corresponding to the second calibration point. The contact spring 3143 can detect whether the sliding mechanism 313 is located at the first calibration position corresponding to the first calibration point, and the second contact spring 3145 can detect whether the sliding mechanism 313 is located at the second calibration position corresponding to the second calibration point. Specific detection steps can be found in the foregoing description and will not be repeated here.
[0076] In some implementations, please refer to the following: Figure 8 and Figure 9 The sliding mechanism 313 may further include a slider 3131, which may be located within the cavity 314 of the transmission assembly 310 and slide within the cavity 314. For example, the sliding mechanism 313 may also include a lead screw 3133 and a sliding plate 3132. The slider 3131 may be fixedly connected to the sliding plate 3132, and the sliding plate 3132 may be threadedly connected to the lead screw 3133. The lead screw 3133 may be connected to a rotating mechanism 312. Rotation of the rotating mechanism 312 drives the lead screw 3133 to rotate, thereby pushing the sliding plate 3132 to slide, thus causing the slider 3131 to slide. For example, the position corresponding to the first sidewall 3141 can be taken as the zero point of the sliding stroke; that is, when the slider 3131 is at the first sidewall 3141, the sliding stroke of the slider is zero, meaning the slider has a minimum sliding stroke. When slider 3131 slides from the first sidewall 3141 to the second sidewall 3142, the sliding stroke of slider 3131 increases. When slider 3131 is on the second sidewall 3142, slider has the maximum sliding stroke.
[0077] Furthermore, the transmission assembly 310 can have both a fully closed state and a fully open state. In some embodiments, the state of the transmission assembly 310 can be determined by the sliding stroke of the slider 3131. For example, see [link to relevant documentation]. Figure 8 When slider 3131 is at the first sidewall 3141, that is, when slider has its minimum sliding stroke, the transmission assembly 310 can be in a fully closed state. For another example, please refer to [further details omitted]. Figure 9 When the slider 3131 is at the second side wall 3142, the slider has the maximum sliding stroke, and at this time the transmission assembly 310 can be in the fully open state.
[0078] Optional, please refer to Figure 10Within the cavity 314, between the first sidewall 3141 and the second sidewall 3142, there can also be an intermediate state point. This intermediate state point is used to characterize that the sliding stroke of the slider 3131 is between the maximum and minimum sliding stroke. In this case, the slider 3131 being at an intermediate state point corresponds to an intermediate state of the transmission assembly 310. It is easy to understand that there can be multiple intermediate state points between the maximum and minimum sliding stroke; that is, the slider 3131 can be at at least one of several different intermediate state points. Therefore, the transmission assembly 310 can also have several different intermediate states, each corresponding to an intermediate state of the slider 3131.
[0079] The stroke detection module provided in this application includes a transmission component comprising a motor, a rotating mechanism, and a sliding mechanism. The motor drives the rotating mechanism to rotate, thereby pushing the sliding mechanism to slide. The stroke detection module includes a first detection component and a processor electrically connected to the first detection component. The first detection component detects the rotation parameters of the rotating mechanism, including the rotation direction and the corresponding rotational displacement. The processor acquires the rotation parameters and determines the sliding displacement of the sliding mechanism based on them. Since the rotating mechanism pushes the sliding mechanism to slide, and there is a speed ratio between the rotating mechanism and the sliding mechanism, this application determines the end position of the sliding process of the sliding mechanism by combining the initial position and the rotation parameters, which has higher accuracy compared to directly detecting the end position of the sliding module. Furthermore, since the target calibration position corresponding to the target calibration point can be used as a standard position, this application can use the target calibration position corresponding to the target calibration point as the end position of the sliding action when the end point of the sliding action is the preset target calibration point, without having to obtain the end position through measurement or calculation, which can further improve the accuracy of determining the end position of the sliding mechanism.
[0080] In some implementations, please refer to Figure 11 , Figure 11 A structural diagram of a stroke detection module and a transmission assembly is shown. The stroke detection module 320 is used for detection of the transmission assembly 310. Specifically, the stroke detection module 320 includes a processor 321 and a first detection component 322 electrically connected to the processor 321. The transmission assembly 310 includes a motor 311, a rotating mechanism 312, and a sliding mechanism 313. The motor 311 drives the rotating mechanism 312 to rotate, thereby pushing the sliding mechanism 313 to slide.
[0081] The first detection component 322 includes a magnet 3221 and a Hall sensor 3222. The magnet 3221 can be disposed on a gear 3121. Specifically, the gear can include a first gear 3122, a second gear 3123, and a third gear 3124. That is, the magnet 3221 can be disposed on the first gear 3122, the second gear 3123, or the third gear 3124. For example, the magnet 3221 can be disposed on the side of the gear 3121. The Hall sensor 3222 and the magnet 3221 can be disposed at intervals. For example, the rotating mechanism 312 can also include a cavity 3124 with a first inner wall 3125. The Hall sensor 3222 can be disposed on the first inner wall 3125, and the processor 321 can also be disposed on the first inner wall 3125 and electrically connected to the Hall sensor 3222 to obtain information about the magnetic field sensed by the Hall sensor 3222.
[0082] The motor 311 may include a sun gear 3111, planetary gears 3112, and an internal gear ring 3113. The sun gear 3111 is connected to the output shaft of the motor 311, so that the motor 311 can drive the sun gear 3111 to rotate. The planetary gears 3112 mesh with the sun gear 3111 and the internal gear ring 3113 respectively. The rotation of the sun gear 3111 drives the planetary gears 3112 to rotate, thereby driving the internal gear ring 3113 to rotate, and then outputting the rotational torque to the first gear 3122, thereby causing the first gear 3122 to rotate.
[0083] Furthermore, the transmission assembly 310 may also include a cavity 314, with a sliding mechanism 313 located within the cavity and capable of sliding within it. The cavity 314 may include a first sidewall 3141 and a second sidewall 3142 opposite to each other along the sliding direction of the sliding mechanism 313. The first sidewall 3141 may correspond to a first calibration point, and the second sidewall 3142 may correspond to a second calibration point. A pre-set target calibration point may exist within the cavity, and the target calibration position corresponding to this target calibration point may be a known standard position. The target calibration point may be at least one of the first calibration point and the second calibration point. A contact spring 3143 and an interrupt signal triggering module 3144 may be provided on the first sidewall, and a second contact spring 3145 may be provided on the second sidewall.
[0084] Furthermore, the sliding mechanism 313 may also include a lead screw 3133 and a sliding plate 3132. The slider 3131 may be fixedly connected to the sliding plate 3132, and the sliding plate 3132 may be threadedly connected to the lead screw 3133. The lead screw 3133 may be connected to a rotating mechanism 312. When the rotating mechanism 312 rotates, it drives the lead screw 3133 to rotate, which in turn pushes the sliding plate 3132 to slide, thereby causing the slider 3131 to slide.
[0085] The above-mentioned stroke detection module is used for the detection of transmission component 310, which can be referred to in the detailed description of the foregoing embodiments, and will not be repeated here.
[0086] The stroke detection module and transmission assembly provided in this application embodiment can integrate the stroke detection module into the transmission assembly, which can simplify the module layout, space occupation, and assembly process, and help reduce the overall cost of the machine.
[0087] Please see Figure 12 , Figure 12 This application illustrates a travel detection method provided in an embodiment, which can be applied to... Figure 3 The transmission assembly 310 shown includes a motor 311, a rotating mechanism 312, and a sliding mechanism 313. The motor 311 drives the rotating mechanism 312 to rotate, thereby pushing the sliding mechanism 313 to slide. Specifically, the stroke detection method includes steps S110 and S120.
[0088] Step S110: Obtain the rotation parameters of the rotating mechanism during the sliding process of the sliding mechanism. The rotation parameters include the rotation direction of the rotating mechanism and the rotation displacement corresponding to the rotation direction.
[0089] Step S120: Determine the sliding displacement of the sliding mechanism based on the rotation parameters.
[0090] In some implementations, the sliding process can be a sliding action corresponding to a sliding command issued by the user to the transmission component. The transmission component responds to the sliding command by controlling the rotation mechanism via a motor to push the sliding mechanism to slide. At this time, the stroke detection module can detect the sliding displacement of the sliding mechanism during the sliding action. Specifically, the rotation parameters of the rotating mechanism during the sliding process can be obtained first, including the rotation direction and the corresponding rotational displacement. Then, the sliding displacement of the sliding mechanism can be determined based on the rotation parameters. The details of obtaining the rotation parameters and determining the sliding displacement using the rotation parameters have been described in detail in the preceding embodiments and will not be repeated here.
[0091] Please see Figure 13 , Figure 13 This application illustrates a travel detection method provided in an embodiment, which can be applied to... Figure 3 The transmission component 310 shown specifically includes steps S210 to S250 in the stroke detection method.
[0092] Step S210: Obtain the rotation parameters of the rotating mechanism during the sliding process of the sliding mechanism. The rotation parameters include the rotation direction of the rotating mechanism and the rotation displacement corresponding to the rotation direction.
[0093] Step S220: Obtain the initial position of the sliding mechanism at the start of sliding.
[0094] Step S230: Obtain the ending position of the sliding mechanism at the end of the sliding process, and determine whether the ending position is the preset target calibration point.
[0095] Step S240: If the ending position is a preset target calibration point, then determine the ending position of the sliding mechanism based on the target calibration position corresponding to the target calibration point.
[0096] Step S250: If the ending position is not the preset target calibration point, then determine the ending position of the sliding mechanism based on the rotation parameters and the initial position.
[0097] In some implementations, the initial position of the sliding mechanism at the start of sliding can be obtained first, where the initial position can be the ending position corresponding to the previous sliding action. Then, the rotation parameters of the rotating mechanism detected by the sliding mechanism during the sliding process can be obtained, where the rotation parameters include the rotation direction of the rotating mechanism and the rotational displacement corresponding to that rotation direction. The details of obtaining the rotation parameters have been described in detail in the preceding embodiments and will not be repeated here.
[0098] Furthermore, since determining the ending position of the sliding mechanism through rotation parameters and initial position may result in cumulative errors, the sliding mechanism can be calibrated by using a target calibration position corresponding to a pre-set target calibration point within the cavity. This improves the accuracy of determining the ending position of the sliding mechanism's sliding motion. Specifically, the ending position of the sliding mechanism at the end of its sliding motion can be obtained first, and then it can be determined whether the ending position is the preset target calibration point.
[0099] If the ending position is a preset target calibration point, since the target calibration position corresponding to the target calibration point can be used as a known standard position, the ending position of the sliding mechanism can be determined based on the target calibration position corresponding to the target calibration point. For example, the target calibration position can be directly used as the ending position corresponding to the sliding action, thus eliminating the need to obtain the ending position through rotation parameters and the initial position, thereby improving the accuracy of determining the ending position of the sliding mechanism's sliding action. For a detailed explanation of directly using the target calibration position as the ending position corresponding to the sliding action, please refer to the description in the foregoing embodiments, which will not be repeated here.
[0100] If the ending position is not the preset target calibration point, the ending position of the sliding mechanism can be determined based on the rotation parameters and the initial position. In one embodiment, the rotation direction can be determined based on the information of the magnetic field during the sliding process of the sliding mechanism; the cumulative number of times the magnetic field strength reaches a predetermined range during the sliding process of the sliding mechanism can be obtained as the number of rotations; the rotational displacement can be obtained based on the number of rotations; and the sliding displacement of the sliding mechanism can be determined based on the rotation direction and the rotational displacement. For details, please refer to the description in the foregoing embodiments, which will not be repeated here.
[0101] In other implementations, if the end position is a preset target calibration point, the target calibration position corresponding to the preset target calibration point can be directly used as the end position of the sliding. Alternatively, the end position of the sliding mechanism can be determined based on the rotation parameters and the initial position.
[0102] Furthermore, the fact that the sliding mechanism's sliding action ends at a point other than the preset target calibration point can include situations where the sliding mechanism reaches the target calibration point during the sliding process but does not end the sliding, or situations where the sliding mechanism does not pass the calibration point during the sliding process. For details, please refer to [link to relevant documentation]. Figure 14 , Figure 14 A diagram illustrating one embodiment of step S250 is shown, including steps S251 to S253.
[0103] Step S251: Determine whether the sliding mechanism passes through the target calibration point during the sliding process.
[0104] Step S252: If the sliding mechanism reaches the target calibration point during the sliding process but does not end the sliding, then the sliding operation after the sliding mechanism passes the target calibration point is taken as the new sliding operation, the target calibration position corresponding to the target calibration point is taken as the new initial position, and the operation of obtaining rotation parameters is returned.
[0105] Step S253: If the sliding component does not pass through the calibration point during the sliding action, the sliding displacement of the sliding component during the sliding action is determined based on the rotation parameters, and the ending position of the sliding component is determined based on the initial position and the sliding displacement.
[0106] If the sliding mechanism reaches the target calibration point during the sliding process but does not end the sliding, the sliding displacement of the sliding mechanism during the sliding process can be calibrated using the target calibration position corresponding to the target calibration point. Specifically, the previously acquired rotation parameters and initial position can be cleared. For example, the rotation parameters and initial position acquired before the sliding mechanism passed the target calibration point can be cleared. Then, the sliding operation after the sliding mechanism passes the target calibration point is taken as the new sliding operation, the target calibration position corresponding to the target calibration point is taken as the new initial position, and the operation of acquiring rotation parameters is returned. This improves the accuracy of determining the end position of the sliding action of the sliding mechanism by using the target calibration position.
[0107] If the sliding mechanism does not pass the calibration point during the sliding process, the sliding displacement of the sliding mechanism during the sliding process can be determined based on the rotation parameters; then, the ending position of the sliding mechanism can be determined based on the initial position and the sliding displacement. For a detailed explanation of determining the ending position of the sliding mechanism based on the initial position and the sliding displacement, please refer to the description in the foregoing embodiments, which will not be repeated here.
[0108] In some embodiments, a pre-calibration can be performed before executing step S220. Pre-calibration ensures the sliding mechanism is positioned at the target calibration position corresponding to the target calibration point. This allows the target calibration position to be used as the initial position when the sliding mechanism begins its sliding motion. This avoids the cumulative error that might result from directly using the end position of the previous sliding motion as the initial position. Specifically, the pre-calibration can be performed after the user issues a sliding command to the transmission component. In response to the sliding command, the transmission component first performs the pre-calibration and then executes the instruction corresponding to the sliding command.
[0109] For details, please refer to Figure 15 , Figure 15 A flowchart of a pre-calibration implementation method is shown, which may specifically include steps S201 to S203.
[0110] Step S201: Determine whether the sliding mechanism is at the target calibration position corresponding to the target calibration point.
[0111] Step S202: If not, control the sliding components to move to the specified calibration position, and use the specified calibration position as the end position of the pre-calibration.
[0112] Step S203: If yes, take the target calibration position corresponding to the current target calibration point as the end position of the pre-calibration.
[0113] The specified calibration location can be the target calibration location. When there are multiple target calibration points, there are also multiple target calibration locations. In this case, the specified calibration location can be any one of the multiple target calibration locations.
[0114] Pre-calibration can avoid the cumulative error that may result from directly using the end position of the previous sliding action as the initial position.
[0115] The stroke detection method provided in this application can be applied to a stroke detection module, which is applied to a transmission component. Specifically, it first obtains the initial position of the sliding mechanism at the start of the sliding action and the rotation parameters of the rotating mechanism during the sliding process. If the end point of the sliding action is a preset target calibration point, the target calibration position corresponding to the target calibration point is taken as the end position of the sliding action. If the end point of the sliding action is not the preset target calibration point, the end position of the sliding mechanism is determined based on the rotation parameters and the initial position. Since the rotating mechanism drives the sliding mechanism to slide, there is a speed ratio between the rotating mechanism and the sliding mechanism. Therefore, this application determines the end position of the sliding process of the sliding mechanism by jointly using the initial position and rotation parameters, which has higher accuracy than directly detecting the end position of the sliding module. Furthermore, since the target calibration position corresponding to the target calibration point can be used as a standard position, this application can take the target calibration position corresponding to the target calibration point as the end position of the sliding action when the end point of the sliding action is the preset target calibration point, without having to obtain the end position through measurement or calculation, which can further improve the accuracy of determining the end position of the sliding mechanism.
[0116] Please see Figure 16 , Figure 16 The diagram shows a structural block diagram of an electronic device 1600 provided in an embodiment of this application. Specifically, the electronic device 1600 includes a transmission component 310 and a stroke detection module 320, wherein the stroke detection module 320 is connected to the transmission component 310 and is used for detecting the transmission component 310.
[0117] The electronic device 1600 can be a smartphone, tablet, laptop, in-vehicle mobile computer, or other similar device; this embodiment does not limit the specific device. The transmission component 310 in the electronic device 1600 can respond to a user's sliding command and be in different states. For example, the transmission component 310 can be in a fully open or fully closed state, or it can be in an intermediate state. The stroke detection module 320 can also be used to detect the position of the transmission component 310 and, based on its current position, further determine whether the transmission component 310 has fully executed the sliding command, i.e., whether it has slid to the position indicated by the sliding command.
[0118] Furthermore, when the stroke detection module 320 detects that the transmission component has received a sliding command from the user, and detects that the transmission component 310 has not sent a sliding signal within a specified time, it can be determined that the motor 311 in the transmission component 310 has malfunctioned, such as stalling. The composition of the stroke detection module 320 and the transmission component 310 can be found in the descriptions of the preceding embodiments. The method by which the stroke detection module 320 detects the transmission component 310 can also be found in the descriptions of the preceding embodiments, and will not be repeated here.
[0119] Optionally, the stroke detection module 320 may further include a position storage module and a sliding direction module. The position storage module can be used to store the end position of the previous one or more sliding processes, so that when it is necessary to determine the end position of the previous sliding process, it can be directly read through the position storage module. The sliding direction module can store the sliding direction of the sliding mechanism corresponding to the rotation parameters determined above.
[0120] refer to Figure 17 This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 1700 stores program code that can be called by a processor to execute the methods described in the above method embodiments.
[0121] The computer-readable storage medium 1700 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 1700 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 1700 has storage space for program code 1710 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 1710 may, for example, be compressed in a suitable form.
[0122] Please refer to Figure 18 The diagram illustrates a structural block diagram 1800 of a computer program product provided in an embodiment of this application. The computer program product 1800 includes a computer program / instructions 1810, which, when executed by a processor, implements the steps of the aforementioned method.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A travel detection module, characterized in that, This invention is applied to the detection of transmission components, which include a motor, a rotating mechanism, and a sliding mechanism. The motor drives the rotating mechanism to rotate, thereby pushing the sliding mechanism to slide. The stroke detection module includes a first detection component, a processor electrically connected to the first detection component, and a second detection component. The second detection component includes a contact spring and an interrupt signal triggering module. The interrupt signal triggering module is connected to the contact spring and the processor, respectively. The contact spring is set at a target calibration position corresponding to a target calibration point. The target calibration position is used to calibrate the sliding displacement of the sliding mechanism during the sliding process. The first detection component is used to detect the rotation parameters of the rotating mechanism, the rotation parameters including the rotation direction of the rotating mechanism and the rotation displacement corresponding to the rotation direction; The contact spring is used to switch from a default state to a contact state when it contacts the sliding mechanism; The interrupt signal triggering module is used to send the interrupt signal to the processor when it detects that the contact spring has switched from the default state to the contact state; The processor is used to acquire the rotation parameters and determine the sliding displacement of the sliding mechanism based on the rotation parameters.
2. The travel detection module according to claim 1, characterized in that, The processor is configured to: Obtain the initial position of the sliding mechanism at the start of sliding; Obtain the ending position of the sliding mechanism at the end of the sliding process, and determine whether the ending position is a preset target calibration point; If the ending position is a preset target calibration point, then the ending position of the slide is determined based on the target calibration position corresponding to the target calibration point; If the ending position is not the preset target calibration point, the ending position of the sliding mechanism is determined based on the rotation parameters and the initial position.
3. The stroke detection module according to claim 2, characterized in that, The processor is configured to: If the sliding mechanism reaches the target calibration point during the sliding process but does not end the sliding, the sliding operation after the sliding mechanism passes the target calibration point is taken as a new sliding operation, the target calibration position corresponding to the target calibration point is taken as the new initial position, and the operation of obtaining rotation parameters is returned.
4. The stroke detection module according to claim 1, characterized in that, The rotating mechanism includes a gear, and the motor drives the gear to rotate in order to push the sliding mechanism to slide. The first detection component includes a magnet and a Hall sensor. The magnet is disposed on the gear, and the Hall sensor is disposed at a distance from the gear. When the gear rotates, the relative position between the Hall sensor and the gear changes.
5. The stroke detection module according to claim 4, characterized in that, The Hall sensor is used to sense the magnetic field of the magnet disposed on the gear and send the information of the magnetic field to the processor; The processor determines the rotation parameters based on the magnetic field collected multiple times by the Hall sensor during the sliding process of the sliding mechanism.
6. The travel detection module according to claim 4, characterized in that, The plurality of magnets are arranged at equal intervals along the circumference of the gear.
7. The stroke detection module according to claim 5, characterized in that, The processor is configured to: The rotation direction is determined based on the information of the magnetic field during the sliding process of the sliding mechanism; The cumulative number of times the intensity of the magnetic field sensed by the Hall sensor reaches a predetermined range during the sliding process of the sliding mechanism is taken as the number of rotations; The rotational displacement is obtained based on the number of rotations. The sliding displacement of the sliding mechanism is determined based on the rotation direction and the rotation displacement.
8. The stroke detection module according to claim 1, characterized in that, The transmission assembly further includes a cavity, and the sliding mechanism is located in the cavity and can slide in the cavity. The cavity includes a first sidewall and a second sidewall that are opposite to each other along the sliding direction of the sliding mechanism. The target calibration point includes at least one of a first calibration point corresponding to the first sidewall and a second calibration point corresponding to the second sidewall.
9. The travel detection module according to claim 1, characterized in that, The sliding mechanism includes a slider, which is located within the cavity of the transmission assembly and is capable of sliding within the cavity; The cavity includes a first sidewall and a second sidewall that are opposite to each other along the sliding direction of the slider. When the slider is on the first sidewall, the slider has a minimum sliding stroke, and when the slider is on the second sidewall, the slider has a maximum sliding stroke.
10. A method for detecting travel distance, characterized in that, The method is applied to a transmission assembly, which includes a motor, a rotating mechanism, and a sliding mechanism, wherein the motor drives the rotating mechanism to rotate, thereby pushing the sliding mechanism to slide; the method includes: The first detection component obtains the rotation parameters of the rotating mechanism during the sliding process of the sliding mechanism. The rotation parameters include the rotation direction of the rotating mechanism and the rotation displacement corresponding to the rotation direction. The sliding displacement of the sliding mechanism is determined by a second detection component based on the rotation parameters. The second detection component includes a contact spring and an interrupt signal triggering module. The interrupt signal triggering module is connected to the contact spring and a processor, respectively. The contact spring is set at a target calibration position corresponding to the target calibration point. The contact spring is used to switch from a default state to a contact state when it contacts the sliding mechanism. The interrupt signal triggering module is used to send an interrupt signal to the processor when it detects that the contact spring has switched from the default state to the contact state. The processor is used to determine, based on the interrupt signal, that the sliding mechanism has reached the target calibration point during the sliding process. The target calibration position is used to calibrate the sliding displacement of the sliding mechanism during the sliding process.
11. The method according to claim 10, characterized in that, Determining the sliding displacement of the sliding mechanism based on the rotation parameters includes: Obtain the initial position of the sliding mechanism at the start of sliding; Obtain the ending position of the sliding mechanism at the end of the sliding process, and determine whether the ending position is a preset target calibration point; If the ending position is a preset target calibration point, then the ending position of the sliding mechanism is determined based on the target calibration position corresponding to the target calibration point; If the ending position is not the preset target calibration point, then the ending position of the sliding mechanism is determined based on the rotation parameters and the initial position.
12. The method according to claim 11, characterized in that, If the ending position is not a preset target calibration point, then determining the ending position of the sliding mechanism based on the rotation parameters and the initial position includes: If the sliding mechanism reaches the target calibration point during the sliding process but does not end the sliding, the sliding operation after the sliding mechanism passes the target calibration point is taken as a new sliding operation, the target calibration position corresponding to the target calibration point is taken as the new initial position, and the operation of obtaining rotation parameters is returned.
13. The method according to claim 11, characterized in that, The method includes: The direction of rotation is determined based on the information about the magnetic field during the sliding process of the sliding mechanism; The cumulative number of times the magnetic field strength reaches a predetermined range during the sliding process of the sliding mechanism is obtained as the number of rotations; The rotational displacement is obtained based on the number of rotations. The sliding displacement of the sliding mechanism is determined based on the rotation direction and the rotation displacement.
14. An electronic device, characterized in that, The electronic device includes a transmission assembly and a stroke detection module as described in any one of claims 1-9. The transmission assembly includes a motor, a rotating mechanism, and a sliding mechanism. The motor drives the rotating mechanism to rotate so as to push the sliding mechanism to slide. The stroke detection module is used for detecting the transmission assembly.