Pull to refresh

How to milk cows with robots and make an industrial startup of it. The history of the R-SEPT development

Reading time 10 min
Views 2.3K
Machine learning *Robotics development *Start-up development Robotics DIY
Original author: Artyom Malyshev

In 2017, the media heard a very interesting story about a startup that robotizes milking cows on industrial dairy farms. The company is called R-SEPT, and back then it received 10 million rubles of investment. But a year has passed, and there's still no news on what happened further. We contacted Aleksey Khakhunov (AlexeiHahunov), the founder of the startup, and discussed the development. It turns out that the whole year his team was getting the prototype of the robot into shape, and just a week ago they conducted their first field test on the farm.

Under the cut there's a story about a robotics student who grew up on his parents' farm, turned the University diploma into an industrial startup, as he collected the first manipulators with his friends, and then scaled up to the level of state programs for the robotization of agriculture. And the most important is how the iron hand of the robot and the machine vision are better than a living milkmaid.

Alexei Khakhunov

This week we supplied the robot to the farm and milked the first cow. Everything went pretty funny. Our family has a dairy company where I used to work. It's located in the Sergiev Posad district, the village of Kuzmino. We have fifteen hundred cows there. This is a large enterprise.

I got a degree in robotics. Naturally, I was itching to use my theoretical knowledge in action. I studied the situation with robotics in the field of dairy farming, and came to an interesting conclusion. All the existing robots — and now there are three main manufacturers — were created in Europe, and the markets of America or Russia are very different. In Europe, small family farms up to 200 cows are quite widespread. In Russia, China and America, farms are very large. We have an enterprise where there are about 50 thousand cows. At the same time, in Europe, 40% of farms are robotized, and in other markets robotization doesn't exceed 1%. And the problem is that the robots that were made for small farms are not adapted at all to the realities of the large farms.

In Europe, the farmer himself milks, feeds the cattle, he does everything. The cow must be milked for the first time at five or six in the morning. This is a complicated process – it's really complicated. To relieve the pain of the farmer, they came up with a robot that helps to cope with it, but economically doesn't give any benefit. He just makes life easier for the farmer. And the large enterprises need them to make a profit. The cost of the robot, performance, maintainability and other things must meet a large number of industrial standards.

Almost all the existing robots were invented by the vets. They knew very well how to work with a cow, but many of their designs were not perfect, they turned out redundant and had many obvious shortcomings.

We decided to create a robot of industrial design, which will cost less than the existing ones, but it will be the latest technology in the field of robotics, and all the experience of working with cows would be taken into account. So, there is a goal left to be implemented.

Robot for milking

According to the modern practices on the farms, cows don't have a certain fixed place: it's just that a hundred or two hundred cows walk around the yard, they can lie in any stall, eat at any time. The robot is put in the same cycle, and the cow comes there itself.

The diet of the cow consists of a very large number of components. But the feed is the most enjoyable for a cow. It's like sweetness to a man. To drive a cow into a robot, they don't feed it at the usual time, that is what a robot does, and the cow comes there to eat. Until we started doing it, they weren't motivated to come for milking. They were stressed about it.

The robot is essentially a single closed stall. It has two doors. One opens when the cow comes out, the other lets the next cow in and closes.

There is a myth that people like to tell: allegedly, the cow loves to be milked by milkmaids. To be stroked, loved — and only that way it will give a lot of milk. In fact, it's absolute bullshit. The only thing that a cow loves is a lack of stress and absolute repeatability. If the cow is fed the same ration every day, milked the same time, given the same amount of water, and preferably the same temperature is maintained, and there's no loud noise around, then the cow will give the maximum amount of milk, because it feels comfortable. As soon as any external factor appears, it will give less milk. The trick of robots is that they perform all the operations absolutely the same way.

A cow comes in, then it's given food. A manipulator arm is put under the cow. There's a teat cup. First, it's cleaned, then the first streaks are handled so that the hormonal process of milk release starts at the cow. These streams are analysed — whether a cow has any disease, whether it feels okay. In half a minute the milking process begins.

The hand takes the teat cups, brings them to the teats of the udder. Inside there is a heart rate monitor, which with a certain frequency turns on and off the negative pressure. And it starts to suck the milk.

There is a sensor that checks occupancy. When the milk supply falls, it means the cow has gone up. The teat cup is put away and a special solution is applied to the udder to “close” it. After milking, the milk channel remains open, and infection must not get into it. The iodine solution preserves it.

Nobody controls the robot, it lives its own life. It knows where the cups are, they're always in the same place. Then the computer vision works. The robot has a camera that receives a three-dimensional image of a high frequency. The algorithmic is searching in the picture, where the teats are.

