SYSTEM AND COMPUTER-IMPLEMENTED METHOD FOR DETERMINING AN OFFSET FOR A MILKING TOOL IN AN AUTOMATIC MILKING MACHINE, COMPUTER PROGRAM AND NON-VOLATILE DATA CARRIER
20230210081 · 2023-07-06
Inventors
Cpc classification
International classification
Abstract
An offset for a first milking tool in a tool carrier of an automatic milking machine is determined as a spatial vector between a tool reference position (TRP) and an estimated actual position (TAP) of the milking tool. A three-dimensional image data is registered that represents a teat (T) during attachment to and/or detachment from the milking tool. The image data is processed by searching, within a search zone, for a predefined part (MP) of the teat (T) while the teat (T) is attached to the milking tool. Provided that the predefined part (MP) fulfills a measurement criterion, a distance (d.sub.off) is calculated between a specific point of the predefined part (MP) and the tool reference position (TRP). The offset is then determined based on the calculated distance (d.sub.off).
Claims
1. A system for determining an offset for a first milking tool (100, 100.sub.1), which offset designates a spatial vector between a tool reference position (TRP, TRP.sub.1) and an estimated actual position (TAP) of the first milking tool (100, 100.sub.1) in a tool carrier (101) of an automatic milking machine, the system comprising: a camera (110) configured to register three-dimensional image data (D.sub.img3D) representing a teat (T) during attachment to and/or detachment from the first milking tool (100, 100.sub.1); and a control unit (120) configured to receive the image data (D.sub.img3D) from the camera (110), and process the image data (D.sub.img3D) by: searching, within a search zone (SZ), for a predefined part (MP) of the teat (T) while the teat (T) is attached to the first milking tool (100, 100.sub.1), which predefined part (MP) fulfills a measurement criterion, calculating, in response to the predefined part (MP) being found, a distance (d.sub.off) between a specific point of the predefined part (MP) and the tool reference position (TRP, TRP.sub.1), and determining said offset based on said calculated distance (d.sub.off).
2. The system according to claim 1, wherein the predefined part comprises a surface area (MP) of the teat (T), and the measurement criterion is that said surface area (MP) is located closer to the camera (110) than any other surface area of the teat (T) within the search zone (SZ).
3. The system according to claim 2, wherein the surface area (MP) comprises image data from a number of pixels representing elements of the teat (T), each of said pixels being associated with a value designating a respective distance to the camera (110), and the control unit (120) is configured to determine that the surface area (MP) is located closer to the camera (120) than any other surface element of said teat (T) based on an average of said values designating the respective distances to the camera (110).
4. The system according to claim 1, wherein the search zone (SZ) is a volume in space, the three-dimensional image data (D.sub.img3D) comprises voxels, and the measurement criterion designates a volume element in the form of a predefined part (MP) positioned in a geometric center of a particular level of the cross-section segment of the teat (T) within the search zone (SZ).
5. The system according to claim 1, wherein the control unit (120) is configured to determine said offset as a set of differential coordinates expressing the spatial vector with a starting point at the tool reference position (TRP, TRP.sub.1) and an end point at the estimated actual position (TAP).
6. The system according to claim 1, wherein the search zone (SZ) comprises a part of the registered three-dimensional image data (D.sub.img3D) that is estimated to represent a portion of said teat (T) being located above a mouthpiece (210) of the first milking tool (100, 100.sub.1), which mouthpiece (210) is configured to receive the teat (T).
7. The system according to claim 1, wherein the search zone (SZ) is defined based on the tool reference position (TRP, TRP.sub.1).
8. The system according to claim 1, wherein the first milking tool (100, 100.sub.1) is a teat cup and the control unit (120) is configured to initiate the searching for said predefined part (MP) after that a pressure condition has been fulfilled in a vacuum chamber (435) of the teat cup.
9. The system according to claim 1, wherein the first milking tool (100, 100.sub.1) is a teat cleaning cup and the control unit (120) is configured to initiate the searching for said predefined part (MP) during withdrawal of the teat cleaning cup from the teat (T).
10. The system according to claim 1, wherein the camera (110) is comprised in the group of: a time-of-flight camera, a stereo camera, a laser-assisted two-dimensional camera, and an ultrasonic imaging device.
11. The system according to claim 1, wherein, the registered three-dimensional image data (D.sub.img3D) represent at least one additional teat (T) during attachment of the at least one additional teat (T) to a respective at least one milking tool (100, 100.sub.2) in addition to the first milking tool (100, 100.sub.1) and/or detachment of the at least one additional teat (T) from the respective at least one milking tool (100, 100.sub.2) in addition to the first milking tool (100, 100.sub.1), and the control unit (120) is further configured to process the image data (D.sub.img3D) by: searching, within at least one predefined additional search zone (SZ), for a predefined part (MP) at the least one additional teat (T) while the at least one additional teat (T) is attached to the at least one additional milking tool (100, 100.sub.1), which predefined part (MP) fulfills the measurement criterion, calculating, in response to the predefined part (MP) being found, a distance (d.sub.off) between a specific point of the predefined part (MP) and tool reference position (TRP, TRP.sub.2) for the at least one additional milking tool (100, 100.sub.2), and determining an offset for the at least one additional milking tool (100, 100.sub.2) based on said calculated distance (d.sub.off).
12. A computer-implemented method of determining an offset for a first milking tool (100, 100.sub.1), which offset designates a spatial vector between a tool reference position (TRP, TRP.sub.1) and an estimated actual position (TAP) of the first milking tool (100, 100.sub.1) in a tool carrier (101) of an automatic milking machine, the method comprising a computer processing three-dimensional image data (D.sub.img3D) that represent a teat (T) during attachment to and/or detachment from the first milking tool (100, 100.sub.1) by: searching, within a search zone (SZ), for a predefined part (MP) of the teat (T) while the teat (T) is attached to the first milking tool (100, 100.sub.1), which predefined part (MP) fulfills a measurement criterion, calculating, in response to the predefined part (MP) being found, a distance (d.sub.off) between a specific point of the predefined part (MP) and the tool reference position (TRP, TRP.sub.1) and determining said offset based on said calculated distance (d.sub.off).
13. The method according to claim 12, wherein the predefined part comprises a surface area (MP) of the teat (T), and the measurement criterion means that said surface area (MP) is located closer to the camera (110) than any other surface area of the teat (T) within the search zone (SZ).
14. The method according to claim 13, wherein the surface area (MP) comprises image data from a number of pixels representing elements of the teat (T), each of said pixels being associated with a value designating a respective distance to the camera (110), and the control unit (120) is configured to determine that the surface area (MP) is located closer to the camera (110) than any other surface element of said teat (T) based on an average of said values designating the respective distances to the camera (110).
15. The method according to claim 12, wherein the search zone (SZ) is a volume in space, the three-dimensional image data (D.sub.img3D) comprises voxels, and the measurement criterion designates a volume element in the form of a predefined part (MP) positioned in a geometric center of a particular level of the cross-section segment of the teat (T) within the search zone (SZ).
16. The method according to claim 12, further comprising: determining said offset as a set of differential coordinates expressing the spatial vector with a starting point at the tool reference position (TRP, TRP.sub.1) and an end point at the estimated actual position (TAP).
17. The method according to claim 12, wherein the search zone (SZ) comprises a part of the registered three-dimensional image data (D.sub.img3D) that is estimated to represent a portion of said teat (T) being located above a mouthpiece (210) of the first milking tool (100, 100.sub.1), which mouthpiece (210) is configured to receive the teat (T).
18. The method according to claim 12, wherein the search zone (SZ) is defined based on the tool reference position (TRP, TRP.sub.1).
19. The method according to claim 12, wherein the first milking tool (100, 100.sub.1) is a teat cup and the method comprises: initiating the searching for the predefined part (MP) after that a pressure condition has been fulfilled in a vacuum chamber (435) of the teat cup.
20. The method according to claim 12, wherein the first milking tool (100, 100.sub.1) is a teat cleaning cup and the control unit (120) is configured to initiate the searching for the predefined part (MP) during withdrawal of the teat cleaning cup from the teat (T).
21. The method according to claim 12, wherein the registered three-dimensional image data (D.sub.img3D) represent at least one additional teat (T) during attachment of the at least one additional teat (T) to a respective at least one milking tool (100, 100.sub.2) in addition to the first milking tool (100, 100.sub.1) and/or detachment of the at least one additional teat (T) from the respective at least one milking tool (100, 100.sub.2) in addition to the first milking tool (100, 100.sub.1), and the processing of the image data (D.sub.img3D) further comprises: searching, within at least one predefined additional search zone (SZ), for a predefined part (MP) at the least one additional teat (T) while the at least one additional teat (T) is attached to the at least one additional milking tool (100, 100.sub.1), which predefined part (MP) fulfills the measurement criterion, calculating, in response to the predefined part (MP) being found, a distance (d.sub.off) between a specific point of the predefined part (MP) and tool reference position (TRP, TRP.sub.2) for the at least one additional milking tool (100, 100.sub.2), and determining an offset for the at least one additional milking tool (100, 100.sub.2) based on said calculated distance (d.sub.off).
22. A non-transitory data carrier (126) containing a computer program (127) communicatively connectable to a processing unit (125), the computer program (127) comprising software for executing the method according claim 12 when the computer program is run on the processing unit (125).
23. (canceled)
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The invention is now to be explained more closely by means of preferred embodiments, which are disclosed as examples, and with reference to the attached drawings.
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
DETAILED DESCRIPTION
[0032] In
[0033]
[0034] The system includes a camera 110 and a control unit 120. The camera 110 is configured to register 3D image data D.sub.img3D representing at least one teat T during attachment of the at least one teat T to a milking tool, e.g. 100.sub.1, and and/or detachment of the at least one teat T from the milking tool, e.g. 100.sub.1. The control unit 120 is configured to receive the 3D image data D.sub.img3D from the camera 110, and process the 3D image data D.sub.img3D. Specifically, the image processing involves searching, within a search zone SZ, for a predefined part MP of the teat T while the teat T is attached to the milking tool 100.sub.1, which predefined part MP fulfills a measurement criterion. In response to finding the predefined part MP, the image processing further involves calculating a distance d.sub.off between a specific point of the predefined part MP, preferably its center, and the tool reference position TRP.sub.1. According to the invention, however, any other well-defined point of the predefined part MP may constitute the specific point, for example a particular point on a border of the predefined part MP. In any case, the image processing also involves determining the offset based on said calculated distance d.sub.off.
[0035] Further details of the proposed procedure and the image processing will be described below referring to
[0036]
[0037] More precisely, in practice, the non-offset situation shown in
[0038]
[0039]
[0040]
[0041]
[0042] In this example, a magnitude of the offset between the tool reference position TRP and the actual tool position TAP is small enough to allow the outermost tip of the teat T to be introduced in the mouthpiece 210 of the milking tool 100 when the robotic arm 105 elevates the milking tool 100 in the z direction as shown in
[0043] This effect is apparent also in
[0044] Referring now to
[0045] As mentioned above, the processing of the 3D image data D.sub.img3D involves searching, within a search zone SZ, for a predefined part MP of the teat T while the teat T is attached to the milking tool 100, which predefined part MP fulfills a measurement criterion. In
[0046] The search zone SZ contains a part of the registered 3D image data D.sub.img3D that is estimated to represent a portion of said teat T being located above a mouthpiece 210 of the milking tool 100, which mouthpiece 210 is configured to receive the teat T. The search zone SZ is thus preferably defined based on the tool reference position TRP.
[0047] In response to finding the predefined part MP, a distance is calculated between a specific point of the predefined part MP and the tool reference position TRP. The offset is then determined based on the calculated distance.
[0048] In
[0049] According to one embodiment of the invention, the predefined part contains a surface area MP of the teat T, and the measurement criterion means that the surface area MP is located closer to the camera 110 than any other surface area of the teat T within the search zone SZ.
[0050] The surface area MP, in turn, preferably includes image data from a number of pixels representing elements of the teat T. Each of said pixels is associated with a value designating a respective distance to the camera 110. In a TOF camera, this data is readily available, whereas in other kinds of 3D cameras such a distance value may need to be calculated in the control unit 120. In any case, in this embodiment of the invention, the control unit 120 is configured to determine that the surface area MP is located closer to the camera 110 than any other surface element of the teat T based on an average of said values designating the respective distances to the camera 110. The measurement is thereby made relatively robust, since measurement errors resulting from single faults in the pixel distance values is avoided.
[0051] According to one embodiment of the invention, the first milking tool 100 is a teat cup. Here, to ensure that the teat T is located in the teat cup, the control unit 120 is configured to initiate the searching for the predefined part MP after that a pressure condition has been fulfilled in the vacuum chamber 435 of the teat cup 110. Namely, a distinct pressure change occurs in the vacuum chamber 435 when the teat T fills the full diameter of the mouthpiece 210, and thus seals the spacing between the liner 430 and the teat T.
[0052] According to another embodiment of the invention, the milking tool 100 is a teat cleaning cup. Here, the control unit 120 is configured to initiate the searching for the predefined part MP during withdrawal of the teat cleaning cup from the teat T, i.e. an action opposite the above-described attachment. In contrast to milk extraction, cleaning is typically not performed in response to a signal from a pressure sensor. Therefore, the abovementioned pressure variations cannot be used to trigger the measurement. Instead, a withdrawal signal to the robotic arm 105 is preferably used as a measurement trigger.
[0053]
[0054] The search zone SZ is here a volume in space, and the 3D image data D.sub.img3D contains voxels. Thus, the measurement criterion designates a volume element in the form of a predefined part MP positioned in a geometric center of a particular level of the cross-section segment of the teat T within the search zone SZ. Said volume element, in turn, may be represented by one or more voxels in the 3D image data D.sub.img3D.
[0055] In
[0056]
[0057] Here, the predefined part MP is defined as the surface area MP that is located closer to the camera 110 than any other surface element of the teat T within the search zone SZ. Further, a point on the mouthpiece 210 has been selected as the tool reference position TRP.
[0058] In
[0059] Referring now once more to
[0063] Thereby, the individual offsets for two or more milking tools can be determined in parallel. Of course, this renders the overall calibration process more efficient.
[0064] It is generally advantageous if the control unit 120 is configured to effect the above-described procedure in an automatic manner by executing a computer program 127. Therefore, the control unit 120 may include a memory unit 125, i.e. non-volatile data carrier, storing the computer program 127, which, in turn, contains software for making processing circuitry in the form of at least one processor 125 in the central control unit 120 execute the above-described actions when the computer program 127 is run on the at least one processor 125.
[0065] In order to sum up, and with reference to the flow diagram in
[0066] In a first step 810, 3D image data are obtained from a camera, for instance a TOF camera, a stereo camera, a laser-assisted two-dimensional camera or an ultrasonic imaging device.
[0067] Then, in a step 820, the 3D image data is processed by searching, within a search zone, for a predefined part of the teat while the teat is attached to a milking tool.
[0068] A subsequent step 830 checks if a predefined part has been found, which fulfills a measurement criterion. The measurement criterion may mean that the surface area is located closer to the camera than any other surface area of the teat within the search zone. Alternatively, if the camera is an ultrasonic imaging device, the search zone may be a volume in space. In such a case, the 3D image data contains voxels; and here the measurement criterion designates a volume element in the form of a predefined part positioned in a geometric center of a particular level of the cross-section segment of the teat within the search zone. In response to the selection criterion being fulfilled, the procedure continues to a step 840. Otherwise, the procedure loops back to step 820.
[0069] In step 840, a distance is calculated between a specific point of the predefined part and the tool reference position. In a step 850 thereafter, the offset is determined based on the distance calculated in step 840. For example, the offset may be determined as a set of differential coordinates expressing a spatial vector with a starting point at the tool reference position and an end point at the estimated actual position. After step 850 the procedure ends.
[0070] All of the process steps, as well as any sub-sequence of steps, described with reference to
[0071] The term “comprises/comprising” when used in this specification is taken to specify the presence of stated features, integers, steps or components. However, the term does not preclude the presence or addition of one or more additional features, integers, steps or components or groups thereof.
[0072] The invention is not restricted to the described embodiments in the figures, but may be varied freely within the scope of the claims.