Quality Kegs
Winn Hardin, Contributing Editor
Mini-kegs of beer are small enough to sit in a regular refrigerator and come with their own gas supply. First and foremost, the tap installed on the top of the mini-keg must be closed and locked with a locking lever. Otherwise, the beer can spill out of the keg, trashing not only that product but the cardboard containers of all the nearby mini-kegs on the shipping pallet. This challenge is one of the top reasons why bottlers adapt machine vision to check the quality of their products. It allows high-speed inspection of bottle caps and labels that are more difficult to check because they are on a highly reflective curved surface—the beer bottle.
A major US beer manufacturer asked machine-vision specialist Aptúra Machine Vision Solutions to develop a system that could image the full 360° of the mini-keg’s circumference and perform eight checks of the label and tap (see Fig. 1). Aptúra president David Dechow determined that accurate inspections would require a new unwrapping method to inspect the cylindrical bottle. He reviewed the plant layout and found that the best solution would be to create a system that could do all the inspections at the end of the bottling line. The final system used five Point Grey Research Flea FireWire cameras, feeding a powerful quad-core PC running OmniView Cylindrical Product Inspection software from Cognex to unwrap the round mini-kegs, eliminate parallax, flatten the 3-D object into a spatially correct 2-D image, and check each mini-keg for multiple defects.
Centralized inspection station
“You could argue against a centralized inspection station at the end of the bottling line, but there wasn’t the real estate available to do that,” relates Dechow. The bottling line processes two different beers, so the final solution needed to check not only for the right label on the right mini-keg bottle and protect against label skew or wrinkles but also ensure that the tap is present and in the right orientation relative to the label; the locking mechanism is in place; and the tap had the appropriate brand on it as well as the label.
“What really makes this system different is the 3-D modeling of the cylindrical bottle,” explains Dechow. “You can’t simple place cameras at 90° intervals around the keg and stitch the pictures together. Parallax at the edges of the images distorts everything. To make good measurements of the label and other features, you need to have a spatially correct 360° picture of the outside of the keg. That’s the trick to this system.”
The mini-kegs emerge from a drying station after a washdown. Although the beer is bottled cold, the temperature of the packaged beer has to be increased to room temperature or the mini-kegs will sweat in their cardboard containers, degrading the packaging.
Mini-kegs approach the inspection station at a rate of two kegs every 3 s, giving Aptúra little time to complete the 3-D correction of the images that make up the bottle’s circumference and perform the multiple required inspections. Hardware and software needed to work in close concert with little room for error in order to satisfy the customer.
Beating the curve
Just before a keg reaches the stainless-steel enclosure that houses the multicamera inspection system, it passes a Banner Engineering photosensor. The photosensor and a nearby generic precision encoder are both wired directly to a Cognex 8602e PCI Express I/O card in the PC, which is located inside the stainless-steel enclosure below the inspection system. The photosensor tells the PC to start counting quadrature pulses from the encoder; when the appropriate number of pulses is reached, the keg is located as close to the center of the enclosure as possible.
The conveyor keeps the mini-kegs in a relatively repeatable spot at the center of the inspection enclosure, but it does not orient them in a single direction. It also cannot accommodate for changes in bottle shape caused by how much liquid is inside. “The bottles can change in diameter by as much as half an inch, depending on how much liquid is inside,” says Dechow.
Changes in orientation, location, and tilt of the bottle as it sits on the conveyor in the center of the enclosure mean that the machine-vision system needs to correct for these changes as it stitches the four images from cameras surrounding the keg as well as the parallax caused by the cylindrical kegs. OmniView software is designed for this specific task.
“OmniView works best when the object is symmetrical around a single axis, such as a cylinder,” Dechow said. “You have to accommodate for the curve and warp of the surface, and every bottle tilts a little to one direction or the other, making it closer to one camera than it is to another. You have to model the object in 3-D space and reconstruct it to get an accurate 2-D image of the outside of the cylinder for any meaningful inspection.”
Dechow said his understanding of the OmniView software is that the system uses algorithms such as edge detection and pattern matching to measure the distortions in an image and then correct for them. The biggest part of the process is calibration before the inspection, which, for four cameras, takes 19 steps to complete.
“OmniView can operate with a CAD drawing, or you can train it using a good product to create the golden part,” Dechow explains. “We used a mini-keg to train the system, but the calibration is the key. You have to take a dot calibration grid and present it to all four cameras in a variety of positions: flat, tilted to the right and left, forward and backward. Then you have to calibrate all four cameras to each other so that the OmniView program can not only correct for distortion but combine the four images of the cylinder’s circumference without creating artifacts or defects of its own. When it’s finished, the operator can select where the resulting image will begin, and the system will begin there every time. Then you can make relatively mundane linear measurements to check the label for skew, barcode, wrinkles, etc.”
Battle of bandwidths
While four cameras are placed around the beer keg, the fifth camera looks down on the keg, checking for tap presence, tap orientation, and various graphics used to brand the beer, verifying that the right tap is on the mini-keg (see Fig. 2). Aptúra chose Point Grey’s Flea FireWire cameras with Edmund Optics’ high-resolution fixed-focal-length lenses because they offered the requisite resolution to make the various measurements and offered the high bandwidth of FireWire. However, if he were to do it again, Dechow says he would go with Gigabit Ethernet cameras instead.
“First, we needed to make sure we had sufficient resolution so that when the OmniView software warps the image back into a spatially correct image, that there is sufficient image data at the edges of each side-view image to be able to do the inspection routines we needed to do with the necessary accuracy,” Dechow says. “Secondly, we needed to make sure all the cameras triggered at the same time, otherwise, stitching the images together wasn’t going to be possible.”
Using 1394 adapter cards in the PC, Dechow said he had problems with bandwidth thanks to the high-resolution cameras, triggering, cable lengths—they all required special attention. “Using a dedicated GigE card, you can control four standalone GigE ports on a single PCI Express card, not take up any motherboard bandwidth, and have longer cable runs. Plus, addressing and bandwidth considerations are much easier.”
Aptúra’s designers decided to use the Cognex I/O card with discreet wiring to each camera as the trigger mechanism for the five cameras. In this way, Dechow could ensure that all the cameras would fire at the same time. “Triggering the cameras with software was going to introduce too much latency into the system, especially when you’re inspecting two bottles every three seconds,” he explains.
The illumination sources are on all the time, eliminating the need for timing and control signals to the lights; however, the reflective surfaces of the cylindrical mini-kegs required special lighting consideration. Aptúra chose a Spectrum Illumination 3-ft Monster dome light for the top of the system, fed by several Metaphase Technologies white-LED linear lights around the edge of the dome (see Fig. 3). The result is a diffuse, bright, even light that reduces shadows and hard reflections on the bottle in areas where inspections are performed.
FIGURE 3. The mini-keg inspection system uses four cameras positioned at 90° intervals inside the perimeter of the mini-keg inspection enclosure and a fifth camera mounted directly above the center of the enclosure. Eight linear white-LED arrays point outward at the Monster dome, providing uniform, diffuse light for inspecting the reflective plastic mini-kegs.
After OmniView’s 3-D modeling and correction, the inspection tasks for the mini-keg system are fairly routine. “We use pattern matching, a little blob analysis, and template analysis to check for presence/absence, position, and certain quality fiducials on the label. This is a fairly gross inspection. You could use the same approach for print quality inspection in pharmaceutical or printing, but you’d need more horsepower to get it all done for a fast process.”
If a mini-keg fails inspection, the PC sends a message to a downstream actuator that uses the same encoder count to push the defective keg on a rework conveyor. Today, the beer bottler only displays pass/fail counts on the workstation; however, there are discussions about connecting the data to the plant’s HMI system.
Company Info
Aptúra Machine VisionSolutions
Williamston, MI, USA
www.aptura.com
Banner Engineering
Minneapolis, MN, USA
www.bannerengineering.com
Cognex
Natick, MA, USA
www.cognex.com
Edmund Optics
Barrington, NJ, USA
www.edmundoptics.com
Metaphase Technologies
Bensalem, PA, USA
www.metaphase-tech.com
Point Grey Research
Richmond, BC, Canada
www.ptgrey.com
Spectrum Illumination
Montague, MI, USA
www.spectrumillumination.com
Vision Systems Articles Archives