Area-scan and linescan cameras combine with automated conveyor system to inspect plastic lids for quality in food containers
Winn Hardin, Contributing Editor
Pro-Western Plastics manufactures food-quality plastic containers and lids for companies in the dairy and pet foods industries, among others. Since both food safety and appearance are important considerations, Pro-Western embosses each container lid with company-specific graphics on the top and tracking numbers and product identification on the underside. Until recently, these lids were inspected manually, but the company’s desire to maximize inspection efforts and increase overall production efficiency suggested that an automated solution was needed.
Pro-Western turned to automation provider Calaco Solutions to build an automated inspection machine for the plastic lids as they rolled off the plastic injection line. Calaco’s solution includes a Basler scout camera, as well as two DALSA Spyder GigE linescan cameras connected to a pair of laptop computers. An Automation Direct - Direct Logic PLC by Koyo controls discrete automation devices including six axes of motion control to manipulate the lids during the inspection routine before eventually stacking the “passed” lids and moving them onto an outfeed conveyor for final packaging and shipping to the customer (see Fig. 2).
A quick flip
At Pro-Western’s St. Albert facility in Alberta, Canada, plastic lids fall from an injection molding machine onto an outtake conveyor, which carries the plastic lids to the Calaco inspection machine. The lids are not oriented as they come out of the injection molding system; therefore the first task for Calaco is to determine whether the lids are facing right-side up or upside down and orient them accordingly for quality inspection.
The operator initiates the machine control system using the top (machine control; MC) laptop computer mounted to the side of the lid inspection machine. This laptop computer provides image processing for the Basler scout, which is used to help orient the lids for inspection, as well as the human machine interface (HMI) for the Koyo PLC, which controls all motion and conveyors for the inspection machine.
To begin inspecting lids, the operator selects the lid model on the MC laptop, which then sends the model-specific settings across the Gigabit Ethernet machine communication network to the PLC and second laptop. The image-processing software running on both laptops loads the relevant physical characteristics and inspection routines for the target lid, based on a “golden model” of one of nine lid models Pro-Western manufactures for its food containers.
Lids from the injection molding machine randomly fall onto an outtake conveyor underneath the molding machine. This conveyor transports the lids to the in-feed conveyor of the lid inspection system. Sometimes the lids are singulated, other times stacked or overlapped, and still other times grouped next to one another. As the lids reach the end of the in-feed conveyor, they slide down a stainless-steel chute (see Fig. 3).
FIGURE 3. One laptop controls the PLC HMI and performs 3-D analysis using the Basler scout area-array camera. The second laptop performs defect analysis based on images provided by the two DALSA Spyder linescan cameras.
The Basler scout camera is mounted directly above the chute, while an Edmund Optics laser line generator is mounted 45° off the optical axis shining down onto the lids in the chute. The scout camera continuously acquires images of the reflected laser light line. Images are fed at 10 frames/s via Gigabit Ethernet cable to the MC laptop running the image-processing software.
To cut down on processing requirements, Calaco Solutions’ president, Cameron Cormack, designed the image-processing algorithms using lowest deviation methods rather than vector-based or pixel-based search algorithms. The lowest deviation algorithm compares two stored mathematical representations of the laser line reflecting from the lid (one for right-side up, the other for upside down) against the image from the scout camera, after the image has been thresholded for binarization, to isolate the reflected laser line from the rest of the darkened image. The mathematical model includes both the size of the reflected laser line based on the particular model of lid selected by the operator when the system was initiated as well as the shape of the laser line, depending on whether the lid is right-side up or upside down.
Once the image-processing software finds a match that falls within preset maximum deviation, it assumes that a lid is ready for picking. The image-processing software running on the MC laptop sends location information back to the Koyo PLC via Gigabit Ethernet along with whether the lid is right-side up or upside down.
The PLC directs an Anaheim Automation stepper motor to move a PIAB Venturi-based vacuum gripper powered by compressed air lines over the center of the lid. The gripper drops down, grabs the lid, and moves it to a second conveyor running alongside the first conveyor, which feeds the singulated lids up to the first of two inspection stations: one inspection routine for each side of the lid.
If the lid was found to be right-side up, the PLC activates a solenoid located next to the second conveyor that flips a mechanical arm into position. The vacuum gripper drops the lid onto the mechanical arm with an awaiting vacuum gripper, and after a programmed time delay, the PLC triggers the solenoid to flip back, turning the lid over so that it sits upside down on the second conveyor.
If the lid was positioned correctly at the beginning, then the PLC does not trigger the “flipper” arm, and the lid falls directly down to the second conveyor. After all lids identified in the scout images have been moved to the second conveyor, the PLC triggers the in-feed conveyor to bring more lids to the orientation chute until the deviation algorithm finds more lids, at which time the process repeats itself.
OCR the linescan way
The lids continue up the second conveyor until they reach the end, where a photoeye tells the PLC to trigger a transfer arm, pushing the lids onto a third conveyor. This conveyor takes the lids to the top of the inspection machine. As the lid passes over a 1-in. gap between the third and fourth conveyor, the first DALSA Spyder 2k-pixel monochrome camera acquires an image of the underside of the lid, which is actually the top of the lid.
The line images are fed via Gigabit Ethernet to the IP laptop’s image-processing software, which uses conveyor speed information to group the lines into a complete image of the underside of the lid. This inspection station is tasked to find, read, and verify product-specific graphics on the top of the lid, as well as detect contaminants and check for any molding deficiencies.
All three cameras in the lid inspection machine are set to produce 8-bit pixel depth images to reduce the image-processing load and network traffic volumes. Because of this, plus light intensity changes from image to image introduced by the low-flicker fluorescent lights that illuminate the final two inspection stations, Calaco’s Cormack designed the image-processing software to use a linear regression method that thresholds the images in the final two inspection stations.
“Some people used fixed or floating binarization techniques, but we use linear regression,” explains Cormack. “We know in nature that objects have a smooth, natural linear flow, and when the object ends, it should have a sharp edge. Now, if the pixel intensities are too high or below the predicted regressed curve in the mathematical domain, we can determine whether it’s part of the lid or an imperfection. Through the use of pixel data regression, we are not confined to the notion of a threshold level” (see Fig. 4).
After each line is thresholded separately to eliminate variations in light intensity, the complete image is compiled and the Calaco image-processing software uses an OCR algorithm to find, check, and record the relevant embossed graphics. In addition, further tests are applied to the image to determine quality of the molding process and presence of contaminants. The system can be fully networked with both Gigabit Ethernet and 802.11 connectivity, but at present, the system stores all information locally on the MC laptop hard drive.
Finally, the image is folded in half, and then folded again, until the circular lid is 1/4 its original shape. Deviations between layers indicate that the lid is not round or uniform. If the lot/product codes are defective, the lid is out of round, or imperfections are detected, then the IP laptop sends a “fail” message to the PLC.
After the first inspection, the lid continues onto the fourth conveyor and passes over another gap between the fourth and final (fifth) conveyor. A photoeye sensor is located to the side of the gap to check the height of the lid. This is necessary because, as lids come off the plastic extrusion machine, they are still warm. When the pick-and-place arm grabs the lid to move it to the second conveyor, the applied pressure can push two stacked lids together, forming a temporary seal between the warm, soft lids. If the lid is too tall at the final inspection station, the PLC triggers an ejector arm that sends the lid into the defective bin. If the first inspection station failed the graphics embossed on the top of the lid or found the lid to be out of round or contain molding deficiencies, the ejector also disposes of the lid.
Finally, if the lid has passed previous inspection and does not break the photoeye beam indicating that more than one lid collocated on the conveyor, the final inspection station acquires an image of the bottom of the lid, which is oriented upward.
In the gap between the fourth and fifth conveyors rests a pneumatic-powered vertical lift actuator with vacuum gripper that lifts the lid 1 in. off the conveyor and rotates it a full 360°. Directly above the turning lift gripper is the second DALSA Spyder linescan camera, which acquires line-by-line images that are fed again into the IP laptop. The laptop compiles the complete image using speed information from the turning lift gripper, and an OCR and analysis algorithm searches for the appropriate embossed product and lot codes, as well as the usual physical inspection of the lid surfaces for defects and contaminants.
Not all of the nine lids Pro-Western manufactures for its food-grade containers are round. When inspecting margarine and sour cream lids—which can be square or rectangular—the turning lift gripper uses data from the second inspection station to determine the orientation of the lid on the gripper. The gripper is then rotated until the lid is correctly positioned for the stacker at the end of the lid inspection machine. The gripper drops, the vacuum is released, and the lid is shot into the stacker bin, where vibrations from the “shooting” of the lid help the lid to settle into a quality “stack” of lids.
Anaheim, CA, USA
Cumming, GA, USA
Basler Vision Components
Edmonton, AB, Canada
DALSA, Waterloo, ON, Canada
Edmund Optics, Barrington, NJ, USA
Koyo Corporation of USA
Westlake, OH, USA
Hingham, MA, USA
St. Albert, AB, Canada