Design of a Machine Vision-Based Automatic Digging Depth Control System for Garlic Combine Harvester

The digging depth is an important factor affecting the mechanized garlic harvesting quality. At present, the digging depth of the garlic combine harvester (GCH) is adjusted manually, which leads to disadvantages such as slow response, poor accuracy, and being very dependent on the operator’s experience. To solve this problem, this paper proposes a machine vision-based automatic digging depth control system for the original garlic digging device. The system uses the improved YOLOv5 algorithm to calculate the length of the garlic root at the front end of the clamping conveyor chain in real-time, and the calculation result is sent back to the system as feedback. Then, the STM32 microcontroller is used to control the digging depth by expanding and contracting the electric putter of the garlic digging device. The experimental results of the presented control system show that the detection time of the system is 30.4 ms, the average accuracy of detection is 99.1%, and the space occupied by the model deployment is 11.4 MB, which suits the design of the real-time detection of the system. Moreover, the length of the excavated garlic roots is shorter than that of the system before modification, which represents a lower energy consumption of the system and a lower rate of impurities in harvesting, and the modified system is automatically controlled, reducing the operator’s workload.