The design of a prototype system which controls the flow of milk in the collector ’ s column of an autonomous milking apparatus

The research paper presents a prototype system controlling the flow of milk in the collection column of an autonomous milking apparatus. In the Matlab®-Simulink program, the simulation model of such a system was created. Its essential operation is illustrated in the block diagrams. The logic verification of the model’s operational accuracy (off-line simulation) did not reveal errors. Therefore a laboratory stand for hardware verification − (on-line simulation) was developed. Within it a virtual feedback loop of the control system (stored in computer memory), with elements of real object control incorporated − in this way a prototype of the device was created. During the hardware verification of the proposed technical solution, operation errors were not observed. In response to certain signals from the measuring elements, the controller correctly calculated control signals for the actuators.


Introduction
An observed increase in the milk yield of cows is caused by prolonged milking and consequently an increase in the physical load of teats and udders.Not taking into account individual characteristics of cows in regards to milking can lead to the emergence of disease states of udders including mastitis [2,9].
One study on individual characteristics of cows concerning the content of milk and pace of its production showed the presence of significant statistical differences between the particular quarters of a cow's udder [3].It is necessary to undertake research to develop new designs of milking units and better algorithms to control automatic milking.Milking apparatuses which account for the characteristics of cows with regards to milking would contribute to an improvement in the udder health of dairy cows [8,10].Analysing the state of techniques with respect to milking equipment in the production market, it can be stated that the current activities of leading companies in this industry are focused on ensuring that farmers expend less effort in the milking process.To a lesser extent, emphasis was placed on fine tuning the parameters of the milking machine to accommodate for the individual characteristics of these animals and to develop a negative pressure control algorithm, which is the primary parameter affecting the course of milking.
It is believed that the optimum solution for a milking apparatus construction/design would be one automatically controlled by negative pressure as a function of milk flow, measured independently for each quarter of the cow's udder [l].Thus, in the, University of Agriculture in Krakow, research work on designing and constructing an autonomous milking apparatus (AAU) was undertaken.Its task was to individually milk each udder quarter using negative pressure closely corresponding to the intensity of the stream of milk flowing from the teat of the cow.Vacuum separation of the suction and transport has been established [4,6].
The issues concerning the control of the milking apparatus include two aspects of its functionality − the milk flow and the amount of vacuum suction.The study shows part of the design process relating to one of these aspects in an autontomous milking apparatus, i.e. the system of automatically controlling the flow of milk in the column collector.The purpose of the performed actions was to develop a prototype system which controls the abovementioned process.

Purpose and scope of work
The aim of the work was to develop a prototype system controlling the flow of milk in the autonomous milking apparatus (AAU).
The scope of work included: -determining the design assumptions for the control system of flow in a single column (section) of the AAU collector, -developing a model for fluid flow control system in AAU using Matlab-Simulink

Methodology
The requirements for the designed control system were specified when the simulation model was developed.The correctness of the model was verified by computer simulation (off-line).
A research station was built in which a virtual feedback loop of the control system is stored in computer memory (XPC Target® − toolbox MATLAB-Simulink) including elements of a real object control − in this way the prototype of the device was created.For the purpose of confirming the accuracy of the project's assumptions, a control program was designed and executed which tested the operation and effectiveness of the equipment (online simulation) in the course of which no errors were observed.In response to certain signals of the measuring elements, the controller correctly calculated control signals to the actuators.
Phase assumptions of the project cycle proceed according to the methodology discussed and are presented in block diagram in figure 1 [5,7,11,12].

The structure of autonomous milking apparatus
According to the adopted methodology (fig.1), the first stage of the design work was to determine the requirements for the control system.To formulate it, a review of the system of construction for an autonomous milking apparatus was necessary.The requirements are illustrated by the functional diagram shown in figure 2. A summary of the illustrated construction includes individual milking of each specified quarter of the cow udder, including separation of negative pressure generated by suction from that generated by transport.The collector of the autonomous milking apparatus consists of four independent columns, each of which is comprised of two distinct valve controlled chambers, regulated at both the top and bottom.With this structure, it is possible to separate the vacuum suction of the transport (if one chamber receives milk from a teat, the other empties and vice versa).
This design solution helps to shape the vacuum suction as a function of the effluent stream of milk from the cow teat.Moreover, this solution enables greater use of vacuum suction for conveying milk through to the cooling tank (collecting tank).The design eliminates the mixing of milk from individual quarters of the udder and its movement back under the teats.Figure 3 shows a visualization of the autonomous milking apparatus and a general view of the prototype.Connector pipes (6 and 7) bring the milk from the short milk tube of the teat cup by means of a tee connection (19) to the chambers (1 and 2) of the collector.On the milk supply line (8) into the chamber (1) and on the vacuum supply line that brings milk (23) into the chamber (2), a double pinch valve has been installed (10).This valve shuts off the flow of milk into the chamber (1) and opens the supply of suction to the vacuum chamber (2) and vice versa.Analogously on the milk supply line that brings milk (9) into the chamber (2) and on the vacuum supply line (24) that brings negative pressure into the chamber (1) a double pinch valve has been installed (11).The valve shuts off the flow of milk to the chamber (2) and opens the flow of vacuum suction to the chamber (1) and vice versa.
Construction and functionality of the other three columns of the autonomous milking apparatus collectors are the same.

