Detection device for detecting an end piece position of a servo motor for robot joints and servo motor

The detection device with gears of differing tooth counts and magnetic encoders accurately determines the servomotor's end portion position, addressing inaccuracy in existing methods and enhancing robotic joint control precision.

DE202025102332U1Active Publication Date: 2025-08-07KEPLER ROBOT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
DE202025102332
Authority / Receiving Office
DE · DE
Patent Type
Utility models
Current Assignee / Owner
Priority Date
2024-04-29
Filing Date
2025-04-29
Publication Date
2025-08-07
Estimated Expiration
2035-04-30

AI Technical Summary

Technical Problem

Existing detection methods for the end portion position of a servomotor in robot joints are inaccurate after more than one revolution, leading to deviations in the detection result and complicating precise control of robot joints.

Method used

A detection device using a pair of gears with different numbers of teeth and magnetic encoders is employed, where the first gear is fixed to the motor rotor and the second gear is engaged with the motor housing, allowing the detection of the first and second angles, and the difference between the teeth counts to determine the end piece position accurately.

Benefits of technology

Enables accurate detection of the servomotor's end portion position, improving the precision of robot joint control by accurately counting full revolutions and enhancing the accuracy of robotic joint operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

A detection device for detecting an end piece position of a servo motor for robot joints, characterized in that the servo motor comprises a motor stator, a motor rotor, an internal support structure and a motor housing, wherein the motor stator is fixedly connected to the internal support structure, wherein the motor housing encloses the internal support structure, wherein the motor rotor is movably connected to the internal support structure, wherein the motor rotor can rotate relative to the motor stator, wherein the detection device comprises a first gear, a second gear, a first magnetic encoder and a second magnetic encoder, wherein the first gear is fixedly connected to an end piece of the motor rotor, wherein the first gear rotates with the motor rotor, wherein the second gear is arranged on the motor housing, wherein the second gear is in engagement with the first gear, wherein the second gear is driven for rotation by the first gear; wherein the first magnetic encoder is arranged on the first gear to detect a first angle of the first gear; wherein the second magnetic encoder is arranged on the second gear to detect a second angle of the second gear; wherein the number of teeth of the first gear is not equal to the number of teeth of the second gear; and wherein the first angle, the second angle and the difference between the number of teeth of the first gear and the number of teeth of the second gear are used to determine the end position of the servo motor.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present utility model relates to the field of detection technology, in particular to a detection device for detecting an end piece position of a servo motor for robot joints and a servo motor. STATE OF THE ART

[0002] With the development of industrial technology, robots are finding widespread use in many areas, such as industrial production, detection, and medical services. Robots used in areas such as industrial production and detection require flexible robot arms to perform complex tasks. Robot joints give the robot arms more degrees of freedom.

[0003] Robot joints are typically controlled by a servo motor. A servo motor is a motor that controls the operation of mechanical elements in a servo system and a device for indirectly changing the speed of an auxiliary motor. To better control the minute movements of the robot joints, it is necessary to accurately detect the servo motor's end-piece position. In the prior art, a hollow magnetic encoder or a hollow inductive encoder is generally attached to the output of a harmonic drive of the servo motor to ensure that the servo motor's end-piece position can be memorized even after a power failure of the motor. With this method, if the servo motor rotates more than one revolution, the entire rotation angle cannot be recorded, resulting in a large deviation in the detection result.

[0004] It is clear that the end piece position of a servo motor cannot yet be accurately detected in the state of the art. DISCLOSURE OF THE UTILITY MODEL

[0005] In order to solve or at least partially solve the above-mentioned technical problems, the present utility model provides a detecting device for detecting an end piece position of a servo motor for robot joints and a servo motor.

