| Detection is one of the most important parts in pharmaceutical production. Especiallywith the automation of the production process continuing to improve, it is hard to meet therequirement of medical field by relying on artificial detection,and is harmful to thedevelopment of companies. For detection,photoelectric sensor is used. But this method canonly find out short shipped,and can not detect the drug defect, the surface impurities andother details. Therefore photoelectric sensor is not the right way. Another way is weighing,which means to weigh drug to distinguish qualified products in some index, butmisjudgment will be make easily when there is disturbance, and tiny impurities and lobesof the drug can’t be detect, so this method uses in small area.At the beginning, select the structure of machine vision inspection system, based ondigital picture processing, and analysis the algorithm of medicine image processing,especially when there is logo of a company on the drug. The key point is improving thegradient edge detection algorithm. Competed with the high requirement on environment ofHALCON and the drawbacks of traditional PLC, soft PLC (PC-based PLC and motioncontrol), which is used as a development platform, can take full use of the computer openarchitecture, rich instruction set and control module, more efficient data processing andnetwork communication capabilities.Finally, setting up an interface HMI, based on visualization software C++, contributesto management operations. Besides realize real-time detection for the system by usingsimulation function of Twin CAT and HALCON, and verify the validity of the controlstrategy. By analyzing the pharmaceutical production’s data in a long time, it can be easilyfound that detection efficiency increases by36.4%, detection accuracy improves greatly,and the cost reduces significantly, by the way using detection equipment designed in thissubject. So it can replace the existing artificial detection. The detection device can also beextended to other industry which needs surface quality testing, and has important practicalvalue and practical significance. |