All the pictures are in grayscale — there are no colors, just a spectrum from black to white. The camera shoots what is happening around 30 times a second with a fairly low resolution — 420 to 340. At the first stage, we simply made people mark the place where the udder teats are in the picture. First, they segmented the place where the whole teat was, then – where the lowest points were located.

We had to collect a lot of data — we took pictures of a few thousand cows. At first, convolutional networks were used for «heavy» images, but it's very difficult for convolutions to learn from them – you'd need a huge amount of data. Therefore, they were transferred to the standard detection on a flat image, they took PyTorch as a framework.

Development history

My parents were veterinarians, and for a long time they just worked on the collective farm. First, my father got an offer to become the Deputy Director of the enterprise, and then to head the enterprise in the neighbourhood, to develop it. In our family, there's a joke that the collective farmer is not a profession, but a state of mind. From March to October, the work begins at five in the morning and doesn't stop until nine in the evening. It's hard. Something is happening around the clock.

Agriculture is an ambiguous industry, and not to say that it is strongly monetary. I don't see myself working in agriculture. When my brother and I were visiting different enterprises in Europe and analyzing the robots, I always got surprised by their story about generations. It was especially funny when they said: «I've been managing this enterprise for 13 years after my father. We are growing very well. We had 60 cows, and then there were 70 of them. Progress!» When my father got the enterprise in the year 2000, there were 100 cows. Now there are 1500 of them, and everyone is in doubt, whether it is a sufficient growth.

I studied in one of the top physical schools in the Moscow region, in the Sergiev-Posad district, and I definitely should have become a techie. I really liked programming. The main languages in the physical school were Pascal and Delphi, and I knew a bit of C++. Now I don't understand how, but we managed to do a lot of interesting things with Pascal. In the ninth grade, the teacher told us: „I forbid you to play games in class unless you write them yourself.“ And we wrote a few in a year. First we made our own „Snake“, then „Panzers“. Moreover, you could play in multiplayer mode.

Before I entered the university, I had written several olympiads: MIPT, BMSTU. I could study anywhere, I only had to choose. I opened the lists of all the majors of the universities, read them, and I got incredibly bored. I didn't want to do any fundamental things, I wanted something more practice-oriented. The choice gradually fell on Baumanka, instead of MIPT or MSU.

Robotics seemed like a perfect combination, when you create something physical, but you can write a code and see how it works in the real world. Unfortunately, we have a rather weak education in robotics. It doesn't work at the system level. When they give you a list of references, no book dates back to the 21st century, it's very demotivating. We were taught to design, to do the tasks on theoretical mechanics and resistance of materials. And we had to learn the real robotics by ourselves.

When we were doing our graduate theses, I decided that writing a regular one is boring, and I had to choose something that I could use later. At this point in our last year, we started our project. After the defense had even gathered a small team of friends. Someone was engaged in circuit design, someone in programming. We made a team according to our majors and started making the first version.

Inspired by the ideas from the books, we decided we should definetely rent a house somewhere outside of Moscow and live and work there all summer. That was a terrible idea! Six guys who live in the same place, not very good at watching what's happening around, but working really a lot.

It was a hotbed… of everything at once. I remember a funny moment when the vape was gaining popularity. You open the room, where two developers are sitting, and you can't see anything, just nothing! You come in and think „Are there any people here?“

That summer we made the very first sketches of the manipulator. We made some first details — we just collected the drawings and ordered them on production. Of course, we made a million mistakes — we used to have very inexperienced designers. Now we have found a great specialist in robotics, and started moving from a garage initiative group to a company whose product meets industrial standards and modern requirements of robotics.

Inside the project, we do even very low-level things on our own, because everything has its own specifics, and the existing products are not suitable for us. In order to milk the cow, we cann't use the existing standard industrial 6-degree manipulators. They are redundant for our design and very expensive. We now have four degrees of freedom. And it is ten times cheaper than any industrial manipulator.

We write all the circuitry with a low-level programming, all microprocessors, all construction and software part. We don't produce sensors, motors and things like that.

Robots for feeding, carousels and rations are on machine learning

When we started diving deeper, we realized that one robot for milking cannot cpver all the farm needs. Therefore, we added two more products.


When they give feed to the cows on the farm, the cows eat through the headholder — they pop their heads in to where their feed is scattered. But due to their physiology, they constantly push it away and can't reach it eventually, because the headholder limits their movements. It turns out they have a meter of food. They eat 30-40 cm, and another 60 cm are out of reach.

Usually there's a person walking with a snow shovel and moving everything backwards. But a person tends to forget, be lazy, do badly. A cow at this point begins to eat less, which is bad. That's why they came up with this type of robot.

