Improvements to watering and weeding (detection, marking and mowing) sequences

I noticed some issues with the provided farmbot sequences and thought I would share some of my solutions to these. I’m sure there are issues I haven’t considered in this code so please let me know if you see anything which can be improved

Mowing weeds my.farm.bot/app/shared/sequence/165

Why: the original weed mowing is quite restrictive in collecting all standard weeds and mowing exclusively along the x-axis with a distance either side of the weed of ‘weed radius + 50’. This excludes a lot of potentially ‘mowable’ weeds from being accessible. I also had issues with stalling causing the entire sequence to fail as repeated attempts would often cause the bot to restart itself, making it difficult to know which weeds were actually mown.

What’s new: My sequence uses a variable for the weed or preferably weed group so you can be more selective with your mowing and iterates through each weed, marking them as removed as they are mown. The mowing path is calculated by computing the nearest plant to the weed, drawing a line between them and then cutting perpendicular to this line through the weed. In theory this allows it to mow much closer to plants without risking damage to them. Only 1 attempt is given for each weed to prevent excessive stalls

Updating plant radius my.farm.bot/app/shared/sequence/170

What: the weed detection grid appears to use plant radius to determine weed location rather than the spread curve. This matches the radius of plants with their corresponding spread curve (dividing this by 2)

Deleting weeds my.farm.bot/app/shared/sequence/168
Marking weeds my.farm.bot/app/shared/sequence/169

What: I was unable to get the ‘mark as..’ sequence working so I developed my own to mark weeds as active/removed and delete them when required. in the marking code, change ‘active’ to whatever state is required

watering my.farm.bot/app/shared/sequence/166

Why: original watering code had a tendency to drown plants or led to leggy seedlings due to water being too concentrated in one spot.

What’s new: By moving the tool head in a square around the plant, water is more evenly distributed. Using the water curve for each plant and assuming a max speed of 80mm/s and flow of 30mL/s, the bot will complete between 1 and 4 sides of the square. This keeps a maximum radius of 150mm to avoid missing the roots

4 Likes