[0006] In a first aspect, the present utility model provides a detection device for detecting an end piece position of a servo motor for robot joints, wherein the servo motor comprises a motor stator, a motor rotor, an internal support structure and a motor housing, wherein the motor stator is fixedly connected to the internal support structure, wherein the motor housing encloses the internal support structure, wherein the motor rotor is movably connected to the internal support structure, wherein the motor rotor can rotate relative to the motor stator, wherein the detection device comprises a first gear, a second gear, a first magnetic encoder and a second magnetic encoder, wherein the first gear is fixedly connected to an end piece of the motor rotor, wherein the first gear rotates with the motor rotor, wherein the second gear is arranged on the motor housing, wherein the second gear is in engagement with the first gear, wherein the second gear is driven for rotation by the first gear; wherein the first magnetic encoder is arranged on the first gear to detect a first angle of the first gear; wherein the second magnetic encoder is arranged on the second gear to detect a second angle of the second gear; wherein the number of teeth of the first gear is not equal to the number of teeth of the second gear; and wherein the first angle, the second angle and the difference between the number of teeth of the first gear and the number of teeth of the second gear are used to determine the end position of the servo motor.

[0007] Optionally, it is provided that an end face of the first gear is firmly connected to the end piece of the motor rotor.

[0008] Optionally, it is provided that the first gear comprises a first gear disc and a first gear shaft, wherein the first gear shaft is arranged in the center of the first gear disc, wherein the first gear shaft is fixedly connected to the first gear disc, and wherein the first gear shaft is fixedly connected to the end piece of the motor rotor.

[0009] Optionally, it is provided that the first gear comprises a third gear disc and a third sleeve, wherein the third sleeve is arranged concentrically to the third gear disc, wherein the third sleeve is fixedly connected to the third gear disc, and wherein an inner wall of the third sleeve is fixedly connected to an outer wall of the end piece of the motor rotor.

[0010] Optionally, the first magnetic encoder includes: a first magnetic unit, the first magnetic unit being fixedly connected to the first gear, the first magnetic unit rotating with the rotation of the first gear, the first magnetic unit generating a changing first magnetic field upon rotation; a first sensor used to sense a change in the first magnetic field and to output a changed first electrical signal depending on the change in the first magnetic field; and a first output device used to output the first angle corresponding to a rotation angle of the first gear depending on the first electrical signal.

[0011] Optionally, the first magnetic unit is glued to a front surface of the first gear wheel that is far away from the motor housing, or that the first magnetic unit is embedded in an end face of the first gear wheel which is far away from the motor housing.

[0012] Optionally, it is provided that the second gear comprises a second gear disc and a second gear shaft, wherein the second gear shaft is arranged in the center of the second gear disc, wherein the second gear disc rotates about the second gear shaft, and wherein the second gear shaft is fixedly connected to the motor housing.

[0013] Optionally, the second magnetic encoder includes: a second magnetic unit, the second magnetic unit being fixedly connected to the second gear, the second magnetic unit rotating with the rotation of the second gear, the second magnetic unit generating a changing second magnetic field upon rotation; a second sensor used to sense a change in the second magnetic field and to output a changed second electrical signal depending on the change in the second magnetic field; and a second output device used to output the second angle corresponding to a rotation angle of the second gear depending on the second electrical signal.

[0014] Optionally, the second magnetic unit is glued to a front surface of the second gear wheel that is far away from the motor housing, or that the second magnetic unit is embedded in an end face of the second gear wheel which is far away from the motor housing.

[0015] In a second aspect, a servo motor for robot joints is provided, comprising a motor stator, a motor rotor, an internal support structure, and a motor housing, wherein the motor stator is fixedly connected to the internal support structure, wherein the motor housing encloses the internal support structure, wherein the motor rotor is movably connected to the internal support structure, wherein the motor rotor can rotate relative to the motor stator, the servo motor for robot joints further comprising the detection device described above.

