Development of the Technical Structure of the “Cow Energy” Concept

: Regional energy supply is an important topic in the context of the energy transition in Germany. The “Cow Energy” project aims to combine the production of energy and milk for the farmer. In order to take the different needs into account, a central energy management system (EMS) is being established. This system records and simulates how much electricity is generated from renewable sources (biogas, solar, wind, etc.) on the farm. This is compared with the consumption of the barn technology (milking robot, feeding robot, etc.). This energy management is regulated according to the needs of the cows. In order to balance the ﬂuctuations between energy production and energy consumption, the EMS regulates various battery systems. One goal is to network this energy system with the region and to establish regional energy networks.


Introduction
Based on various societal demands, Germany is striving for an energy transition to transform the existing fossil-nuclear energy system into a sustainable energy system based on renewable energies [1]. Renewable energy sources are biomass energy, geothermal energy, hydropower, ocean energy, solar energy, and wind energy. In the first half of 2020, renewable energy sources accounted for 55.8% of total electricity generation in Germany. The three most important sectors were wind energy with 30.6%, solar energy with 11.4%, and biomass energy with 9.7% of total energy generation [2].
The large demand for renewable energy is causing changes in the energy market. Renewable energy production is distributed over large areas and is no longer centralised such as e.g., nuclear energy. This leads to a regionalisation of energy production with many small producers and difficulties in energy regulation [3]. Another aspect is the fluctuation of wind energy and solar energy. Generation and consumption cannot always be reconciled with this [4]. In addition, the energy grid must be restructured for this. Instead of centralised grids, decentralised grid structures with their own regulation are now necessary. Additional north-south grid connections are being built to compensate for the differences in regional energy production [5].
This also offers corresponding opportunities for agriculture. Many forms of renewable energy require agricultural land or buildings either for energy production (biomass energy) [6] or for setting up the plants (wind energy and solar energy). For this reason and the possibility of diversification [7], the production of regenerative energy has become established as a business sector in German agriculture. Wind energy is widespread in the north of Germany, while solar energy is widespread in the south, and biomass energy via biogas is widespread throughout Germany [8].
In terms of energy demand in cow barns, technological development has caused a significant change in recent years. In Bavaria, 14.6% of all dairy farms currently milk with Agronomy 2021, 11,1915 2 of 8 an automatic milking system. These hold 21.6% of all dairy cows in Bavaria [9]. Many of these farms also use an automatic feeding and cleaning system. These systems can now be found on all types of farms and can also be combined with grazing. The trend towards the complete automation of cow barns is continuing in Germany and can be considered the standard for newly built cow barns in the coming years [10]. In cow barns with automatic milking, feeding, and cleaning systems, the energy demand is no longer twofold with morning and evening milking but rather evenly distributed throughout the day. Furthermore, the energy demand of the individual consumers is flexible within a certain range [11].
Due to the current legal regulations, energy production and energy consumption in agriculture are usually still separate. The amendment of the Renewable Energy Sources Act makes self-consumption and the targeted marketing of electricity economically interesting [12]. The following calculation example illustrates this. Modern dairy cowsheds in southern Germany have 120 dairy cows plus dry cows. The animals are milked by two automatic milking systems. The energy consumption of these barns is 67,000 kWh per year [13]. Depending on the roof design, a photovoltaic system on the roof (1755 m 2 area) can generate between 203,000 and 260,000 kWh of solar energy per year [14]. If cattle manure and fodder residues are used for biogas production, a further 297,000 kWh of electrical energy is generated per year [13]. Thus, significantly more energy can be generated than is consumed in the barn.
So, there is the possibility of coupling a regional resource-oriented energy supply with the social demands for modern, sustainable, and animal welfare-oriented dairy cattle stables. This complex of topics is to be the focus of the "Cow Energy" research initiative.
The research concept envisages designing integrated milk and energy production (Integrated Dairy Farming) for dairy farms and installing it on pilot farms, whereby synergy potentials are to be optimally utilised through goal-oriented networking.
Energy management systems (EMS) are currently being discussed in many areas (industry, transport, construction, etc.) in order to achieve society's energy-saving goals [15]. EMS is understood to be an autonomous control system that coordinates and optimises the energy demand of different consumers with the energy supply of different producers. Various problems arise in the implementation of these goals. In industry, there are technical difficulties in the communication of the individual machines with each other and in the optimal planning of the energy demand. With the employees, there are obstacles in the implementation of the goals by the company management, and usually coupled with this, there are difficulties in communicating the goals of an EMS to the employees [16]. In the case of e-mobility, coordination between the various users is difficult to plan [17]. This results in uncertainties about when and where energy is needed and high safety reserves [18]. In the building sector, there is again uncertainty about the needs of the different users, which limits flexibility [19]. In addition, the costs of the EMS play a particularly decisive role here [20].
Energy plays an important role in modern cowsheds. In order to be able to plan accordingly, data on energy producers and consumers are necessary. Corresponding data are available for automatic milking [21] and feeding systems [22,23]. However, it was not possible to cover the entire range of possible technical systems. For the production of solar energy and wind energy [24] as well as biomass energy [25], there are also case studies on dairy cows. These are with predefined framework conditions and are not transferable to the general public. In addition to these measurements, there are also energy calculations from Italy [26] and Norway [27]. These calculations cover the total energy balance of the dairy cows and therefore have some uncertainties in the energy balance for process energy. The study by Shine et al. goes furthest [28], which is based on measurements and simulations. It is also a total energy balance but with relatively precise information on the energy consumers that can be controlled with an EMS. The large differences in energy demand for milking between the studies analysed are striking. The reasons for this are Agronomy 2021, 11, 1915 3 of 8 probably to be found in the different levels of technology of the milking technique. As the highest level of technology, automatic milking has the highest energy consumption.
This gives rise to various research questions for the Cow Energy project. Similar to industry, communication between the various machines plays a decisive role. For this, development approaches from "Industry 4.0" [29] and the development of cyber-physical production systems must be considered [30]. For the simulation of energy production and consumption, the specific parameters of regenerative energy systems and cow barns must be recorded [31] and suitable simulation models must be developed. A special feature of the project is the animal-technology-human interaction. Existing EMSs work either on the technical level alone or with the two influence groups of humans and technology. Here, the third independent influence group cow is added, which is why existing EMSs have to be adapted to these animal-technology-human interactions. Furthermore, the EMS "Cow Energy" should also be integrated into the region, act as an energy source and sink for regional suppliers [32], and thus be able to support the development of decentralised, remunicipalised energy production [33].

