| The color sorter was a modern agricultural products processing equipment which used to sort material of different colors. In view of the existing color sorter’s shortage, which includes inability on image processing, poor expansibility and debugging capability, a color sorter controlling system based on DSP was designed in this paper.Firstly, according to the analysis of whole controlling system, this controlling system was consisted of four subsystems: image acquisition subsystem, which implements image acquisition and transmission; test subsystem, which implements the primary test and parameter settings; sorting executing subsystem, which implements material selecting; image processing subsystem, which implements image processing.Secondly, in order to meet the requirement of transmission between image acquisition subsystem and image processing system, an XINTF and FIFO interface was designed; in order to meet the requirement of massive transmission in image subsystem and test subsystem, an CAN bus interface was designed, according to the CAN bus characteristic of high transmission speed and strong node extensibility; in order to meet the requirement of the sorting signal transmission between image processing subsystem and sorting executing subsystem, an hardware interface based on RS485 was designed; in the image segmentation, threshold value division, chunking recognition way, a color threshold matching algorithm was developed whose threshold was adjustable and channel was optional, thus, the complexity of image processing was simplified. Meanwhile, the image processing algorithm was realized on DSP and the speed of image processing was improved. On the basis of the CANOpen protocol, by redefining the arbitration field and data field function, a CAN bus communication protocol was designed which implements the image and sorting parameter transmission in the test. Based on the ModBus protocol, a RS485 communication protocol was designed whose sorting instruction was interactive, and image data was read in the DMA way. Finally, the accuracy of DMA image data reading was verified by simulation. The feasibility of DSP’s pipelining was verified by the time-consuming calculating in the image transmission and processing. The image processing algorithm’s sensitivity and accuracy was verified simply on the sample image, and the processing speed and processing accuracy of the system was also tested.In this paper, benefit from the DSP, system’s image processing capacity was greatly improved. A testing subsystem improved the ability of debugging. A flexible algorithm improved system’s scalability. In the test, data reading and processing was accurate, and the whole system was stable and reliable to meet the image recognition requirement. |