[0016] The present utility model relates to a detection device for detecting an end piece position of a servo motor for robot joints and a servo motor, wherein the servo motor comprises a motor stator, a motor rotor, an internal support structure, and a motor housing, wherein the motor stator is fixedly connected to the internal support structure, wherein the motor housing encloses the internal support structure, wherein the motor rotor is movably connected to the internal support structure, wherein the motor rotor can rotate relative to the motor stator, wherein the detection device comprises a first gear, a second gear, a first magnetic encoder, and a second magnetic encoder, wherein the first gear is fixedly connected to an end piece of the motor rotor, wherein the first gear rotates with the motor rotor; wherein the second gear is arranged on the motor housing, wherein the second gear is in engagement with the first gear,wherein the second gear is driven to rotate by the first gear; wherein the first magnetic encoder is arranged on the first gear to detect a first angle of the first gear; wherein the second magnetic encoder is arranged on the second gear to detect a second angle of the second gear; wherein the number of teeth of the first gear is different from the number of teeth of the second gear; and wherein the first angle, the second angle, and the difference between the number of teeth of the first gear and the number of teeth of the second gear are used to determine the end position of the servo motor. In the present utility model, the first angle of the first gear and the second angle of the second gear are detected, wherein the number of full revolutions of the motor rotor can be determined from the first angle and the second angle as well as the difference between the number of teeth of the first gear and the number of teeth of the second gear.This allows the actual rotation angle of the motor rotor to be acquired. This solves the prior art problem of the servo motor end piece angle not being accurately detected, as accurate counting is not possible after more than one full rotation of the motor rotor. This improves the accuracy of detecting the servo motor end piece angle, enabling more precise control of the robot joints. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings here are incorporated into the specification, form a part of the specification, show the embodiments corresponding to the present utility model, and are used together with the description to explain the principle of the present utility model.

[0018] In order to more clearly explain the embodiments of the present utility model or the technical configurations in the prior art, the drawings required to describe the embodiments or the prior art are briefly presented below. Obviously, those skilled in the art can also obtain further drawings based on these drawings without inventive effort. Fig. 1 shows a schematic sectional view of a servo motor according to an embodiment of the present utility model; and Fig. 2 shows a schematic structural view of a servo motor according to an embodiment of the present utility model.

[0019] List of reference symbols: 1-motor rotor; 2-first gear; 3-first magnetic encoder; 4-second gear; 5-second magnetic encoder; 6-harmonic drive gear. DETAILED EMBODIMENTS

[0020] In order to more clearly clarify the objectives, technical configurations, and advantages of the embodiments of the present utility model, the technical configurations in the embodiments of the present utility model are described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present utility model and do not encompass all embodiments. All other embodiments that can be achieved by a person skilled in the art without inventive effort based on the embodiments in the present utility model fall within the scope of protection of the present utility model.

[0021] With reference to Fig. 1 and Fig. 2, in one embodiment of the present utility model, the servo motor comprises a motor stator, a motor rotor 1, an internal support structure and a motor housing, wherein the motor stator is fixedly connected to the internal support structure, wherein the motor housing encloses the internal support structure, wherein the motor rotor 1 is movably connected to the internal support structure, wherein the motor rotor 1 can rotate relative to the motor stator, wherein the detection device comprises a first gear 2, a second gear 4, a first magnetic encoder 3 and a second magnetic encoder 5, wherein the first gear 2 is fixedly connected to an end piece of the motor rotor 1, wherein the first gear 2 rotates with the motor rotor 1, wherein the second gear 4 is arranged on the motor housing, wherein the second gear 4 is in engagement with the first gear 2, wherein the second gear 4 is driven to rotate by the first gear 2; wherein the first magnetic encoder 3 is arranged on the first gear 2 to detect a first angle of the first gear 2; wherein the second magnetic encoder 5 is arranged on the second gear 4 to detect a second angle of the second gear 4; wherein the number of teeth of the first gear 2 is not equal to the number of teeth of the second gear 4; and wherein the first angle, the second angle and the difference between the number of teeth of the first gear 2 and the number of teeth of the second gear 4 are used to determine the end position of the servo motor.

[0022] In the embodiment of the present utility model, the feature that the motor rotor 1 can rotate relative to the motor stator can be that the motor rotor 1 rotates inside the motor stator, or that the motor stator is inside and the motor rotor 1 rotates outside the motor stator.