But again, most of them were created in Europe. There, they are designed to work all in one yard or in one room. In large enterprises, there are many courtyards, usually three to five large farms standing next to each other, united in different ways. The feedpusher, like a vacuum cleaner, follows along its trajectory and goes back to the charging station.

For this to be cost effective, one robot must serve several yards. It's also expensive and difficult to invent and introduce special feeders. First of all, it's expensive to re-equip the farm, because you'd have to do major repairs. Secondly, the courtyards need a lot of free space, at least for a tractor to drive. Therefore, a robot is a simple and seamless solution.

Robotization of carousels

There are special milking halls, usually they are called carousels. This is a huge roter with twenty to forty cows. It slowly rotates, and there are operators in a circle. First, they clean the udder, put on and remove the devices. But they do it quite slowly, and the carousel is often idle.

It's impossible to completely replace these carousels with the robotic ones now — it's very expensive. We make manipulators that can be installed on any type of carousel, and this will accelerate it very much, approximately by thirty percent. Already with this acceleration, you can greatly increase the livestock and the number of cows on the farm.

The diet study

Nowadays, they are trying to feed the cows according to the theory of balancing. Every cow needs a certain amount of nutrients, kilojoules of energy, protein and fat per liter of milk. But the characteristics of each cow are absolutely not taken into account. It's like feeding every man, like a middle-aged man, six feet tall, like everyone has the same metabolism.

We make a system that analyzes how the cow reacted to different components, how much milk it gave and what was the quality. Based on this, we select the current correct diet for all components.

We just take the maximum amount of input data on how the cows were fed before, what energy values each of the components had. We try to build a diet not for the maximum milk yield, but for the maximum profitability of the enterprise. Each component has its own cost, plus we know how much a liter costs, and we want to find a balance when a cow gives a lot of milk, but its cost is quite low.

A cow gives up to 13 thousand liters of milk per year. But at such a milk yield, a liter would cost, for example, 25 rubles. If you make a diet for eight and a half thousand liters, the cost can be about 12 rubles, and the marginality is much higher than in the version with the maximization of milk yield. A model is needed to find balance.

But there are limitations in testing that are easy to ignore. The components cannot be removed or added quickly for the cows, because they produce enzymes in the stomach that are responsible for the decomposition of wheat, for example. And the new components won't be digested first if you introduce them sharply. By the way, it works the same way for a person. When we eat the same food, we digest it very well.

Investments and the attitude of the state

At that time, I had my own money. First we lived on it. These were very dark times. Sometimes it was impossible to pay any salaries at all. One guy had a car loan, and I gave him 12 thousand at the beginning of every month, so that he culd pay the bank. Then we managed to attract money, we became the finalists of Statrtup Village in Skolkovo, it became easier.

At the same time we became residents in Skolkovo, because I tried to pay a white salary. Skolkovo gave tax preferences for this, plus we hoped to get grants. But there is a kind of gap. To get a grant for the first product in Skolkovo, the product must already have money. How to overcome it when you have no money, only a desire to create — it's not clear.

Now, I think we have at least another six months until we start selling robots and it all turns into a working business. The term is tied to the specifics of working with iron. It has a long production cycle, testing, certification. But now we know all the major agricultural holdings, all the heads of these agricultural holdings, and we keep in touch with all of them. I hope there won't be any serious problems.

Of course everyone is a bit conservative. But in this case, you'd better show instead of tell. Therefore, we are making the first courtyard in our place, so that we could take someone by the hand and show it all — this is a robot, this is how it milks, this is its economy.

We believe there are many prerequisites to join our project. The first is the government support. Robots are subsidized, they have leases, there's a bunch of tax preferences. The government supports the transition to robotic agriculture. There are programs for which the state does almost everything, so that you could buy robots.

The problem is that people don't want to live in the villages. The village is not a perfect place to live, it is impossible to build a normal infrastructure there. Robotics is the way out.

Of course, when there are 20 robots in the company, the specialists are needed for maintainance. Robotization doesn't remove jobs, it increases the efficiency of the enterprise. Usually instead of the employees who were engaged in milking, there are those who interact with robots. We have chosen several good agricultural colleges, where we want to open departments, they will teach people to handle robots. It means that we will sell the robots and create jobs for people at the same time.

My parents are the biggest skeptics of all and the biggest support at the same time. Before, whenever they asked me what I was doing, it was all meetings and more meetings — working in business is strange, it really consists only of meetings. At first, they were making fun of it. But the meetings were getting more and more serious. The people that we met were getting cooler and more serious. And gradually the skepticism has gone. There was only confidence that everything would turn out well.
Total votes 26: ↑25 and ↓1 +24
Comments 4
Comments Comments 4