Computer System for Temperature Diagnostics of Cows

Abstract The objective of the paper was to draw out a functional profile of a new computer system for temperature diagnostics of cows. This device enables oestrus detection including the silent one, early pregnancy (from the 5th day of insemination), acute inflammatory conditions and subclinical mastitis in a non-invasive manner during machine milking of cows. For diagnostic purposes one type of the measurement sensor was used, which is a unique feature in comparison to diagnostic devices mass produced and available on the market. A microprocessor module of the new milking system has intelligent devices features. It is construed of modern analogue and digital subassemblies and specialised measurement interfaces. The program structure of the system enables processing of automatically registered milk temperature values during cow milking on account of requirements of cow temperature diagnostics.


Introduction
The use of modern diagnostic methods of physiological states and health of cows' udders is one of the factors which influence the increase of milk production effectiveness in farms (Saint-Dizier and Chastant Maillard, 2012;Steeneveld et al., 2014).In milk cowsheds everyday diagnostics of animals is carried out traditionally as well as with the use of simple and more advanced electronic measuring devices (Jędruś, 2014).A separate group consists of structural solutions which enable diagnostic evaluation of cows on milking points during machine milking based on the analysis of the selected physico-chemical parameters of milk (Cordes and Borchert, 2012;Jędruś, 2014;Ordolff, 2001;Sterrett et al., 2013).
The investigations which were carried out in Poland and other countries confirmed the possibility of using milk temperature values automatically registered during milking for diagnosis of oestrus in cows, early pregnancy and subclinical and acute mastitis (Ball et al., 1978;Fordham et al., 1987A,B;Fordham et al., 1988;Gil, 1988;Gil et al., 1997;Gil ert al., 2001;Kliszczewski et al., 1996;Maatje and Rossing, 1976;Maatje et al., 1992;McArthur et al., 1992;Ordolff, 2001).Despite great diagnostic possibilities, temperature methods are not presently fully utilised by milking systems producers.Milk temperature during milking is measured for diagnostic purposes in the limited scope only in a few milking controllers and selected milking robots.
In 2011 in the Institute of Biosystem Engineering of the University of Life Sciences in Poznań together with scientific units work on the development of a new system for cow diagnostics has been initiated.The structure of the new milking device was based on the concept of use of temperature sensors, which are mounted in milking cups, for diagnostic purposes and the use of diagnostic inference algorithm developed in the Department of Cattle Breeding of the University of Agriculture of H. Kołłątaj in Krakow.In comparison to other diagnostic devices available on the market, determination of the selected physiological states of health of cow udders was carried out during machine milking with the use of a single type of the measurement sensor mounted in the milking apparatus.
The objective of the paper was to determine a functional profile of the new computer system of temperature diagnostics of cows which enables detection of physiological states and evaluation of udder lobes during machine milking.Equipment structure of the computer temperature diagnostics system of cows Milking equipment of the computer temperature diagnostics system of cows is composed of the milking apparatus Classic 300 of GEA Farm Technologies company equipped with transparent speculums mounted in milking cups, separated black teat gums and a long milk hose.On the hanger of the milking machine an electronic pulsator, integrated connection and vacuum conduits were mounted (by Polanes company from Bydgoszcz).Depending on the milking equipment of the cowshed, there is a possibility of mounting milking subassemblies of other makes.

