Elektroda.com
Elektroda.com
X
Elektroda.com

DIY autonomous mower

Marico 5064 28
This content has been translated flag-pl » flag-en View the original version here.
  • DIY autonomous mower
    There are thousands of DIY mower projects online, this one probably doesn't stand out from the others, but since I haven't seen a similar project in this section for a long time, I decided to share my experience.
    This is the first prototype that verifies the basic assumptions in real life.

    The device during operation.




    The idea of building arose from the desire to automate the mowing process, but due to the difficulties in the shape of the terrain, the mowers advised by experts that would cope with this particular area were quite expensive. The second goal is the (at least assumed) savings (it will be cheaper) and above all, the fun of construction as an added value. The structure consists of as many modules as possible, which are widely available ready-made (housing, wheels/motors, motor controllers, cutting system, battery and its charging system, etc.), the only exception is a dedicated controller for the whole.

    Basic description of the structure.
    The drive system is built on 3 wheels, two drive wheels from scooters bought once for pennies, have a built-in drive system (bldc motor with Hall sensors), their advantage is high torque, easy adaptation to any construction and resistance to pollution by design. The third wheel is a 360° free turning furniture wheel. The cutting deck is the original engine from the Worx autonomous mower, a custom cutting disc with 3 knives from the Landroid mower (slightly enlarged than the original to increase the cutting diameter). Macalister case, i.e. a toolbox ;)

    Electronics.
    All 3 motors (wheels and cutting disc) driven by relatively cheap and popular Chinese bldc+Hall controllers, rotation controlled by voltage from digital potentiometers. Current consumption control for all motors on ready-made Acs712 modules, battery charging module on the universal CC/CV module, charging current control on ACS712. Wheel spin control taken from Hall sensor pulses.
    The border wire code receiver is an implementation of the system from the Google patent US8392044 with minor modifications. A little more about the border wire later in the description.
    The main controller is a dedicated board with pic32mx470. The board contains the necessary digital and analog IO for ADC (acs712) measurements and digital signals from other sensors, digital potentiometers for applying voltage to drive systems, Wifi MRF24G module for monitoring, remote update, etc., GPS module for rough control of the border of a given area.
    Mcu powered by a custom OS using the tcpip MLA stack and own drivers for the necessary peripherals. In addition, the OS has a LOGO-like control pseudocode interpreter (forward 10, turn right 90, etc.) with event handling (like "border wire detected" etc.). This allows faster development of the driving algorithm at the testing stage without the need to constantly flash the mcu. The code is uploaded via the built-in http server.
    Border wire generator based on pic10f222.
    The battery is a custom 4S package built from cell lion LG (bought for pennies) 10FX 10Ah + BMS.

    Border wire concept.
    The boundary wire (or wire) by giving the appropriate signal creates a virtual fence in which the mower is to move. In this way, the borders of the lawn, flowerbeds, islands, etc. are secured and in some cases the cable can even be used as a wire leading to the base / charging station. It is also worth mentioning that there are "wireless" solutions based on GPS supported by additional local correction increasing the precision of the position. Because this solution requires additional devices and is not very commonly used in commercial mowers (except for a few such as Ambrogio), I decided that my own solution would be based on a classic, proven cable.
    In the first concept, I tested a simple signal transmission (30kHz) with its receiver. The system was an implementation suggested on some guide on the web regarding the construction of the transceiver system of such a cable. Unfortunately, during quite intensive tests, this type of solution showed its quite significant disadvantages:

    - difficulty in accurately determining the distance from the wire. The wire is detected e.g. 20cm in front of it and 20cm behind it. Theoretically, you could
    combine with the sensitivity or transmit power to more precisely detect the moment of exceeding, but this leads to another disadvantage:
    - quite a significant dependence of the signal on weather conditions, moisture in the soil right after the rain changes the signal propagation conditions. What tunes in "dry" will run out wet
    - a problem with leading the cable to the islands in the middle of the lawn in such a way that it is not detectable by the mower. It would be necessary to bury it deeply, plus possibly twist it together with the return wire to degrade the signal



    The above disadvantages completely disqualified this type of solution. It was necessary to reach for a different concept, a bit more complicated, which not only does not have the disadvantages of the previous one, but also, thanks to the physics of the applied phenomenon, solves the problem of connecting cables to the islands. The solution is probably used in all mowers of this type. It is based roughly on the detection of a special code transmitted by the wire and checking whether the received signal is consistent with the expected pattern or inverted. Practically, in the simplest way, this is accomplished by transmitting a modulated signal, the so-called Manchester coding: the wire transmitter generates, for example, a 16-bit code that the mower knows. The position of the receiving coil along the plane of the wire (in front of or behind) determines the direction of the field lines generated by the wire and thus the direction of the currents generated in the receiving coil. And this, in turn, in manchester encoding determines whether the received code will be consistent with the expected pattern or inverted (i.e. all bits switched 1->0 0->1). This determines whether the mower is "inside" the wire loop area or "outside". The reversal of the code is very sharp and occurs just after passing the wire. A strong transmitting signal is not a problem, it's just that you know beforehand that you are approaching the wire, but until the signal reverses, the wire has not been crossed. For details of the implementation of the solution, please refer to the Google patent No. US8392044 where everything is described in detail along with the receiver diagram.
    Bringing the signal to the islandsinside the mowing area is not a problem anymore, it is enough to lay the "supply" wire to the island and the return wire close to each other in parallel (forming an omega shape), they do not have to be buried deeper. Wires laid close to each other in parallel only create a signal of the "inside" area, which will be ignored by the mower. Only spreading the wires to a minimum of 4-5 cm creates a detectable "outer" area.

    Other sensors supporting the movement of the mower.
    In addition to detecting permanent lawn boundaries, it would also be useful to detect unexpected obstacles. Trees, some objects left in the path of the mower, resting animals, etc. Originally, the main such sensor was to be an ultrasonic rangefinder. Unfortunately, the most popular cheap Chinese module HC-SR04 (its clone) turned out to be defective, in the open area it generates a false reflection from time to time as if there was an obstacle nearby. After googling, it turned out that this is some defect in the firmware of these sensors and most of the ones marked as hc-SR04 have it. I bought a slightly more expensive, branded one that does not have this defect, but it does not work well in the field. Placed 10-15cm above the ground (maximum height is limited by the housing), unfortunately sometimes it returns an echo of a nearby obstacle. I suspect the uneven arrangement of the grass causes such echoes. I tried to solve the problem by using more advanced read statistics to reject false positives. However, very narrow obstacles (a thin tree, a shovel left behind) will still be invisible to such a sensor. In tests, it turned out that a fairly effective obstacle sensor is the control of the current drawn by the wheels. This is currently the main obstacle detection method, and so far it is performing satisfactorily.
    Of course, if anyone here has a proven ultrasonic or IR sensor that is resistant to the sun, I will be happy to test it. Another interesting solution for detecting obstacles is, for example, a circumferential hose with a pressure sensor. A collision with an obstacle presses on the hose, in which the pressure measured by this sensor increases.

    Motor driving the cutting disc.
    I decided to use a ready-made solution here, there was no point in messing with a custom drive, since they are available at an affordable price. The choice was between two engines: with or without hall. Previously, I tested one without Hall, unfortunately the nature of the control of such a motor is a bit rough. The controller at start-up is a bit hesitant, he has to jerk the engine to orient himself in the position of the shaft (back EMF). In addition, there is some difficulty in stability at low rpm under load (commutation "knocks" audible). In this case, the cutting disc does not have to rotate quickly. Since my previous experience with Hall engines suggested that such a one is more precisely controlled in low speed ranges, I decided on one with Hall. The choice fell on the engine from the Worx mower model 50032554.

    Cutting disc.
    DIY autonomous mower

    The original cutting disc for this engine is a bit small and I want to mow wider, at least 20 cm (the original one is probably 14 cm). The engine has a large reserve of power, so it can handle more with ease. The disc is CNC cut from polycarbonate, 3 knives cutting every 120 degrees are oscillatingly screwed to it. Cutting height adjustment is achieved by selecting the appropriate extension between the blade and the mounting bracket on the motor axis (3D printed element). The cutting height changes very rarely, and actually only once, so unscrewing the 3 screws that fix the extension and the blade is not a problem.

    Mowing algorithm.
    Most cheap mowers drive randomly, bouncing off the boundary wire or obstacles, changing the angle of reflection so as not to lead to the effect of cornering. Then the mower can loop on a certain closed section, repeating it indefinitely. Some additionally detect local density of grass and can make an additional circle in such a place. Since such a mower drives practically non-stop during the season, there is a high probability that practically every place will be visited by the mower in no more than a noticeable increase, i.e. a few days. In my case, the terrain is quite complicated, it has islands, connectors, etc. That's why I divided it into 3 areas. Going all the way would be inefficient. It's better to focus on one more often because you'll finish it faster and then move on to the next. The whole thing should be completed in a maximum of 3 days. The mower is assisted by GPS in order to roughly mark these area boundaries.

    What's left to do.
    Shield cover. charging station. Station search algorithm, support with an additional cable leading to the station, docking. For now, there is no concept of charging contacts withstanding currents up to 5A. I'd love to hear ideas on how to do this.

    Problems encountered during testing so far.
    Phantom wire detection where there is none. It turns out that the rotating knives generate pulses detectable by the Manchester decoder, which from time to time coincide with a 16-bit pattern (we have only 65,000 combinations), i.e. its mirror image. This is not a major problem (the mower just changes direction). I plan to change the transmission frequency so that it does not coincide with the rotation of the shield and possibly change the code to 32-bit, which will definitely reduce the probability of randomly generating it by interference of this type.
    A free-turning wheel with an exposed steering bearing is not a good idea, I'm afraid of its quick blurring with clippings. Adding the planned cutting blade guard or replacing it with a shielded bearing wheel may help here.

    Cool? Ranking DIY
    Can you write similar article? Send message to me and you will get SD card 64GB.
    About Author
    Marico
    Level 20  
    Offline 
    Marico wrote 400 posts with rating 55, helped 28 times. Been with us since 2010 year.
  • #2
    bobojad
    Level 13  
    Hi. I like the design but the front wheel is probably only for dry days? It can add support for the rain sensor so that it does not mow wet and does not cover the mower with clippings. However, I am writing to give you a hint about the charging contacts. In the dirt you will get telescopic contacts from the trunk in the seicento, or from the sliding door in the citroen berlingo. These are quite strong contacts with a spring, a bit similar to brushes in a commutator, all you have to do is place large sheet metal fields on which the mower will drive with impetus and the contacts will give good contact, you can finish docking then with a limit switch too.
  • #3
    Marico
    Level 20  
    bobojad wrote:
    Hi. I like the design but the front wheel is probably only for dry days? It can add support for the rain sensor so that it does not mow wet and does not cover the mower with clippings.

    This wheel, of course, needs to be replaced, when it comes to weather, the mower receives weather data from the smart home system. It does not need to have a local sensor.

    bobojad wrote:
    However, I am writing to give you a hint about the charging contacts. In the dirt you will get telescopic contacts from the trunk in the seicento, or from the sliding door in the citroen berlingo. These are quite strong contacts with a spring, a bit similar to brushes in a commutator, all you have to do is place large sheet metal fields on which the mower will drive with impetus and the contacts will give good contact, you can finish docking then with a limit switch too.

    Oh thanks for the tip, that's an idea.
  • #4
    Shadowix
    Level 30  
    Marico wrote:
    What's left to do.
    Shield cover.

    This should be done first! DIY, diyem but safety above all. Also add a safety button in an accessible place on the housing. In addition, I also recommend installing a lift sensor - to turn off the knife in case of accidental lifting. For emergency shutdown (mushroom and lift sensor), the knife should also have a brake to stop as quickly as possible. I advise you to think about this very carefully, because fingers do not grow back. The docking station with contacts is very simply solved for the Stiga Autoclip mower.
  • #5
    Marico
    Level 20  
    Shadowix wrote:
    This should be done first! DIY, diyem but safety above all. Also add a safety button in an accessible place on the housing.

    I will provocatively comment that the shield is for proper mulching, not finger protection ;-) .
    As for the emergency stop button and the tilt sensor, it is implemented.
  • #6
    zgierzman
    Level 30  
    Marico wrote:
    I will provocatively comment that the shield is for proper mulching, not finger protection

    Attempting to lift the mower, for example if it is stuck on a bump, may result in nail damage :-)
    Similarly, when outsiders start watching it, for example, guests at a barbecue, when someone says: "what a cool gadget you made, hold my beer, I'll watch it".
    Not only a cover would be useful, but also an independent blockade of the knife drive when the mower is lifted and not with all wheels firmly on the ground.
    I'm also considering a polycarbonate dial. Knife mounting can develop over time, better bearings would be useful there. For example, some rigidly embedded sleeve that is the bearing of the knife. Do you have something like this?
  • #7
    Marico
    Level 20  
    zgierzman wrote:
    For example, some rigidly embedded sleeve that is the bearing of the knife. Do you have something like this?

    There is bushing. The knives do not touch the disc at all during the swing. This shield is rather temporary, although the polycarbonate here was chosen on purpose because it does not break as easily as "plexiglass".
    Perhaps I will replace with a genuine Worx dial.
  • #8
    szym86
    Level 11  
    Nice project, invaluable knowledge and DIY idea, but if I had to build something like this, thank you. Recently, I helped someone install a bosch indego 1200 mower bought used. Copying it is unprofitable. The housing itself, for example, is complex, protects against weather conditions, integrates obstacle sensors, a stop button, a display, a height adjustment mechanism, contacts connecting to the charging station, etc. As a rule, DIY mowers look like a toolbox.
  • #9
    szeryf3
    Level 26  
    @Marico, the design is great.
    You must have spent a lot of time doing it.
    If you ever could add a tiny photovoltaic panel, you would recharge the battery while mowing.
    I know that it would be an excess of form over substance, but you would be a bit pro-eco.
  • #10
    Marico
    Level 20  
    szym86 wrote:
    Copying it is unprofitable.

    You can argue with that. A factory mower that would cover the complex area mentioned in the description costs at least PLN 15,000. And experts say that it would probably have to be min. 2 pcs. In addition, there are land adjustment works, because in its current form (high lawn edges) it is not suitable for ready-made mowers (the boundary wire would have to be far from the edge and this would result in a wide unmowed strip). By building your own, it implements all the necessary functions.
  • #11
    szymon122
    Level 38  
    Everything is nice, but I miss the most important description, i.e. the "logic" of this mower.
    I understand that GPS gives a rough location, the boundary wire tells you where to go, but in the middle of the plot?
    It's like, "Go to the border, when you get there, turn at a random angle and go straight," and so on and on?
    Or do you have some terrain mapping and "painting over" the already mowed area?
  • #12
    Marico
    Level 20  
    szymon122 wrote:
    It's like, "Go to the border, when you get there, turn at a random angle and go straight," and so on and on?

    For now, yes. However, currently this angle is not random. He tries to "draw a snake laid on a plane". At the moment I am testing different algorithms, the target one is not yet chosen. Taking into account that the mower runs 24 hours a random algorithm will also work on a small area, this is due to the opinions of users of these "random" mowers (Worx, Landroid, cheaper models Ambrigio, Gardena).
    For now, GPS is used to divide the terrain into smaller areas to focus on them, after finishing (after the set time) it moves to the next area.
    I admit that the description of the logic is poor, but this is due to the fact that I have not yet drawn the final conclusions. I am also looking forward to the discussion/experience of others on this matter.

    szymon122 wrote:
    Or do you have some terrain mapping and "painting over" the already mowed area?

    I'm not doing that right now, maybe in the future.
  • #13
    Bogus105
    Level 16  
    I see that there are a lot of professionals here who know exactly what you did wrong or what you didn't do. The truth is you are the only one who did a great job and my sincere congratulations on your time and skills - both in DIY and (mainly!) in programming. I have had a mower for several years (Viking iMov MI632) and I can't imagine my life without it, even though there is a tractor in the garage. Just a waste of time. Your implementation is super interesting and it works. I liked the idea of making knives. I am thinking of modifying my arm so that trapezoidal blades from the so-called wallpaper knives can be used. I once came across a very interesting study on a self-learning algorithm that maps the mowed area. Such mowers do not have any sensors other than detecting the boundary wire and analyzing the number of steps sent to the stepper motors of the drive wheels. Mathematics has been the queen of the sciences for a long time :) If I know it on a PDF drive, I can drop it.
    Greetings!
  • #14
    kulfi27
    Level 9  
    Hi, a nice project probably cost a lot of time, I also work on a similar robot, except that I managed to buy a damaged gardena
    so I have the case and the motors, I made the electronics myself. I must admit that with such a project there are a lot of things to take care of, when it comes to the mowing area limiting system for the mower, I had no idea how to do it, the solution you used seems to be interesting, maybe I will also test it, at the moment I only have an external wire which " I'm sending" several hundred pulses at some given time, and as you wrote earlier, this is not an ideal solution. I'm constantly testing something and improving the code, my mowing algorithm is random so far, the area that mows is quite difficult, various nooks and crannies but I have to admit that it gives advice. It's nice that you shared this project, it will be possible to exchange experiences :D
  • #15
    398216 Usunięty
    Level 43  
    At what speed does the cutting disc rotate? Isn't it a little too slow? And the fact is - polycarbonate as a shield ... in my opinion, it's a request for trouble - some pebble and splinters of plexiglass (along with knives) will fly sideways at high speed. That is why (among other things) mowers have a steel shield around the disc/knives.
  • #16
    Marico
    Level 20  
    Polycarbonate is not "plexiglass", that's why it was used because it does not chip. It is virtually indestructible.
  • #17
    398216 Usunięty
    Level 43  
    Marico wrote:
    It is virtually indestructible.
    We will see...
  • #18
    Marico
    Level 20  
    kulfi27 wrote:
    so I have the case and the motors, I made the electronics myself.

    I also considered the option with a ready-made one (only replacing the electronics), but somehow I didn't find a particularly cheap corpse. And this square captivated me, so now I don't know if I will translate it into something more fashionable.
    And what are the engines (scythe, wheels) in this Gardena? Bldc or brush? How did you solve the early wire detection problem in your method? How long does Gardena mow on a single charge?
  • #19
    PRL
    Level 40  
    For me, it's a rolling box. It does not perform the main function, i.e. mowing.
  • #20
    Marico
    Level 20  
    And you said that based on appearance? :D
  • #21
    398216 Usunięty
    Level 43  
    PRL wrote:
    It does not perform the main function, i.e. mowing.

    I asked about turnover, but got no answer. On the other hand, a lecture on the strength of polycarbonate is the most.
  • #23
    Marico
    Level 20  
    I see that you need to realize what function these types of mowers are supposed to perform. All autonomous/robot mowers (those commonly available, not some for special applications) are not used to mow weeds and lawns that have been neglected for weeks. Because they drive every day only with breaks for charging and possible rain, their task is only to trim the daily growth, i.e. a maximum of 1-3mm per day. And that's just what they're for. Due to their regularity in operation, they do not need a 10 cm wide and 20 cm long scythe.
    For the same reason, they do not need a large number of revolutions of the blade disc, which they make up for in being closer to a razor than to the scythe blade of a classic mower. The blade of such a mower can be cut like a razor, I have experienced it many times.

    Such a mower, of course, will not cope with a neglected lawn like a petrol mower with a 3kW engine and a 10x30 scythe because it is not designed for this purpose. If for some reason (mower failure, lack of power) such a mower does not go to work for several days, you have to pull out the classic mower and prepare the lawn for the autonomous mower again (at least in most cases).

    My mower's cutting disc and blades are no different from any other on the market.
    Principle of operation and application as well.

    Added after 5 [minutes]:

    398216 Usunięty wrote:
    I asked about turnover, but got no answer. On the other hand, a lecture on the strength of polycarbonate is the most.


    I remember the question and I will answer how exactly I measure, by "eye" it is currently from the basket below 1000 rpm. There's no need for more.
  • #24
    kulfi27
    Level 9  
    Marico wrote:
    kulfi27 wrote:
    so I have the case and the motors, I made the electronics myself.

    I also considered the option with a ready-made one (only replacing the electronics), but somehow I didn't find a particularly cheap corpse. And this square captivated me, so now I don't know if I will translate it into something more fashionable.
    And what are the engines (scythe, wheels) in this Gardena? Bldc or brush? How did you solve the early wire detection problem in your method? How long does Gardena mow on a single charge?

    The motors in the garden are BLDC, when it comes to wire detection, as I wrote earlier, it's not perfect, I hope so far, it gives a given number of impulses at a certain time, then I take a break, when the work reads a given amount, it travels a given distance, for now it only uses the front sensor I have the rear one is also prepared but no time for further work, on average it mows 2 hours on the battery in the months of really strong grass growth and I have a very dense lawn in the summer season even up to 3 hours gives advice, I reworked the original batteries and installed stronger cells. In the gardeny or Husqvarna documentation, I found that the mowing speed in their models is about 2800 rpm per minute, so I also set this speed and it's ok.
  • #25
    kotbury
    Gantry automation specialist
    I have a deep Chinese mower NAC MEX, run like clockwork (after a slight tuning like turning off the hole detectors in the front wheels and making twins on the driving wheels).
    Quote:
    Of course, if anyone here has a proven ultrasonic or IR sensor that is resistant to the sun, I will be happy to test it. Another interesting solution for detecting obstacles is, for example, a circumferential hose with a pressure sensor. A collision with an obstacle presses on the hose, in which the pressure measured by this sensor increases.

    Looking at it - obstacle detectors in the form of advanced electronics, as the author wrote - are a bit off the mark. My mower (as well as most of the older and more expensive brothers) has mechanical obstacle sensors - I mean the sensors themselves are hall effect, but the obstacles are detected by the outer casing itself - spring-mounted with four vertical springs to the proper casing. When hitting an obstacle, the housing with magnets bends on springs in one direction and activates the appropriate hall sensor.
    But the fact - doing something like that amateur would be difficult.
    And as for tracking - the base in my copy does not use any complicated algorithms (checked with a signal analyzer) but gives a rectangular 7.4 kHz signal with a large power of 250 mW. and it works somehow. The precision is quite good, and it is increased by the fact that the mower slows down significantly when approaching the wire.
    P.S. The blade disc has 3000 rpm in my kettle, and it is also (meaning like wheels) on the BLDC motor, but sooner than for the sense - for the cost - the drivers of all the motors are identical, secondly - it is easier to detect a blocked knife in the BLDC motor (Hall effect sensors in motor plus an error signal from the controller) than to combine amperometrics in an ordinary brush one.
  • #26
    Marico
    Level 20  
    kulfi27 wrote:
    The motors in the gardenia are BLDC

    Did you build the controller for these motors yourself or did you use a ready-made one?
  • #27
    kulfi27
    Level 9  
    I made all the electronics myself as well as the driver for the motors, the brain of the whole thing is the STM32G474, there is still a lot of work ahead of me, mainly from the software side.
  • #28
    btsimonh
    Level 11  
    Check out bipropellant (https://github.com/bipropellant) as an open-source firmware for 'normal' hoverboard driver boards....
    It's a quick start to driving the wheels... and provides tilt sensors and button with the hoverboard sensors.
  • #29
    metalMANiu
    Level 20  
    I appreciate the project and the knowledge you managed to acquire. A little note about:
    Marico wrote:
    control of the current drawn by the wheels. This is currently the main obstacle detection method, and so far it is performing satisfactorily.

    You mentioned resting animals. Here, it would probably be more useful to control the current of the cutting system motor :)
    Well, unless we are talking about animals such as cows, etc