Materials and Methods
Overall, the research initiative provides for a holistic approach to the further development of dairy farming systems. The essential components of Cow Energy are as follows: • Barn automation and central control of the systems; • Energy efficiency and use of various energy storage solutions; • Integration into the regional power supply to serve the grid; • Sustainable barn construction; • Safeguarding food quality and animal health; • Animal welfare criteria and ethical aspects; • Impact on agriculture and rural regions in southern Germany.
From the technical point of view, the conception and realisation of the energy management system (EMS) is one of the decisive challenges of the research and development project ( Figure 1).
Agronomy 2021, 11,1915 3 of 8 demand for milking between the studies analysed are striking. The reasons for this are probably to be found in the different levels of technology of the milking technique. As the highest level of technology, automatic milking has the highest energy consumption. This gives rise to various research questions for the Cow Energy project. Similar to industry, communication between the various machines plays a decisive role. For this, development approaches from "Industry 4.0" [29] and the development of cyber-physical production systems must be considered [30]. For the simulation of energy production and consumption, the specific parameters of regenerative energy systems and cow barns must be recorded [31] and suitable simulation models must be developed. A special feature of the project is the animal-technology-human interaction. Existing EMSs work either on the technical level alone or with the two influence groups of humans and technology. Here, the third independent influence group cow is added, which is why existing EMSs have to be adapted to these animal-technology-human interactions. Furthermore, the EMS "Cow Energy" should also be integrated into the region, act as an energy source and sink for regional suppliers [32], and thus be able to support the development of decentralised, remunicipalised energy production [33].