[0023] The end position of a servo motor acting as a joint, which is detected in the present utility model, generally refers to the position of the end of the harmonic drive 6. The harmonic drive 6 is connected to the motor rotor 1, and the rotation angle of the motor rotor 1 corresponds to an angle by which the harmonic drive 6 is rotated. Therefore, detecting the end position of the servo motor acting as a joint according to the present utility model actually involves detecting the angle of the motor rotor 1.

[0024] In one embodiment of the present utility model, the motor rotor 1 is connected to a flexible wheel of the harmonic drive gear 6. With each revolution of the motor rotor 1, the flexible wheel of the harmonic drive gear 6 pivots by one tooth. The number of teeth of the harmonic drive gear 6 is related to the reduction ratio of the harmonic drive gear 6. The reduction ratio of the harmonic drive gear 6 was set at the factory and is one of the properties of the harmonic drive gear 6.

[0025] In the prior art, the magnetic encoder can detect an angular difference of the motor rotor 1 relative to a starting position when the motor rotor stops, but when the motor rotor 1 rotates more than one full revolution, accurate counting is not possible, resulting in inaccurate detection results. For example, if the magnetic encoder detects that the motor rotor 1 rotates 90 degrees relative to the starting position when it stops, it cannot confirm whether the motor rotor 1 has rotated 90 degrees or one full revolution plus 90 degrees; that is, it cannot confirm whether it has rotated 90 degrees or 450 degrees. As the complexity of robot joints continues to increase, controlling the action of the robot joints may require the servo motor to rotate more degrees to achieve the target.In the prior art, the angle of the motor rotor 1 is only detected by means of a magnetic encoder, so that it is difficult to achieve high accuracy, which also makes precise control of the robot joints difficult.

[0026] In the exemplary embodiment of the present utility model, the first gear 2 arranged on the motor rotor 1 also rotates one revolution if the motor rotor 1 rotates one revolution; for example, both rotate 360 degrees. However, since the number of teeth of the first gear 2 is different from the number of teeth of the second gear 4, and the first gear 2 and the second gear 4 rotate in meshing fashion, the second gear 4 also rotates, but its rotational degree is different from 360 degrees.

[0027] If the number of teeth of the first gear 2 and the number of teeth of the second gear 4 are known, the angle of rotation of the second gear 4 can be determined. Assuming that the number of teeth of the first gear 2 is A and the number of teeth of the second gear 4 is B, the first gear 2 rotates by M degrees and the second gear 4 rotates by M*A / B degrees.

[0028] Since the number of teeth of the first gear 2 and the number of teeth of the second gear 4 are known, the difference between the rotation angle of the first gear 2 and the rotation angle of the second gear 4 can be determined for each revolution of the motor rotor 1. Therefore, if the rotation angle of the first gear 2 and the rotation angle of the second gear 4 can be detected, that is, if the difference between the rotation angle of the first gear 2 and the rotation angle of the second gear 4 can be determined, it is possible to determine how many full revolutions the motor rotor 1 has completed.

[0029] In one embodiment of the present utility model, the first angle, the second angle and the difference between the number of teeth of the first gear 2 and the number of teeth of the second gear 4 are used to determine the end position of the servo motor.

[0030] In one embodiment of the present utility model, the first gear 2 is arranged at the end piece of the motor rotor 1, and the second gear 4 is arranged on the motor housing. The first gear 2 and the second gear 4 mesh with each other and have different numbers of teeth. The first angle of the first gear 2 and the second angle of the second gear 4 are detected, and the number of complete revolutions of the motor rotor 1 can be determined from the first angle and the second angle, as well as the difference between the number of teeth of the first gear 2 and the number of teeth of the second gear 4, whereby an actual rotation angle of the motor rotor 1 can be acquired.This solves the prior art problem that the angle of the end piece of the servo motor cannot be accurately detected because accurate counting is not possible after more than one full rotation by the motor rotor 1, so that the accuracy of detecting the angle of the end piece of the servo motor can be improved, thereby enabling more precise control of the robot joints.

