Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
CONTROL UNIT, METHOD AND COMPUTER PROGRAM FOR A MILKING SYSTEM
Document Type and Number:
WIPO Patent Application WO/2019/156619
Kind Code:
A1
Abstract:
An automatic milking system is controlled by receiving a para- meter representing a measured flow (f(t)) of milk being extracted from at least one teat of an udder of an animal being milked via at least one teatcup. A take-off time (tTO) is determined when the milking shall be stopped based on : a first criterion indicating that the flow (f(t)) has reached a decline phase ( Phdecl), and a second criterion indicating that the flow (f(t)) decreases faster than a threshold slope (scrit1). The take-off time (t TO) is determined in response to fulfillment of the second criterion on or after a point in time (t1) when the first criterion has been fulfilled. As a result, a particular amount of milk ( Mres) is estimated to be left in the udder irrespective of an overall milking time (tM) for the animal in question.

Inventors:
PAULRUD CARL OSKAR (SE)
Application Number:
PCT/SE2019/050101
Publication Date:
August 15, 2019
Filing Date:
February 07, 2019
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
DELAVAL HOLDING AB (SE)
International Classes:
A01J5/007
Domestic Patent References:
WO2003000042A12003-01-03
WO2008051137A12008-05-02
Foreign References:
US20110303155A12011-12-15
DE3609275A11987-09-24
Other References:
V. TANCIN ET AL.: "Journal of Dairy Science", 2006, AMERICAN DIARY SCIENCE ASSOCIATION, article "Sources of Variation in Milk Flow Characteristics at Udder and Quarter Levels", pages: 978 - 988
Attorney, Agent or Firm:
LILLIEHORN, Tobias (SE)
Download PDF:
Claims:
Claims

1 . A control unit (150) for a milking system, the control unit (150) comprising processing circuitry and interfaces configured to:

receive at least one parameter representing at least one measured flow (f(t); (fi(t), f2(t), f3(t), f4(t)) of milk being extracted from at least one teat of an udder (105) of an animal that is mil ked via at least one teatcup (1 1 1 , 1 12, 1 13, 1 14), and based on said at least one parameter

control (Ctrl) the extraction of milk to be stopped,

characterized in that the processing circuitry is configured to determine a take-off time (t-ro) when the milking shall be stopped based on:

a first criterion indicating that the at least one flow (f(t); (fi(t), f 2 ( t ) , f 3 (t) , f4(t)) has reached a decline phase

( P h d eci) , and

a second criterion indicating that the at least one flow (f(t); (fi(t), f 2 ( t ) , f 3 (t) , f4(t)) decreases faster than a thres hold Slope (Scrit l , SCrit2 ) ,

the take-off time (t-ro) being determined in response to fulfillment of the second criterion on or after a point in time (ti) when the first criterion has been fulfilled, and

the processing circuitry is configured to determine that the at least one flow (f(t); (fi(t), f2(t), f3(t), f4(t)) has reached the decline phase ( P h d eci) based on at least one of:

a series of flow values registered during a current milking, and

historic milk-flow-profile data (DmfP) for the animal being milked. 2. The control unit (150) according to claim 1 , wherein the at least one parameter represents a common flow of milk (f(t)) from all the teats of the udder (105) of the animal.

3. The control unit (150) according to any one of claims 1 or

2, wherein the stopping of the extraction of milk involves at least one of:

detaching at least one of the at least one teatcup (1 1 1 , 1 12, 1 13, 1 14) from a respective teat of the udder (105),

shutting off a pulsator vacuum (PV) to at least one of the at least one teatcup (1 1 1 , 1 12, 1 13, 1 14), and

shutting off a milking vacuum (MV) to at least one of the at least one teatcup (1 1 1 , 1 12, 1 13, 1 14).

4. The control unit (150) according to any one of the prece ding claims, wherein the processing circuitry is configured to set the second criterion dynamically based on an average level (Fpit) of the flow (f(t)) during a plateau phase (Phpit) preceding the de cline phase (Phdeci) , such that:

if the average level (Fpn1 ) of the flow (f(t)) during the pla teau phase (Phpn) is comparatively high, the second criterion specifies a relatively steep threshold slope (sCnt1 ), and

if the average level (Fpu2) of the flow (f(t)) during the pla teau phase (Phpit) is comparatively low, the second criterion spe cifies a relatively gentle threshold slope (sCnt2).

5. The control unit (150) according to any one of the prece- ding claims, wherein the processing circuitry is configured to determine that the second criterion is fulfilled exclusively based on that the at least one flow (f(t); (fi(t), f2(t), f3(t), f4(t)) decreases faster than the threshold slope (scrit1 , sCnt2).

6. The control unit (150) according to any one of claims 1 -4, wherein the processing circuitry is configured to determine the take-off time (t-ro) in further response to a third criterion, which is fulfilled if:

after that the first criterion has indicated that the flow (f(t)) has reached the decline phase (Phdeci) , the flow (f(t)) decreases below a threshold level (Ftn1 , Fth2).

7. The control unit (150) according to claim 6, wherein the processing circuitry is configured to set the third criterion dyna mically based on an average level (Fpit) of the flow (f(t)) during a plateau phase (Phpit) preceding the decline phase (Phdeci), such that:

if the average level (Fpn1 ) of the flow (f(t)) during the pla teau phase (Phpu) is comparatively high, the third criterion spe- cifies a relatively high threshold level (Fth 1 ) , and

if the average level (Fpu2) of the flow (f(t)) during the pla teau phase (Phpn) is comparatively low, the third criterion spe cifies a relatively low threshold level (Fth2).

8. The control unit (150) according to any one of the prece- ding claims, wherein the processing circuitry is configured to set the first and second criteria based on an algorithm adapted to leave a particular estimated amount of milk (Mres) in the udder (105) after that the extraction of milk has stopped.

9. The control unit (150) according to any one of the prece- ding claims, wherein the processing circuitry is configured to de termine the take-off time (t-ro) on the further basis of at least one of:

historic milk-yield data for the animal,

historic milk-flow-profile data for the animal,

a current lactation phase of the animal,

an age of the animal, and

a health status of the animal.

10. An automatic milking method comprising:

receiving at least one parameter representing at least one measured flow (f(t); (fi(t), f2(t), f3(t), f4(t)) of milk being extracted from at least one teat of an udder (105) of an animal that is mil ked via at least one teatcup (1 1 1 , 1 12, 1 13, 1 14), and based on said at least one parameter

controlling (Ctrl) the extraction of milk to be stopped, characterized by determining a take-off time (t-ro) when the mil king shall be stopped based on:

a first criterion indicating that the at least one flow (f(t); (fi(t), f 2 ( t ) , f 3 (t) , f4(t)) has reached a decline phase (Phdeci), and

a second criterion indicating that the at least one flow (f(t); (fi(t), f 2 ( t ) , f 3 (t) , f4(t)) decreases faster than a thres hold Slope (Scritl , SCrit2),

the take-off time (t-ro) being determined in response to fulfillment of the second criterion on or after a point in time (ti) when the first criterion has been fulfilled, and

the determining that the at least one flow (f(t); (fi(t), f2(t), f3(t), f4(t)) has reached the decline phase (Phdeci) is based on at least one of:

a series of flow values registered during a current milking, and

historic milk-flow-profile data (DmfP) for the animal being milked. 11. The method according to claim 10, wherein the at least one parameter represents a common flow of milk (f(t)) from all the teats of the udder (105) of the animal.

12. The method according to any one of claims 10 or 11, whe rein the stopping of the extraction of milk involves at least one of:

detaching at least one of the at least one teatcup (111, 112, 113, 114) from a respective teat of the udder (105),

shutting off a pulsator vacuum (PV) to at least one of the at least one teatcup (111, 112, 113, 114), and

shutting off a milking vacuum (MV) to at least one of the at least one teatcup (111, 112, 113, 114).

13. The method according to any one of claims 10 to 12, com prising setting the second criterion dynamically based on an average level (Fpn) of the flow (f(t)) during a plateau phase (Phpit) preceding the decline phase (Phdeci), such that:

if the average level (Fpn1) of the flow (f(t)) during the pla teau phase (Phpn) is comparatively high, the second criterion specifies a relatively steep threshold slope (scrit1), and if the average level (Fpu2) of the flow (f(t)) during the pla teau phase (Phpit) is comparatively low, the second criterion spe cifies a relatively gentle threshold slope (scrit2).

14. The method according to any one of claims 10 to 12, com- prising determining that the second criterion is fulfilled exclusi vely based on that the at least one flow (f(t); (fi(t), f2(t), f3(t), f4(t)) decreases faster than the threshold slope (scrit1 , scrit2).

15. The method according to any one of claims 10 to 13, com prising determining the take-off time (t-ro) in further response to a third criterion, which is fulfilled if:

after that the first criterion has indicated that the flow (f(t)) has reached the decline phase ( P h d eci) , the flow (f(t)) decreases below a threshold level (Ftn1 , Ftn2).

16. The method according to claim 15, comprising setting the third criterion dynamically based on an average level (Fpit) of the flow (f(t)) during a plateau phase ( P h pit) preceding the decline phase ( P h d eci) , such that:

if the average level (Fpn1 ) of the flow (f(t)) during the pla teau phase ( P h pit) is comparatively high, the third criterion spe- cifies a relatively high threshold level (Ftn1 ), and

if the average level (Fpit2) of the flow (f(t)) during the pla teau phase (Phpit) is comparatively low, the third criterion spe cifies a relatively low threshold level (Ftn2).

17. The method according to any one of claims 10 to 16, com- prising:

setting the first and second criteria based on an algorithm adapted to leave a particular estimated amount of milk ( M res) in the udder (105) after that the extraction of milk has stopped.

18. The method according to any one of claims 10 to 17, com- prising determining the take-off time (t-ro) on the further basis of at least one of:

historic milk-yield data for the animal, historic milk-flow-profile data for the animal, a current lactation phase of the animal,

an age of the animal, and

a health status of the animal. 19. A computer program (157) loadable into a non-volatile data carrier (153) communicatively connected to a processing unit (150), the computer program (157) comprising software for exe cuting the method according any of the claims 10 to 18 when the computer program (157) is run on the processing unit (150). 20. A non-volatile data carrier (153) containing the computer program (157) of the claim 19.

Description:
Control Unit, Method and Computer Program for a Milking

System

TECHNICAL FI ELD

The present invention relates generally to machine milking of dairy animals. More particularly the invention relates to a control unit for a milking system and method of controlling a milking system. The invention also relates to a computer program and a non-volatile data carrier.

BACKGROUND

As new and more advanced milking equipments are developed , the milking process has become completely automated, or at least almost. In such automatic milking systems, the low involve ment of human operators requires that the milking system is capable of taking adequate decisions as when to stop extracting milk from each animal. Due to the wide variety in milk flow cha racteristics between different animals as well as for a particular animal between different milking occasions, it is a far from trivial task to determine the optimal milking time.

DE 36 09 275 A1 describes a milk removal method, wherein the flow of milk is detected in at least one teat, and based thereon; a milk-flow profile is derived. The milk-flow profile indicates a temporal dependence of the quantity of milk obtained within indi vidual pulsation cycles. This, in turn, serves as a basis for a va cuum application parameter for a following milking operation . V. Tancin et al. ,“Sources of Variation in Milk Flow Characteris tics at Udder and Quarter Levels”, Journal of Dairy Science, No. 89, American Diary Science Association, 2006, pp 978-988 dis cusses milk flow patterns and variations in milk flow characteris tics throughout the lactation cycle. Inter alia, the longest dura tion of decline phase was found at the beginning and end of lac- tation in quarters with high peak flow rate and in rear quarters. It is also speculated if cow preparation for milking and vacuum modification plays a role in the duration of decline phase at quarter level. However, there is yet no example of a fully automatic procedure for determining an individually adapted milking time that is opti mal for each animal.

SUMMARY

The object of the present invention is therefore to offer a solu- tion for controlling a milking machine to stop the milk extraction at a point in time that is ideal with respect to both long-term milk yield and animal health.

According to one aspect of the invention, the object is achieved by a control unit for a milking system, where the control unit in- eludes processing circuitry and interfaces configured to receive at least one parameter representing at least one measured flow of milk being extracted from at least one teat of an udder of an animal that is milked via at least one teatcup. The at least one parameter may thus either represent a common flow of milk from all the teats of the udder, or a specific flow of milk from an in dividual teat. Based on the at least one parameter, the proces sing circuitry is configured to control the extraction of milk to be stopped. More precisely, the processing circuitry is configured to determine a take-off time when the milking shall be stopped ba- sed on first and second criteria. The first criterion indicates that the at least one flow has reached a decline phase. The second criterion indicates that the at least one flow decreases faster than a threshold slope, and the take-off time is determined in response to the second criterion being fulfilled on or after a point in time when the first criterion has been fulfilled.

The processing circuitry is configured to determine that the at least one flow has reached the decline phase based on a series of flow values registered during a current milking, and/or historic milk-flow-profile data for the animal being milked.

This control unit is advantageous because it provides a milking time being just right for animals that have widely different milk- flow profiles, for example in terms of rise time, plateau-phase flow level and the extension of the decline phase.

It is advantageous to determine that the decline phase has been reached based on a series of flow values registered during a cur rent milking or a historic milk-flow-profile data for the animal be- ing milked. Namely, in the former case, the decision-making can be made independent from animal identity, and in the latter case the basis for the decision can be gradually enhanced over time.

It is further advantageous to register a series of flow values be cause such data may serve as a basis for determining a transi- tion point between the plateau phase and the the decline phase in the milk-flow profile. If, for example, an average time deriva tive of the milk flow changes from lying in an interval of relatively low time derivative, positive or negative, to a relatively high ne gative value, this may be construed as the end of the plateau phase and the beginning of the decline phase, i.e. that the first criterion is fulfilled.

According to one embodiment of this aspect of the invention, the stopping of the extraction of milk involves detaching at least one teatcup from a respective teat of the animal’s udder, shutting off a milking vacuum to at least one teatcup and/or shutting off a pulsator vacuum to at least one teatcup. Thus, the milking can be stopped in a way that is adapted to the specific type of equip ment used.

According to another embodiment of this aspect of the invention, the processing circuitry is configured to determine that the se cond criterion is fulfilled exclusively based on that the at least one flow decreases faster than the threshold slope. Thus, the teatcup detachment can be made fully independent from the milk flow level.

According to yet another embodiment of this aspect of the inven tion, the processing circuitry is configured to set the second cri terion dynamically based on an average level of the flow during a plateau phase preceding the decline phase. This means that, if the average level of the flow during the plateau phase is compa ratively high, the second criterion specifies a relatively steep threshold slope; and conversely, if the average level of the flow during the plateau phase is comparatively low, the second crite- rion specifies a relatively gentle threshold slope. In other words, the stop criterion requires a steeper decline phase for triggering in high milk-flow profiles than in low milk-flow profiles. Thus, in general, animals with a low overall milk flow will be allowed lon ger milking times than animals with high overall milk flow. Preferably, the processing circuitry is configured to determine the take-off time in further response to a third criterion. This cri terion is fulfilled if, after that, the first criterion has indicated that the flow has reached the decline phase, the flow decreases be low a threshold level (before the second criterion is fulfilled). Consequently, even if the decline phase is very gentle, the mil king will be aborted at an appropriate point, and over milking can be avoided.

According to one embodiment of this aspect of the invention, the processing circuitry is configured to set the first and second cri- teria based on an algorithm adapted to leave a particular esti mated amount of milk in the udder after that the extraction of milk has stopped. Thereby, irrespective of the specific animal’s current milk-flow profile, an appropriate milking will be carried out. According to still another embodiment of this aspect of the in vention, the processing circuitry is configured to set the third cri terion dynamically based on an average level of the flow during a plateau phase preceding the decline phase, such that: if the ave- rage level of the flow during the plateau phase is comparatively high, the third criterion specifies a relatively high threshold level; and conversely, if the average level of the flow during the pla teau phase is comparatively low, the third criterion specifies a relatively low threshold level. Analogous to the above, in gene ral, this leads to that animals with a low overall milk flow will be allowed longer milking times than animals with high overall milk flow.

According to yet another embodiment of this aspect of the inven- tion the processing circuitry is configured to determine the take off time on the further basis of: historic milk-yield data for the animal, historic milk-flow-profile data for the animal, a current lactation phase of the animal, an age of the animal, and/or a health status of the animal. Of course, this further improves the chances of obtaining an individually optimal milking time.

According to another aspect of the invention, the object is achie ved by an automatic milking method comprising: receiving at least one parameter representing at least one measured flow of milk being extracted from at least one teat of an udder of an ani- mal that is milked via at least one teatcup; and based on the at least one parameter, controlling the extraction of milk to be stop ped. Specifically, a take-off time when the milking shall be stop ped is determined based on first and second criteria, where the first criterion indicates that the at least one flow has reached a decline phase, and the second criterion indicates that the at least one flow decreases faster than a threshold slope. The take off time is determined in response to the second criterion being fulfilled on or after a point in time when the first criterion has been fulfilled. The advantages of this method, as well as the preferred embodiments thereof, are apparent from the discus sion above with reference to the control unit.

According to a further aspect of the invention the object is achieved by a computer program loadable into a non-volatile da ta carrier communicatively connected to a processing unit. The computer program includes software for executing the above method when the program is run on the processing unit.

According to another aspect of the invention the object is achie ved by a non-volatile data carrier containing the above computer program.

Further advantages, beneficial features and applications of the present invention will be apparent from the following description and the dependent claims.

BRIEF DESCRIPTION OF THE DRAWINGS

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.

Figure 1 shows a first embodiment of the invention adapted to be implemented in connection with a milking cluster for udder milking;

Figure 2 shows a second embodiment of the invention ad apted to be implemented in connection with indivi dual teatcups for quarter milking;

Figures 3a-c show diagrams exemplifying how a set of propo sed stop criteria can be applied depending on the characteristics of milk-flow profile; and

Figures 4-5 illustrate, by means of flow diagrams, a general milking method according to the invention and an embodiment thereof respectively. DETAILED DESCRIPTION

Figure 1 shows a milking cluster 1 10 for udder milking, i.e. com mon milking of all the teats of an animal’s udder 105. Here, a pulsator controller 135 is arranged to control a pulsator vacuum PV from a vacuum pump 130 to be applied repeatedly to milking teat cups 1 1 1 , 1 12, 1 13 and 1 14 of the milking cluster 1 10. Typically, the vacuum pump 130 also provides a milking vacuum MV in a milk conduit 120 through which extracted milk is transported away from the udder 105.

The milking claw 1 15 is connected to the four teatcups 1 1 1 , 1 12, 1 13 and 1 14 via respective milk and vacuum hoses. The teat- cups 1 1 1 , 1 12, 1 13 and 1 14, in turn, are attached to a res pective teat of the udder 105. The pulsator vacuum PV is applied to all the four teatcups 1 1 1 , 1 12, 1 13 and 1 14. Milk is extracted from the udder 105, collected in the milking claw 1 15 and forwarded through a milk conduit 120. A flow meter 125 re gisters a parameter representing a measured milk flow f(t) in the milk conduit 120. The measured milk flow f(t) may be registered either continuously or repeatedly at discrete time instances.

In any case, the parameter that represents the measured milk flow f(t) is forwarded to a control unit 150, which, in turn, is adapted to influence how a milking system is operated via a control signal Ctrl.

The term“milking system” here has a general meaning and may include e.g. a single milking cluster 1 10, a milking machine or a milking robot.

The control unit 150 contains processing circuitry and interfaces in order to enable the control unit 150 to receive data and sig nals, perform various analyses of said data and signals, and ge nerate output, for example in form of the control signal Ctrl. More precisely, the control unit 150 is configured to receive the parameter representing the measured flow f(t) of milk being ex tracted from the udder 105 and based on this parameter control the extraction of milk to be stopped by means of the control sig nal Ctrl. The extraction of milk may for example be stopped by detaching the teatcups 1 1 1 , 1 12, 1 13 and 1 14 from a respective teat of the udder 105. A withdrawal cylinder or a milking robot may perform such a detachment in response to the control signal Ctrl. Alter natively, or in addition thereto, the pulsator vacuum PV and/or the milking vacuum MV may be shut off to the teatcups 1 1 1 , 1 12, 1 13 and 1 14.

Referring now to the diagram in Figure 3a, we will explain the criteria based upon which the processing circuitry in the control unit 150 is configured to determine a take-off time t-ro when the milking shall be stopped.

The horizontal axis of the diagram in Figure 3a represents time t, and the vertical axis represents the registered milk flow f(t) as a function of time t. We presume that the milking vacuum MV and the pulsator vacuum PV is applied to the teatcups 1 1 1 , 1 12, 1 13 and 1 14 at t = zero, and that the resulting extraction of milk is initiated at a ti n later point in time t = to. Then, a rise phase Ph r follows during which the milk flow f(t) increases relatively rapidly. Subsequently, the rise phase Ph r ends and a plateau phase Ph p u follows. This means that the milk flow f(t) lies rather stable at a level. In Figure 3a, this is represented by an average level F p n1 of the milk flow f(t). After that milk has been extracted for some time ti , say 100 - 700 seconds, a decline phase Ph d eci is initiated in which the milk flow f(t) begins to decrease. As will be discussed below, the slope at which the milk flow f(t) decreases in the decline phase P h d eci may vary substantially. Figure 3a exemplifies a milk-flow profile with a comparatively steep slope in its decline phase Phdeci.

According to one embodiment of the invention, determining that the milk-flow profile transitions from the rise phase Ph r to the plateau phase Ph p u is made based on a series of registered flow values. More precisely, the control unit 150 is preferably configu red to study a temporal variation of the milk flow f(t) described by these flow values. For example, if an average time derivative of the milk flow f(t) changes from a relatively high positive value to lie in an interval of relatively low time derivative, positive or negative, the control unit 150 may construe this as the end of the rise phase Ph r and the beginning of the plateau phase Ph p u. Ana logously, if the average time derivative of the milk flow f(t) chan- ges from lying in the interval of relatively low time derivative, po sitive or negative, to a relatively high negative value, the control unit 150 may construe this as the end of the plateau phase P h pit and the beginning of the decline phase P h d eci . It has been found that it is beneficial both for the long-term milk yield and for the animal health if approximately the same amount of milk is left in the udder 105 after each milking. There fore, according to one embodiment of the invention, the proces sing circuitry in the control unit 150 is configured to generate the control signal Ctrl at such a point in time t-ro that a particular estimated amount of milk M re s is left in the udder 105 after that the extraction of milk has stopped. This is accomplished via first and second criteria.

The first criterion indicates that the milk flow f(t) has reached the decline phase P h d eci , and the second criterion indicates that the milk flow f(t) decreases faster than a threshold slope. In Figure 3a, the second criterion is symbolized via a dot-dashed line s Crit 1 . The take-off time t-ro is determined in response to fulfill ment of the second criterion on or after the point in time ti when the first criterion has been fulfilled.

Determining if the decline phase P h d eci has been reached can be made via signal processing that is based on a series of flow va lues registered during a current milking, via historic milk-flow- profile data D mfp for the animal being milked, or both. If historic milk-flow-profile data D mfP are to be used, a database 160 is communicatively linked to the control unit 150, so that milk-flow values f(t) can be both recorded and read repeatedly during the milking process. Figure 2 shows an embodiment of the invention where such a database 160 is included. Referring now to Figure 3b, we will discuss further aspects of the stop criteria. As is apparent from Figure 3b, the milk-flow profile has a less steep decline phase P hd eci than in Figure 3a. If the decline phase P h d eci is sufficiently gentle it may be the case that the second criterion, e.g. as symbolized via the dot-dashed line Scritl , in Figure 3a, is never fulfilled. Therefore, according to one embodiment of the invention, the processing circuitry is configured to determine the take-off time t-ro in further response to a third criterion, which is fulfilled if, after that the first criterion has indicated that the milk flow f(t) has reached the decline phase Phdeci, the milk flow f(t) decreases below a threshold level. In Figure 3b, this level is represented by Ftn1 . Thereby, over milking can be avoided also for animals whose milk-flow profile has a very slightly sloping decline phase Ph deci . Preferably, the threshold level Ftn1 is set such that the particular estimated amount of milk M res is left in the udder 105 after that the extrac tion of milk has stopped. A total milking time t M is measured from to until the take-off time t-ro. Thus, at the take-off time t-ro, the particular estimated amount of milk M res should be left in the ud- der 105.

According to one embodiment of the invention, the processing circuitry in the control unit 150 is configured to set the second criterion dynamically based on the average level F p n of the milk flow f(t) during a plateau phase Ph p u that precedes the decline phase Ph deci . This will be explained with reference to Figure 3c, which shows a diagram over a milk-flow profile where an avera ge level F pit 2 of the milk flow f(t) during the plateau phase Ph p u is comparatively low. Here, in order to leave the particular estima ted amount of milk M res in the udder 105 at the take-off time t-ro, a relatively gentle threshold slope s crit 2 is set because the ave rage level F pit 2 of the milk flow f(t) during the plateau phase Ph p u is comparatively low. Conversely, as shown in Figure 3a, if the average level F p n1 of the milk flow f(t) during the plateau phase Phpi t is comparatively high, the second criterion is set to specify a relatively steep threshold slope s Cnt 1 .

Similarly, also aiming at leaving the particular estimated amount of M res in the udder 105, according to one embodiment of the in vention, the processing circuitry in the control unit 150 is confi gured to set the third criterion dynamically based on the average level Fpi t of the flow f(t) during the plateau phase Ph p u preceding the decline phase Phdeci. This means that, if the average level F pit 1 of the milk flow f(t) during the plateau phase Phpit is compa ratively high, the third criterion specifies a relatively high thres hold level F th 1 , for example as illustrated in Figure 3b. Conver- sely, if the average level F p u2 of the milk flow f(t) during the pla teau phase Ph p u is comparatively low, the third criterion specifies a relatively low threshold level F t n2, for example as illustrated in Figure 3c.

Figure 2 shows a second embodiment of the invention, which is adapted to be implemented in connection with quarter milking, i.e. where the milk extraction can be controlled individually from each of the four teatcups 1 1 1 , 1 12, 1 13 and 1 14 respectively.

Here, a particular flow meter 126, 127, 128 and 129 is arranged on a respective milk hose 121 , 122, 123 and 124 from each of the teatcups 1 1 1 , 1 12, 1 13 and 1 14, and the control unit 150 is configured to receive parameters representing measured milk flows fi(t), f 2 ( t ) , f 3 (t) and f 4 (t) from each of the teatcups 1 1 1 , 1 12, 1 13 and 1 14 respectively. The control unit 150 is further configu red to control Ctrl the extraction of milk to be stopped based on said parameters, so that the take-off time t-ro when the milking shall be stopped is determined based on: a first criterion indica ting that at least one of the milk flows fi(t), f 2 (t), f 3 (t) and/or f 4 (t) has reached a decline phase Phdeci; and a second criterion indi cating that at least one of the milk flows fi(t), f 2 (t), f 3 (t) and/or f 4 (t) decreases faster than a threshold slope s c n t 1 or s crit 2 res pectively. Analogous to the above, the take-off time t-ro is deter mined in response to fulfillment of the second criterion on or after a point in time ti when the first criterion has been fulfilled.

Preferably, in the quarter-milking embodiment of the invention il- lustrated in Figure 2, the stopping of the extraction of milk may involve detaching the specific teatcup(s) of the teatcups 1 1 1 , 1 12, 1 13 and/or 1 14 from the respective teat(s) of the udder 105 in respect of which teatcup(s) the above first and second criteria have been fulfilled. Alternatively, or in addition thereto, the stop- ping of the extraction of milk may involve shutting off the milking vacuum MV and/or the pulsator vacuum PV to each teatcup(s) of the teatcups 1 1 1 , 1 12, 1 13 and/or 1 14 in respect of which teatcup(s) the above first and second criteria have been fulfilled. In addition to the above-described first, second and third criteria, it is preferable if the processing circuitry in the control unit 150 is configured to determine the take-off time t-ro on the further basis of historic milk-yield data for the animal, historic milk-flow-profile data for the animal, a current lactation phase of the animal, an age of the animal, and/or a health status of the animal. This in formation may be stored in the database 160, and be retrieved in response to registering an identity of an animal to be milked. As a result, the total milking time t M can be individually adapted with even better precision. It is generally advantageous if the above-described control unit 150 is configured to effect the above-mentioned procedure in an automatic manner by executing a computer program 157. The refore, the control unit 150 may include a memory unit, i.e. non volatile data carrier 153, storing the computer program 157, which, in turn, contains software for making processing circuitry in the form of at least one processor in the control unit 150 exe cute the above-described actions when the computer program 157 is run on the at least one processor.

Although the invention is primarily intended to control a system for extracting milk from cows, the proposed solution is equally well applicable for any other kind of livestock animals, such as goats, sheep, pigs, donkeys, yaks or buffaloes. Naturally, if the animal being milked has a number of teats different from four, e.g. two, the above-described quarter-milking scenario is adap- ted the relevant number of teats.

In order to sum up, and with reference to the flow diagram in Figure 4, we will now describe the general method according to the invention of controlling a milking system where milk extrac tion has been initiated. In a first step 410, at least one parameter is received, which at least one parameter represents a measured milk flow. Then, in a step 420, it is checked if a first criterion is fulfilled, which indi cates that the at least one milk flow has reached a decline pha- se. If so, a step 430 follows; and otherwise, the procedure loops back to step 410 for continued reception of the milk-flow related parameter(s).

In step 430 it is checked if a second criterion is fulfilled, which indicates that the at least one milk flow decreases faster than a threshold slope. If so, a step 440 follows; and otherwise, the procedure loops back and stays in step 430.

In step 440, the milking machine is controlled to stop the extrac tion of milk. Thereafter, the procedure ends.

Figure 5 illustrates, by means of a flow diagram, an embodiment of the invention for controlling a milking machine. Here, the ini tial reference sign 420 represents the above-described steps 410 and 420

In a step 530 thereafter, it is checked if the second criterion is fulfilled, i.e. if the at least one milk flow decreases faster than a threshold slope. If so, a step 550 follows; and otherwise, the procedure continues to a step 540.

In step 540 it is checked if the at least one milk flow has decreased below a threshold level. If so, step 550 follows; and otherwise, the procedure loops back to step 530. In step 550, the milking machine is controlled to stop the extrac tion of milk. Thereafter, the procedure ends.

All of the process steps, as well as any sub-sequence of steps, described with reference to Figures 4 and 5 may be controlled by means of a programmed processor. Moreover, although the embodiments of the invention described above with reference to the drawings comprise processor and processes performed in at least one processor, the invention thus also extends to computer programs, particularly computer programs on or in a carrier, ad apted for putting the invention into practice. The program may be in the form of source code, object code, a code intermediate source and object code such as in partially compiled form, or in any other form suitable for use in the implementation of the pro cess according to the invention. The program may either be a part of an operating system, or be a separate application. The carrier may be any entity or device capable of carrying the prog ram. For example, the carrier may comprise a storage medium, such as a Flash memory, a ROM (Read Only Memory), for ex ample a DVD (Digital Video/Versatile Disk), a CD (Compact Disc) or a semiconductor ROM, an EPROM (Erasable Program mable Read-Only Memory), an EEPROM (Electrically Erasable Programmable Read-Only Memory), or a magnetic recording medium, for example a floppy disc or hard disc. Further, the car rier may be a transmissible carrier such as an electrical or opti cal signal which may be conveyed via electrical or optical cable or by radio or by other means. When the program is embodied in a signal which may be conveyed directly by a cable or other de- vice or means, the carrier may be constituted by such cable or device or means. Alternatively, the carrier may be an integrated circuit in which the program is embedded, the integrated circuit being adapted for performing, or for use in the performance of, the relevant processes. 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, inte gers, steps or components or groups thereof. The invention is not restricted to the described embodiments in the figures, but may be varied freely within the scope of the claims.