Computer simulation of the control system
The next step in the development of the project was to develop the simulation model of the milk flow system control in the collection column of the autonomous milking apparatus.In essence, the system includes the implementation of the impact object control via actuators in the form of Z1, Z2, ZA and ZB valves.The impact was calculated from the signals from sensors A and C which are installed in the chambers A and B of the column manifold.The control algorithm is illustrated in the diagram in figure 5. Operation of the control program should have the following sequence: If chamber A is full − set the valve terminals Z1=0, Z2=1, ZA=0, ZB=1.This will close the supply of vacuum suction and milk into chamber A. Simultaneously, the exit line from chamber A to the system is opened In the same instant, the vacuum suction supply line and the milk line are opened, the milk supply flows into chamber B. As a result, chamber A will empty and chamber B will be filled.The negative pressure generated by the milk which is discharged from the chamber has a higher value, ensuring faster drainage of the chambers.The system works analogously if the desired level of milk in chamber B is reached.The system of milk flow control discussed above is illustrated in figure 6 The algorithm of the control system is illustrated in figure 5, entered (in accordance with the standards of the Matlab-Simulink program) in the form of a block diagram illustrated in figure 7.

Start
In this way, a model of the control system was created that allows logical verification of adopted assumptions through a computer simulation (off-line).The results showed correct operation of the modeled control program which properly worked out the impact of feedback on the controlled system.It is, therefore, appropriate to say that the assumptions for the system of milk flow control to the column collector of the autonomous milking apparatus were appropriate for use during on-line hardware simulation.

Hardware simulation of the control system
The hardware simulation provides the ultimate confirmation of the correctness of the design assumptions and the proper operation of the program.In this case it took the form of analysis at the laboratory stand, in which a virtual feedback loop of the control system (stored in Matlab-Simulink) including elements of actual object control − collector column.The result is a prototype of the control system.The research position (test stand) was developed for the necessity of hardware simulation, as illustrated in figure 8.
In order to control the simulation system model illustrated in figure 7 and be able to engage with real elements incorporated into the loop, it has been modified by adding blocks of analog inputs (Analog Input) and digital output (Digital Output) and blocks scaling input and output signals (Fig. 9).
In order to carry out the hardware simulation, for the column collector of an autonomous milking apparatus, a replacement liquid (distilled water) for the milk was brought.It was introduced from a feed tank using a teat cup and a short milk tube to the prototype of the milking apparatus.Each time water flowed through a column of the collector, it was discharged to the second auxiliary tank.Several dozen series of studies were carried out for different flow rates of fluid streaming through the milking apparatus.Analyzing obtained characteristics for the virtual control system with real objects included in the control loop, it should be acknowledged that the elaborated control program is working correctly.It is reasonable to conclude that the design assumptions adopted for the system are correct.2. Hardware on-line simulation carried out at the verification stand confirmed the design assumptions.The control system realized adopted assumptions, the measurements carried out for different values of liquid flow has proven its ability to be used for high volume milking in dairy cows.3. The presented design methodology based on the model enables proper integration and configuration of the control system.

Fig. 3 .Fig. 4 .
Fig. 3. Visualization of autonomous milking apparatus and overview of the prototype.In the illustrated milking apparatus, (fig.3)milking the udder quarter is carried out autonomously by a single column of the collector.A schematic diagram of the column is illustrated in figure4.Its core elements are two symmetrical chambers (1 and 2) in which, during the milking process, negative pressure is generated by suction or transport in an alternating sequence.The base of the collector (4) has a compact housing structure (3) and includes two nozzles (21 and 22), to which the silicone lines are attached for conducting milk from the chamber (1) and (2) to the milk installation.Pinch valves were installed on these lines (12 and 13), which close the chamber (1 and 2) once it has filled with milk, and open it upon the delivery of negative pressure from transport.The cover of the collector (5) has two nozzles (14 and 15) providing negative pressure to produce suction within the individual chambers.In the cover of the collector, particulate filters are installed (16) in addition to sensors measuring the level of the milk (19 and 20) in

Fig. 6 .
Fig. 6.Operation of the control system: a − if cell A is full, b − if the chamber B is full.

Fig. 8 .
Fig. 8.A general view and schematic diagram of the test stand of the milk flow control system in the column collector of an autonomous milking apparatus: 1collector of autonomous milking apparatus; 2 − level transmitter of chamber A; 3 − level transmitter of chamber B; 4, 5 − double pinch valves; 6, 7 − pinch valves; 8 − a control computer; 9 − I/O control computer card; 10 − computer registrant; 11 − I/O recording computer card.

Figures 12
Figures 12 and 13 show graphs of output signals of the control system.These are the signals controlling double valves Z1 and Z2.Analyzing these waveforms, the alternating action of the valve terminals can be seen.

Fig. 11 .
Fig. 11.Characteristics of the voltage (CB) sensor.When Z1 brings a liquid milk replacement to chamber A, it shuts off the flow of vacuum to chamber B at the same time, however, Z2 releases the vacuum in chamber A, which draws milk replacement into the chamber and closes the milk supply to chamber B. After filling one of the two terminals of the chambers, both valves change their values, and the circuit works in the opposite order.

Fig. 13 .
Fig. 13.Z2 valve control signal.In the following graphs (fig.14, 15) signals controlling valves were presented with single terminals ZA and ZB.They bring the liquid from chambers A and B to the milking plant (auxiliary tank).You can also note here the alternation of these terminals.Comparing the operation of valve sensor signals in each terminal (fig.10, 11) it can be stated that the process control is correct.

8 Conclusions 1 .
The logic verification (off-line) of the simulation model of the milk flow control system in the collection column of an autonomous milking apparatus developed in Matlab-Simulink program, demonstrated proper operation.The model calculated the correct value of the output signal using the simulated values of the input signal.