[0031] In one embodiment of the present utility model, the first angle, the second angle and the difference between the number of teeth of the first gear 2 and the number of teeth of the second gear 4 are used to determine the end position of the servo motor.

[0032] In an embodiment of the present utility model, assuming that the number of teeth of the first gear 2 is A, a first angle at the start time output by the first magnetic encoder 3 at the start time is E1_Zero, and a first angle at the stop time output by the first magnetic encoder 3 at the stop time is E1, the first rotation angle is E1 - E1_Zero.

[0033] Assuming that the difference between the number of teeth of the first gear 2 and the number of teeth of the second gear 4 is X, the number of teeth of the second gear 4 is A+X. Assuming that a second angle output by the second magnetic encoder 5 at the start time is E2_Zero at the start time and a second angle output by the second magnetic encoder 5 at the stop time is E2 at the stop time, the first rotation angle is E2 - E2_Zero.

[0034] Ea stands for parameters of the first magnetic encoder.

[0035] Then the first reference value is: Q1 = ((E1 - E1_Zero) - (E2 - E2_Zero) / (Ea / A / X).

[0036] Q1 is rounded down to Q (i.e., the number of full revolutions).

[0037] The total rotor angle of the motor rotor is E = Q * Ea + E1.

[0038] The reduction ratio of the harmonic drive gear 6 is P. The angle value of the end piece of the harmonic drive gear 6 is then W= E / P.

[0039] Determining the number of complete revolutions of the motor rotor 1 based on the first angle, the second angle, and the difference between the number of teeth of the first gear 2 and the number of teeth of the second gear 4 can be achieved using simple arithmetic operations such as addition, subtraction, multiplication, and division in the above formula. The subsequent four arithmetic operations can be performed by a subsequent arithmetic circuit. This arithmetic circuit can consist of basic circuit elements such as AND gates, NOT gates, amplifiers, counters, triggers, etc. Alternatively, this arithmetic circuit can consist of other devices capable of performing addition, subtraction, multiplication, and division. Alternatively, this arithmetic circuit can be a state-of-the-art integrated circuit chip. Alternatively, this arithmetic circuit can consist of multiple state-of-the-art integrated circuit chips.Alternatively, this computing circuit may be part of a computing module in a main control chip of the robot according to the state of the art. This will not be described repeatedly here.

[0040] In one embodiment of the present utility model, such a subsequent calculation process is not implemented by computer software or a computer program.

[0041] In further embodiments of the present utility model, the subsequent calculation process may be implemented by prior art computer software only to calculate the tail position of the servo motor from the data acquired in embodiments of the present utility model. The present utility model claims the structure and improvement of the hardware part described above, while the subsequent calculation process, which may be implemented by computer software, may be prior art, and the computer software that may be used is not improved by the present utility model.

[0042] In one embodiment of the present utility model, the difference between the number of teeth of the first gear 2 and the number of teeth of the second gear 4 is one.

[0043] The embodiments of the present utility model provide several types of structures of the first gear 2, wherein the end face of the first gear 2 is fixedly connected to the end piece of the motor rotor 1.

[0044] In one embodiment of the present utility model, it is provided that the first gear 2 comprises a first gear disc and a first gear shaft, wherein the first gear shaft is arranged in the center of the first gear disc, wherein the first gear shaft is fixedly connected to the first gear disc, and wherein the first gear shaft is fixedly connected to the end piece of the motor rotor 1.

[0045] In one embodiment of the present utility model, it is provided that the first gear 2 comprises a third gear disc and a third sleeve, wherein the third sleeve is arranged concentrically to the third gear disc, wherein the third sleeve is fixedly connected to the third gear disc, and wherein an inner wall of the third sleeve is fixedly connected to an outer wall of the end piece of the motor rotor 1.

[0046] In the embodiments of the present utility model, the structure of the first gear 2 is implemented in other forms, and the fixed connection between the first gear 2 and the motor rotor 1 is achieved by various ways, which will not be described repeatedly here.

[0047] In one embodiment of the present utility model, the first magnetic encoder 3 comprises: a first magnetic unit, the first magnetic unit being fixedly connected to the first gear 2, the first magnetic unit rotating with the rotation of the first gear 2, the first magnetic unit generating a changing first magnetic field upon rotation; a first sensor used to sense a change in the first magnetic field and to output a changed first electrical signal depending on the change in the first magnetic field; and a first output device used to output the first angle corresponding to a rotation angle of the first gear 2 depending on the first electrical signal.

[0048] The first magnetic encoder 3 may be a prior art magnetic encoder or other forms of devices with the same or similar functions, which will not be described repeatedly here.

[0049] In one embodiment of the present utility model it is provided that, as in Fig. 2, the first magnetic unit is glued to an end face of the first gear 2 far from the motor housing, or that the first magnetic unit is embedded in an end face of the first gear 2 which is far away from the motor housing.

[0050] In one embodiment of the present utility model, it is provided that the second gear 4 comprises a second gear disc and a second gear shaft, wherein the second gear shaft is arranged in the center of the second gear disc, wherein the second gear disc rotates about the second gear shaft, and wherein the second gear shaft is fixedly connected to the motor housing.

[0051] In the embodiments of the present utility model, the structure of the second gear 4 is implemented in other forms, and the connection between the second gear 4 and the motor housing is achieved by various ways, which will not be described repeatedly here.

[0052] In one embodiment of the present utility model, the second magnetic encoder 5 comprises: a second magnetic unit, the second magnetic unit being fixedly connected to the second gear 4, the second magnetic unit rotating with the rotation of the second gear 4, the second magnetic unit generating a changing second magnetic field upon rotation; a second sensor used to sense a change in the second magnetic field and to output a changed second electrical signal depending on the change in the second magnetic field; and a second output device used to output the second angle corresponding to a rotation angle of the second gear 4 depending on the second electrical signal.

[0053] The second magnetic encoder 5 may be a prior art magnetic encoder or other forms of devices with the same or similar functions, which will not be described repeatedly here.

[0054] In one embodiment of the present utility model it is provided that, as in Fig. 2, the second magnetic unit is glued to an end face of the second gear 4 far from the motor housing, or that the second magnetic unit is embedded in an end face of the second gear 4 which is far away from the motor housing.

[0055] In the embodiments of the present utility model, by using a pair of gears having different numbers of teeth and meshing, the number of complete revolutions of the motor rotor 1 can be accurately detected, thereby accurately detecting the end position of the servo motor acting as a joint, thus achieving high accuracy, simple structure, and low cost. Furthermore, in the embodiments of the present utility model, a pair of gears having different numbers of teeth and meshing and the magnetic encoders are used for detection without additionally providing other sensors, thereby reducing system noise.

[0056] The present utility model further provides a servo motor for robot joints, comprising a motor stator, a motor rotor 1, an internal support structure and a motor housing, wherein the motor stator is fixedly connected to the internal support structure, wherein the motor housing encloses the internal support structure, wherein the motor rotor is movably connected to the internal support structure, wherein the motor rotor 1 can rotate relative to the motor stator, wherein the servo motor for robot joints further comprises the detection device described above.

[0057] It should be noted that relational terms such as "first" and "second" are used herein merely to distinguish one entity or operation from another and do not necessarily require or imply that such an actual relationship or sequence exists between those entities or operations. Furthermore, the terms "comprising," "containing," or any other variation thereof, are intended to be non-exclusive, such that a process, method, article, or apparatus comprising a series of elements includes not only the expressly listed elements but also other elements not expressly listed, or includes elements inherent in the process, method, article, or apparatus. Without further limitation, an element identified by the term "comprising" includes...’ does not preclude the presence of additional identical elements in a process, method, article or device with that element.

[0058] The foregoing describes only specific embodiments of the present invention that enable those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art. The general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein, but should be accorded the broadest scope consistent with the principles and novel features claimed herein.

Claims

[1] Detection device for detecting an end piece position of a servo motor for robot joints, characterized by that the servo motor comprises a motor stator, a motor rotor, an internal support structure and a motor housing, wherein the motor stator is fixedly connected to the internal support structure, wherein the motor housing encloses the internal support structure, wherein the motor rotor is movably connected to the internal support structure, wherein the motor rotor can rotate relative to the motor stator, wherein the detection device comprises a first gear, a second gear, a first magnetic encoder and a second magnetic encoder, wherein the first gear is fixedly connected to an end piece of the motor rotor, wherein the first gear rotates with the motor rotor, wherein the second gear is arranged on the motor housing, wherein the second gear is in engagement with the first gear, wherein the second gear is driven for rotation by the first gear; wherein the first magnetic encoder is arranged on the first gear to detect a first angle of the first gear; wherein the second magnetic encoder is arranged on the second gear to detect a second angle of the second gear; wherein the number of teeth of the first gear is not equal to the number of teeth of the second gear; and wherein the first angle, the second angle and the difference between the number of teeth of the first gear and the number of teeth of the second gear are used to determine the end position of the servo motor. [2] Detection device according to claim 1, characterized by that an end face of the first gear is firmly connected to the end piece of the motor rotor. [3] Detection device according to claim 1, characterized by in that the first gear comprises a first gear disc and a first gear shaft, wherein the first gear shaft is arranged in the center of the first gear disc, wherein the first gear shaft is fixedly connected to the first gear disc, and wherein the first gear shaft is fixedly connected to the end piece of the motor rotor. [4] Detection device according to claim 1, characterized by in that the first gear comprises a third gear disc and a third sleeve, wherein the third sleeve is arranged concentrically to the third gear disc, wherein the third sleeve is fixedly connected to the third gear disc, and wherein an inner wall of the third sleeve is fixedly connected to an outer wall of the end piece of the motor rotor. [5] Detection device according to claim 1, characterized by that the first magnetic encoder includes: a first magnetic unit, the first magnetic unit being fixedly connected to the first gear, the first magnetic unit rotating with the rotation of the first gear, the first magnetic unit generating a changing first magnetic field upon rotation; a first sensor used to sense a change in the first magnetic field and to output a changed first electrical signal depending on the change in the first magnetic field; and a first output device used to output the first angle corresponding to a rotation angle of the first gear depending on the first electrical signal. [6] Detection device according to claim 5, characterized bythat the first magnetic unit is glued to an end face of the first gear that is far away from the motor housing, or that the first magnetic unit is embedded in an end face of the first gear that is far away from the motor housing. [7] Detection device according to claim 1, characterized by in that the second gear comprises a second gear disc and a second gear shaft, wherein the second gear shaft is arranged in the center of the second gear disc, wherein the second gear disc rotates about the second gear shaft, and wherein the second gear shaft is fixedly connected to the motor housing. [8] Detection device according to claim 1, characterized by that the second magnetic encoder comprises: a second magnetic unit, the second magnetic unit being fixedly connected to the second gear, the second magnetic unit rotating with the rotation of the second gear, the second magnetic unit generating a changing second magnetic field upon rotation; a second sensor used to sense a change in the second magnetic field and to output a changed second electrical signal depending on the change in the second magnetic field; and a second output device used to output the second angle corresponding to a rotation angle of the second gear depending on the second electrical signal. [9] Detection device according to claim 8, characterized bythat the second magnetic unit is glued to an end face of the second gear that is far away from the motor housing, or that the second magnetic unit is embedded in an end face of the second gear that is far away from the motor housing. [10] Servo motor for robot joints, characterized by in that it comprises a motor stator, a motor rotor, an internal support structure and a motor housing, wherein the motor stator is fixedly connected to the internal support structure, wherein the motor housing encloses the internal support structure, wherein the motor rotor is movably connected to the internal support structure, wherein the motor rotor can rotate relative to the motor stator, wherein the servo motor for robot joints further comprises a detection device according to any one of claims 1 to 9.