Problem solving concept
In transparent speculums, which are a part of milking cups of Classic 300 apparatus, four thermistor temperature sensors TT4-5KC3-25-3500-UPP of Tewa Temperature Sensors Sp. z o.o.company from Lublin were mounted The most important metrological and functional parameters of thermistors were given in table 1.A characteristic feature of these thermistors is the use of additional covering material made of acid-proof steel in the structure of a sensor.An additional cover protects a thermistor against hazardous impact of mechanical and chemical factors which occur in the milking floor.On the output of temperature sensors, an analogue signal is generated which is sent with a conduit to the microprocessor module.On account of a great inference resistance of thermistors, an analogue signal may be sent to greater distances without the need of using special measurement procedures.Electric conduits of temperature sensors were placed in the protective gum cover made of an additional vacuum hose.
The task of the microprocessor module consists in supplying thermistors mounted in milking cups, automatic registration of temperature values during milking and visualization of measurement signals.On the design stage, electronic equipment was optimized on account of minimization of the number of analogous electronic elements.The main digital subassembly of the microprocessor module is a high-efficient micro-controller Atmega 128 by Atmel company.Taking over some measurement procedures by the processor enabled elimination of, inter alia, analogous corrective systems from the structure of the measurement system.Typical interfaces of serial transmission applied in microcontrollers are used in the diagnostic module: I 2 C, UART and the USB interface developed for the PC platform (but more often used in microcontrollers).The entire electronic equipment of the module was configured in the form of three functional blocks: thermistor supply blocks and automatic registration blocks and measurement signals visualization.
The thermistors' supply block consists of four merged current sources LM 334 of high stability.Regulation of the supply current takes place with the use of a single resistor.In order to achieve the required stability of the supply current strength four resistors of the fixed resistance value were used instead of potentiometers for regulation of current.On account of tolerance of passive elements four various values of current supply strength were obtained: channel 1 -99.30µA, channel 2 -99.44 µA, channel 3 -98.67µA, channel 4 -98.45 µA.Real values of supply current strength of temperature sensors were programmed in the semiconductor memory of the microprocessor module and used during processing of milk temperatures values registered during machine milking with the use of thermistor processing equation TT4-5KC3-25-3500-UPP.
The block of automatic registration of measurement signals is composed of the analogue-digital converter, semi-conductor memory and other electronic elements.Block operation of controlled by Atmega 128 microcontroller.The measurement signals visualization block consists of a LCD alphanumeric display 16x2 which is in accordance with HD 44780 controller.Block operation is also controlled by Atmega 128 microcontroller.During milking, a display shows information on temperature in particular milking cups, recorder operation time and the number of milking which was carried out.
The microprocessor module is equipped with the interface merged system USB FT232R which enables processing of the USB standard into TTL, RS232 and RS422/485 standards as well as in other electronic subassemblies: semi-conductor securing diodes, voltage stabilizers, secondary elements and others.
The microprocessor module is supplied by batteries or by an accumulator within the range of voltage 9-12 V.A great advantage of such method of supply is a possibility of a free movement of a milking apparatus between milked cows (a stanchion-tied stable with no electric installation in milking points) and total separation of electronic elements of the microprocessor module from disturbances which come from a single-phase power network.The entire equipment of the electronic microprocessor module was mounted in the waterproof cover.
During machine milking on milking points, the microprocessor module is mounted on a hanger and operates automatically (without the participation of PC computer).The operation of the device includes: turning on the supply module before the first milking and turning it off after milking of the last cow, turning on the measurement signals recorded before and after the milking of particular cows.The read out of the recorded measurement data takes place with the use of the USB interface, PC computer and computer program (subprogram Recorder).Deletion of data included in the semi-conductor memory may be carried out from the level of PC computer or manually during automatic operation of the microprocessor module.