Materials and Methods
Overall, the research initiative provides for a holistic approach to the further development of dairy farming systems. The essential components of Cow Energy are as follows: • Barn automation and central control of the systems; • Energy efficiency and use of various energy storage solutions; • Integration into the regional power supply to serve the grid; • Sustainable barn construction; • Safeguarding food quality and animal health; • Animal welfare criteria and ethical aspects; • Impact on agriculture and rural regions in southern Germany.
From the technical point of view, the conception and realisation of the energy management system (EMS) is one of the decisive challenges of the research and development project (Figure 1).  The energy and production management system should enable a balanced and sustainable production of energy [19] and milk at the same time. In this way, the innovation in agricultural technology serves to increase resource efficiency. Decision-making algorithms Agronomy 2021, 11,1915 4 of 8 that guarantee an effective control of the EMS are created by using big data analysis. The required data are provided by existing sensors and additional sensors that are integrated into the overall system if necessary. In the context of combined agricultural production of milk and meat as well as regenerative energy, this energy can be used for a self-sufficient production and to cover the demand of a regional energy supply network.

Results
The development of an intelligent, self-controlling energy management system is the focus of this research project. The system must collect a large amount of data from the technical [34], economic [35], and social [36] spheres in different structures.
In this context, barn components, energy consumption, and work structures are relevant and recorded as characteristic values. It becomes apparent that here, in contrast to arable farming, there is no uniform data interface in the form of the ISOBUS standard. Each system such as a milking robot or feeding robot is self-contained. Therefore, all information that are important for the process must be collected via a separate sensor network. The machine's own sensors can only be used to a limited extent. This naturally limits the functionality and respectively the utilisation of these data within the EMS. Therefore, the lowest level of functionality is considered to be switching on and off and recording energy consumption. In contrast to common practice, the energy consumption must be recorded every 10 s and not every 15 min so as not to undermine the energy management system (EMS) through high, unrecorded start-up currents. In the field of energy generation via biogas, wind turbines, solar energy, and others, the recording is easier because sensor networks from the industrial sector are often used here. Hence, corresponding interfaces exist and are applicable. However, a general standard does not exist here either, and every system is put together differently.
In order to balance energy consumption and energy generation, the respective values in the EMS must be planned in advance via simulations. Weather forecasts, barn climate data, and data from the dairy cows in particular are used as planning data. Due to extensive automation of the barn technology, the power consumption is balanced. In contrast to the two power peaks that occur with milking parlours, AMS shows a continues power demand throughout the day. Thus, a power requirement for the individual consumers can be planned in advance throughout the day.
The individual regenerative energies can be planned differently. Biogas enables a steady and constant energy supply, but it can also be used as an energy storage. Solar energy is only produced during the day when the sun is shining. As a consequence, for short-term planning over three days, a weather forecast is always necessary. The weather forecast is also necessary to plan for the loss of solar energy due to snow on the modules. When setting up the photovoltaic system, the modules were oriented to the east and west. This reduces the peak power but leads to more energy yield in the morning and evening hours, which again improves the balance of the energy production. In the case of wind energy, the approach is used also to plan ahead using weather forecasts. The third factor to be considered in the simulation, in addition to energy consumption and energy production, is the cows. In the case of the cows, this is particularly the individual animal performance data, which is transferred from the herd management systems via an interface. In addition, the animals' behavioural data are recorded individually. These are movement activity via pedometer, chewing activity, animal position via a positioning system, and also possibly body temperature and rumen pH value via a bolus. These data are mostly used for short-term planning.
From these data, the EMS can predict behavioural structures of individual cows and cow herds and draw conclusions about the future energy demand of the barn components. For example, if many cows are lying in the cubicles, it would be a good time for the slat cleaning robot to clean the then-empty walkways. The energy needed for this must be available via the energy production or storage units (Figure 2). For example, if many cows are lying in the cubicles, it would be a good time for the slat cleaning robot to clean the then-empty walkways. The energy needed for this must be available via the energy production or storage units (Figure 2). The EMS also offers the possibility to better coordinate the individual robots and barn components. For example, it is possible to block the cleaning robot at the feeding area when the feeding robot presents new feed. In this way, the systems can be coordinated with each other.
The recording of energy consumption, energy supply, and animal data represents the barn level of the EMS. Since the energy generators in the barn are designed in such a way that they produce more energy on average than the barn alone needs, the rest can be fed into the regional grid. To ensure regional electricity supply, storage and power purchase are also crucial. For grid-serving integration into the power supply network, the farm EMS offers various possibilities due to its different forms of energy. Algorithms need to be developed for the EMS to control the various storage systems. Classic batteries are available as short-term storage-as stationary accumulators or in mobile implements; here, electricity can be stored for a few hours. As medium-term storage, ice water can be used for milk cooling. Here, the storage period is one to two days. As a long-term storage facility, biogas can be used during the day, which can be converted into electricity as needed. Other storage facilities for emergencies are, for example, the energy reserves of hybrid vehicles. The task of the EMS in the central storage control system is to distribute the energy flows between the individual storage units and to manage them according to demand and supply.
Internally, the EMS can also be used to optimise the system's own power consumption. For example, in the test operation, the electrically-driven feed mixer is only needed at two fixed times per day; in between, it can be charged. This charging process can now be controlled by the EMS so that it is only charged during times of energy surplus. The EMS also takes into account that the feed mixer wagon must be charged at a certain time. If not enough energy is generated during the charging period, the EMS can use its own storage in time or use energy from the grid, depending on economic circumstances.
The flexibility options arising from the storage facilities can be provided to the regional energy suppliers via the operational level. The EMS coordinates an absorption or supply of energy with the regional energy supplier via a data gatekeeper. The latter can The EMS also offers the possibility to better coordinate the individual robots and barn components. For example, it is possible to block the cleaning robot at the feeding area when the feeding robot presents new feed. In this way, the systems can be coordinated with each other.
The recording of energy consumption, energy supply, and animal data represents the barn level of the EMS. Since the energy generators in the barn are designed in such a way that they produce more energy on average than the barn alone needs, the rest can be fed into the regional grid. To ensure regional electricity supply, storage and power purchase are also crucial. For grid-serving integration into the power supply network, the farm EMS offers various possibilities due to its different forms of energy. Algorithms need to be developed for the EMS to control the various storage systems. Classic batteries are available as short-term storage-as stationary accumulators or in mobile implements; here, electricity can be stored for a few hours. As medium-term storage, ice water can be used for milk cooling. Here, the storage period is one to two days. As a long-term storage facility, biogas can be used during the day, which can be converted into electricity as needed. Other storage facilities for emergencies are, for example, the energy reserves of hybrid vehicles. The task of the EMS in the central storage control system is to distribute the energy flows between the individual storage units and to manage them according to demand and supply.
Internally, the EMS can also be used to optimise the system's own power consumption. For example, in the test operation, the electrically-driven feed mixer is only needed at two fixed times per day; in between, it can be charged. This charging process can now be controlled by the EMS so that it is only charged during times of energy surplus. The EMS also takes into account that the feed mixer wagon must be charged at a certain time. If not enough energy is generated during the charging period, the EMS can use its own storage in time or use energy from the grid, depending on economic circumstances.
The flexibility options arising from the storage facilities can be provided to the regional energy suppliers via the operational level. The EMS coordinates an absorption or supply of energy with the regional energy supplier via a data gatekeeper. The latter can make requests to the EMS for the supply, storage, or absorption of energy. The energy supplier does not have direct access to the energy production on the farm, which is currently the case. For example, the decoupling of biogas plants would be substituted by the coordination of load management requests to the EMS. In doing so, the EMS proceeds according to a decision hierarchy. First, the energy demand for the dairy cows is forecast from the collected data. There are components such as the AMS, whose switching off has a considerable impact on animal welfare and must therefore be avoided, and components such as the slat cleaning robot or the cow brush, which can be shifted within certain limits if necessary. Then, these shifts lead to a change in prioritisation; these shifts are always only possible over certain periods of time. These priorities need to be defined and are the decision-making basis that is integrated into the EMS via algorithms. Subsequently, the energy storage level, the storage combined in a virtual battery, and the simulated energy generation potential are included in the calculation. Then, the EMS decides how far the requests can be satisfied without straining the energy management process.
Since the data exchange with the energy suppliers is continuous and there are a wide variety of requests for delivery, the storage and consumption of energy can arise at very short intervals; correspondingly, high data query rates must be run for a good simulation and decision-making basis for the EMS, which requires an appropriate data connection.
As an additional benefit, the EMS offers the farm manager the possibility to be continuously informed about the current process and energy status of the barn. The documented data can be used for farm development and to ensure the legal and market requirements of traceability of products and processes.

