Design and development of intelligent citrus grading system

. In order to reduce the production cost of small-scale farms in China and improve work efficiency, an intelligent grading system for citrus grading was designed. The system combines the synchronous belt with the fruit pallet to realize the rotation and turnover function of Citrus in the conveying process. The control system scheme of the grading system is introduced in detail. Programmable Logic Controller (PLC) is used as the control core and NVIDIA Jetson tx2 (TX2) is used as the visual core. Finally, a small intelligent grading equipment integrating the functions of loading sequencing, transportation identification and grading unloading is built.


Introduction
With the increasing demand for high-quality fruits, fruit grading becomes increasingly important.In terms of the current development of Chinese fruit planting industry, the miniaturized farms and family farmers of citrus planting industry still account for the majority [1] , with small output, small scale and lack of automation equipment.With the development of sensor, computer, visual processing and other technologies, the combination of fruit grading and various detection technologies is growing, and the research is relatively mature [2][3][4][5][6][7][8] .At home and abroad, there are relatively large sorting machines for fruit grading [9] , and there are also large fruit sorting machines based on visual detection technology that have been put into commercial application and achieved high economic benefits.Due to the price and volume factors, the popularity of visual detection and sorting system with PC as the core is still uncommon in China.
According to the production mode of small-scale farmers, based on the requirements of low cost, light and simplification, this paper proposes an intelligent citrus grading equipment, which can automatically feed, transport and enter the fruit pallet one after another.According to the image analysis results, it can realize automatic sorting and efficient nondestructive testing of fruits.Compared with the traditional fruit sorter, the grading system designed in this paper has the following advantages: (1) The fruit pallet can rotate and flip, and can collect fruit images from multiple angles, which can be combined with the cylinder in the unloading area to realize flexible unloading and accurate grading.
(2) The combination of synchronous belt and slide rail drives the directional movement of pallet, and the conveying is more stable.
It can not only greatly improve the economic benefits of fruit farmers, but also promote the development of fruit commercialization and Intelligent Grading industry in China.

Overall design of citrus grading system
The citrus grading system includes a feeding device, a conveying device, a grading execution device, a pallet mechanism, a control device and an image recognition device, as shown in figure 1.
The working process is shown in figure 2. The unsorted citrus first enters the fruit box in the feeding area.Then, under the driving and distancing action of the small conveyor belt, it enters the fruit pallet in order.The pallet mechanism moves stably along the annular guide rail driven by the synchronous belt, and passes through the image recognition area to complete the image acquisition.After that, the image information will be sent to the image processing system.The image processing system will grade according to the Fruit Appearance grading standard, and then obtain the grade information of citrus and transmit it to the control system.After that, the control system will send a signal to make the citrus unload in the corresponding grade area, and finally realize the accurate grading of citrus, with a working efficiency of 0.3 ~ 0.5t/h.

Structural design of each module 3.1 Feeding device
Combined with the size and characteristics of oranges, this paper designs an automatic feeding device, which combines the fruit box with a small conveyor belt.Small baffles with a height of 20mm are evenly distributed on both belts.Conveyor belt 1 can alienate oranges, and conveyor belt 2 pairs of oranges are sorted individually in turn, as shown in figure 3.At the end of the conveyor belt, a flexible funnel is designed to ensure that the citrus can fall onto the pallet mechanism accurately and undamaged.If the larger citrus diameter is 90mm and the radius is 45mm, the funnel outlet radius is required to be 50mm.
The power element of this link device adopts single-phase motor, which starts and stops under the control of relay, and is equipped with speed regulating box with adjustable speed.Two photoelectric sensors are installed at different positions on the two conveyor belts.

Conveying device
The conveying device of the citrus grading system combines the synchronous belt, annular guide rail and pallet mechanism.Driven by the synchronous belt, the pallet conveys the citrus from the outlet of the loading area to the detection area, and then to the grading execution area.The grading execution device unloads the citrus in the pallet.
In order to complete the whole conveying task, as shown in figure 4, the synchronous toothed belt is adopted, and small blocks evenly distributed on the outside of the synchronous belt are designed, which are inserted into the clamping groove of the sliding block to drive the sliding block to move on the annular guide rail, so as to transport the fruit pallet above the sliding block to different areas.

The basic structure of the pallet
The fruit pallet is an important part of the transport identification module.It is responsible for the smooth transport, rotation and turnover of citrus to ensure the accuracy and integrity of visual inspection.The design adopts the combination of aluminium alloy pallet and rotary support bearing, so that the pallet can rotate relative to the slider; The fruit pallet is connected with the sheet metal part above the slider through a hinge, so that the pallet can be turned relative to the slider.
As shown in figure 5 and figure 6, when the fruit pallet reaches the visual detection area, after the cameras on both sides of the conveyor belt collect the two side images of the fruit, the rotation mechanism acts and the rack moves forward, so that the rotation support bearing rotates, and then drives the pallet to rotate 90°, so that the camera collects images of multiple angles.After image acquisition, the rotary mechanism and pallet are reset.When the fruit reaches the grading unloading area, the jacking cylinder acts to turn the pallet over 55°, and the fruit then falls into the grading box.

Grading unloading device
The graded unloading module adopts a lifting cylinder, a fruit pallet and a grading box to form a graded unloading area.When the fruit reaches the grading unloading area, the jacking cylinder acts to turn the pallet 55°, as shown in figure 7, and the fruit then falls into the grading box.

The control system of citrus grading system 4.1 Introduction to control system
The control system mainly includes image acquisition system (depth camera, light source), image processor, Programmable Logic Controller (PLC), sensor, driving system (servo motor driver, solenoid valve) and electromechanical system (servo motor, single-phase motor and cylinder).
The overall scheme is shown in figure 8.The camera of the image acquisition system acquires the image information of the citrus in the pallet mechanism from multiple angles and all surfaces, and transmits the information to the image processing system; The image processing system processes and calculates the transit size and defect information of citrus, and communicates the grade data to PLC through serial port.At the same time, PLC, as the upper computer of the system, is responsible for sending visual inspection instructions to the image processor; PLC controls the servo driver through pulse signal and sends control signals to electromagnetic relay and solenoid valve through Input/output (I/O) port, so as to realize the hierarchical actions of servo motor, single-phase motor and cylinder.The image processor is NVIDIA Jetson tx2 (TX2), and the communication mode between PLC and TX2 is RS485 serial port.This design uses the two-wire wiring mode of RS485 which adopts half duplex differential transmission mode.The communication content is shown in table 1.The HMI (Human Machine Interface) adopts MT6071IP produced by Weinview, which is responsible for reporting the real-time working status of each module of the equipment and displaying the statistical classification results in real time, as shown in figure 9.When the equipment status is completely ready, it can start to work; After starting work, in case of lack of oranges, the alarm will be displayed on the display screen to remind the user to load the fruit in time.

Conclusion
An integrated citrus grading equipment is designed by combining synchronous belt with rotating pallet and integrating the functions of loading, conveying and grading unloading.Taking PLC as the control core and TX2 as the visual processing core, an intelligent citrus grading system based on visual detection is developed.Citrus can be graded according to the results of visual recognition.Users can flexibly adjust the grading system and control the grading process through the touch screen according to their needs, and the whole process does not need manual participation, realizing the intellectualization of grading.

Table 1 .
Communication content between PLC and TX2.