Program structure of the computer temperature diagnostics system of cows
The computer program was developed in C# language for NET Framework 3.5 platform and includes four subprograms: Recorder, Data base, Analysis of data and Diagnostics.
Recorder subprogram includes the following functional possibilities: -readout of data saved in the semiconductor memory of the automatic recorder of measurement signals (values of temperatures recorder during machine milking of cows during the automatic operation of the recorder); -data registration in the form of files .csv in the computer memory; -initial visualization of thermogram of milk flow from cows' udders quarters; -readout and recording of the supply current strength individually for each thermistor installed in the milking cup; -memory state control − available volume and the remaining operation time of a recorder; -program deletion of the recorder memory from the computer; -visualization of the recorder work time with its constant connection to the computer -turning on the recorder from the level of PC; -others.
In the subprogram Date base, there is a possibility of collecting zoo-technical information on cows: cow number in a cowshed, farm name (place of research), hf blood participation, cow's date of birth and number of calves.Moreover, there is a possibility of recording further additional information which is significant from the point of view of further analysis of data.Exemplary additional information recorded in the data base and used in diagnostic analyses e.g.results of utility assessment of cows (mainly the number of somatic cells in the udder milk of the investigated cows) carried out by the Polish Federation of Cattle Breeders and Milk Producers, the number of micro-organisms in the quarter milk (based on the author's own research results), air temperature during investigation, cows' number in a cowshed in case they have a non-typical morphology of an udder and physiology of milk flow from an udder, date of replacing teat gums in the milking machine and others.In the subprogram, a file which enables recording of the somatic cells number in cows' udder lobes was selected.Data were obtained based on the results of microbiological analyses of quarter milk samples collected during cowshed research.
In the Data analysis subprogram, six algorithms are applied; four diagnostic algorithms and two measurement algorithms.Diagnostic algorithms are used for temperature diagnosis of the selected physiological states and health of mammary glands of cows.On the other hand, measurement algorithms are used for analysis of shaping milk temperature during machine milking of cows and assessment of temperature sensors operation mounted in milking cups.
Assumptions of diagnostic algorithms were developed in the Institute of Cattle Breeding of the University of Agriculture of H. Kołłątaj in Krakow (Jędruś, 2014).The computer program included four diagnostic algorithms: oestrus detection (three variants of analysis: after the first calving, with the oestrus cycle of 17-24 days used at higher air temperature values), detection of early pregnancy, detection of subclinical conditions (+two additional variant developed in the Institute of Biosystems Engineering of the University of Life Sciences in Poznań) and detection of acute conditions.
In case when oestrus, early pregnancy and acute conditions are detected based on the registered milk temperature values recorded in time, the subprogram automatically calculates average milk temperature values and average values of maximum milk temperatures.A determined value of the increase of the average milk temperature in a particular milking in comparison to the average milk temperature values from previous milking is diagnostic information.
The subprogram enables recording of the last calving and the date of cows' insemination and automatically generates specific diagnostic information.
Three variants of analyses are applied for detection of subclinical conditions of cows' udder lobes.The program automatically calculates the number of fluctuations, defined as a determined difference in temperatures between the temperatures in the i-th moment of milking and the reference temperature.Differences between the variants concern reference temperature values as well as the analysed time range of cow milking.The first variant is based directly on the assumptions of the theoretical algorithm of diagnostic concluding; in the second and third variant the impact of additional covering material of thermistor on the temperature shaping during machine milking was included (Jędruś and Beba, 2014).Additionally, in the third variant of analyses, the interpreted time range between the 2nd and 4th minute of milking was considerably narrowed.It was assumed that disturbances in the milk flow from cows' udder lobes will influence the course of the main stage of milking where maximum values of intensity of milk flow from mammary gland occur (Luberański et al., 2006).
Assumptions of two measurement algorithms were developed in the Institute of Biosystem Engineering of the University of Life Sciences in Poznań.Algorithm of the temperature analysis enables automatic calculation of the selected parameters of the milk flow courses from the cows' udders quarters: The number of recorded temperature values, recording time, maximum temperature of milk, time of obtaining maximum temperature, initial temperature of a thermistor, temperature in 60...900 second of milking (with resolution of 60 seconds).
The next algorithm enables automatic assessment of temperature sensor operation (of thermistors mounted in milking cups) based on the courses of milk flow from quarters of cows' udder registered during milking.Three methods of thermistors operation were defined: correct operation, disturbance, no connection.Additionally there is a possibility of visualization of courses of milk flow from quarters of cows' udders with disturbances.
In the operation mode Diagnostics there is a possibility of cows' zoo-technical data visualization and temperature diagnostics results in the separate window.In the final visualization window, the following data are presented in the table form: I. Zoo-technical data of cows: cow's number in the cowshed, farm, hf blood participation, date of birth of a cow, number of calvings and additional information.II.Results of cows' temperature diagnostics.
-Detection of oestrus: date of the last calving, diagnostic information.
-Detection of early pregnancy: insemination date, diagnostic information.
-Diagnosis of subclinical states: number of somatic cells (LKS) and the number of fluctuations in particular lobes of cows' udders for three variants of analyses.-Diagnostics of acute inflammation: diagnostic information.
Computer program was subjected to verification with the use of text files and validation (Jędruś, 2014).Results of analyses proved that the program operates correctly and meets all assumptions of diagnostic and measurement algorithms.

Conclusion
The computer system of cows' temperature diagnostics is a modern milking device with great diagnostic possibilities.It can detect the selected physiological conditions and cows' udder lobes health during machine milking of cows in a non-invasive manner at the use of only one type of a measurement factor.The new milking system has properties of intelligent devices.It is equipped with a microcontroller, analogue and digital converter (A/C) with great resolution and specialized interfaces for sending measurement information: I 2 C, UART and USB.Measurement procedures are carried out in the digital form according to strictly determined algorithm directed mainly on account of cows' temperature diagnostics requirements.There is a possibility of carrying out various algorithms of processing by the same measuring system: detection of oestrus, including a silent one, early pregnancy (from the first day of insemination), acute inflammation and subclinical mastitis, temperature analysis of thermographs and assessment of operation of thermistors mounted in milking cups.Full access to the source program enables modification of the program structure of the new diagnostic system.

Figure 1
Figure 1 presents a simplified flow chart of a new computer temperature diagnostics of cows.

Figure 1 .
Figure 1.Simplified structure of a computer system for temperature diagnostics of cowsAn equipment and program structure may be distinguished in the new milking system.The equipment structure of the system is composed of milking devices, temperature sensors and microprocessor module.The program structure of the system covers a PC computer with a specialist computer program.

Table 2 .
Table 2 presents the most important functional properties of the recorder.Selected functional parameters of the automatic registration of measurement signals block