Discussion
This paper shows that EMS is possible for dairy barns. The general problems of EMS can also be found in Cow Energy. Communication between the individual machines is also difficult here. There is currently no data exchange platform in the cowshed, although this would also be useful for other aspects besides EMS, such as health management. With the process data sheets and process control systems from the field of Industry 4.0, an EMS should be possible at a low level.
Since the product to be produced, milk, and its processes are mostly uniform, the application of simulation models from industry is possible. Most disturbance factors enter the system via the weather.
Interaction with the dairy cows in the EMS is also possible. This is an important point in the study. The needs of the dairy cows are relatively constant and can be captured well via sensors. Interaction with humans is easier in the EMS Cow Energy than in the industry, since management and employees are usually combined in the role of the farmer.
The EMS shows that battery systems are fundamentally necessary to compensate for fluctuations in renewable energies [37]. This is a future field of work. An interesting approach is the multiple use of energy storage in electric machines, such as feed mixers or wheel loaders. These machines are often only used for 4 h a day. This means that 80% of the time, the battery could be used in the energy storage system. Two developments are necessary for this. The current charging system must be further developed into a bidirectional charging and discharging system, and it would be good if these systems were standardised to enable universal use.
Additional energy storage systems in agriculture should be analysed. One possible approach would be a heat exchanger in the slurry tank.
The use of EMS also offers possibilities in other farm types besides dairy cattle. Pig and poultry farming would be further possible applications. However, flexibility does not play such a large role, as the processes here are even more uniform. One main aspect in this case is the reliable allocation of emergency power.
Another expansion step is the cooperation of several farms with EMS to form an energy cooperative, to balance energy peaks between individual farms. Then, the use of biogas for energy storage would also become easier, as the balancing in the grid would reduce the start and stop cycles. The next expansion step would be integration in villages. Here, the generated electricity could be stored temporarily, since farms usually have better possibilities for energy storage than single-family homes. In addition, there is the possibility of integrating the farm into the regional black start capability for the energy grids. For these energy cooperatives, a further development of the existing legal and fee structure for energy supply and grid transmission is necessary.

Conclusions
The demand for renewable energy in Germany and the automation of dairy barns offers the possibility to combine these two business sectors in an optimal way. With the dairy barn, significantly more energy can be generated with solar, wind, and biomass energy than is consumed in the dairy barn itself. In order to market the generated energy in an economically and ecologically sustainable way, an EMS is necessary. The requirements for this are being investigated in a model analysis. An EMS is to be integrated into the cowshed. The requirements for communication between the machines and adaptation of a simulation model for energy production and demand can be implemented. The animalhuman-technology interaction is to be mastered in the EMS. Future research areas include energy storage systems adapted to agriculture and integration into regional energy grids.