Imaging ensures medical pill quality

Dec. 1, 2002
Inspection system captures multiple images of pills of various sizes, shapes, and surface textures during production runs at high speeds.

Because of possible litigation, economic, and reputation consequences, pharmaceutical companies are going to great lengths to ensure the quality of their products. They grade even small cosmetic flaws as unacceptable. To make sure every manufactured pill, tablet, and capsule is in perfect condition when it enters its bottle or container, they are using automated vision systems built by special system integrators such as SV Research (Harrisburg, PA). In fact, each pill is closely examined at multiple angles.

FIGURE 1. Pill-inspection system is mounted on a horizontal base plate (left side) in the inspection system station. Pumps and other mechanical pill-handling equipment sit in the enclosed space below the base plate. Computers, electronics, and power supplies fill the electronics rack (right side). Gull-wing doors (shown open) are closed to control particulate contamination and to keep extraneous light from interfering with the vision system.
Click here to enlarge image

SV Research faced several challenges when designing the vision system for the required pill-inspection station being used by Eli Lilly (Indianapolis, IN), Merck & Co. (Whitehouse Station, NJ), Glaxo-Smith-Kline (Research Triangle Park, NC), and other major pharmaceutical companies (see Fig. 1). The pills are delivered from the drug manufacturers' production line to the inspection station at high speeds; there are several pill variations (different sizes, shapes, and surface compositions); and each pill has its top, bottom, and four side surfaces imaged. "This particular station runs at speeds up to 3000 tablets per minute," explains Ron Lawson, president of SV Research, "and it uses up to six cameras, inspects every surface of each tablet, and rejects and accepts tablets on an individual basis with reject verification."

SV Research developed the machine in conjunction with pharmaceutical-equipment company Seidenader (Markt Schwaben, Germany). Seidenader developed the mechanicals for pill handling, whereas SV Research developed the machine-vision system that does the inspections. The overall system is designed to handle tablets or capsules, both commonly called pills by the vendor.

System operation

The inspection machine's working surface, called the base plate, carries all of the mechanical components that come in contact with the pills. Vacuum and pressurized air pumps, as well as electric motors to drive the pill-handling equipment, are mounted in the enclosed space under the base plate. An electrical cabinet at the right of the base plate houses the power supplies and computers for system control and image processing. During operation, large gull-wing doors fold down to keep out dust and contamination. "These doors are made of tinted lexan to keep outside light away to improve the inspection quality," Lawson adds.

FIGURE 2. Pills under inspection drop through a chute at the top of the electronics rack and into a cylindrical input hopper. An orienting mechanism carries them from the hopper to the first star wheel one pill at a time. Two star-wheel mechanisms carry the individual pills past as many as six camera modules for inspection imaging. Then, depending on the image-processing inspection results for each pill, a sorter mechanism air-ejects them into as many as three output chutes.
Click here to enlarge image

The inspection system includes a mechanical handling station along an automated production line that works on a batch process (see Fig. 2). Pills under inspection (PUIs) enter through an input hopper. They drop through a chute at the top of the electronics cabinet into a large, circular, stainless-steel hopper at the right side of the base plate. The pills exit the hopper one at a time, traveling down a spiral ramp below the hopper. At the bottom of the ramp, vacuum nozzles around the rim of two star wheels capture the pills and hold them tightly against the wheels' circumferences (see Fig. 3). The star wheels carry the PUIs past the camera modules one at a time. Each camera module uses a reflectance sensor, light-emitting diode (LED) illumination, and optics to take images of the PUI from several angles.

FIGURE 3. To handle capsules, the inspection system uses two star wheels with capsule-shaped indentations (top and bottom). Vacuum nozzles hold the tablets to be inspected against the circumference of the wheels. Using vacuum and air puffs, the system controls the movement of tablets onto or off of the star wheels. To determine which end of each capsule is up, the system uses a capsule-orientation sensor to help set the LED illumination for the rectangular camera modules (top right).
Click here to enlarge image

Of course, the camera cannot inspect the side of the PUI held against a star wheel. System engineers solved this problem by using two star wheels that nearly touch each other at one point. By carefully spacing the two wheels and synchronizing the wheels' rotations and vacuum nozzles, the handling scheme enables one wheel to hand the pill off to the other wheel. Initially, a vacuum holds the PUI to be handed off against the first star-wheel rim. When the pill reaches the hand-off point, it finds itself aligned with a nozzle on the other star wheel. The system pulls vacuum through the nozzle on the second wheel and, after a short time delay, cuts off the vacuum to the nozzle holding the PUI to the first wheel. This operation allows the pill to pass from the first wheel to the second wheel. A short time delay ensures that the second wheel's nozzle is ready to grip the PUI before the first nozzle lets go.


The inspection system can separate pills into three categories. One category is pills that pass the inspection and continue on through the process. Process engineers can choose to lump all the rejected pills together or they can separate them further into, for example, cosmetic defects versus serious defects.

FIGURE 4. Inspection system consists of two Pentium III computers for image acquisition and analysis, six camera modules, a frame grabber, and a reflectance sensor to help set the illumination levels in the camera modules. It also uses an Allen-Bradley PLC for interfacing with the tablet-handling machine.
Click here to enlarge image


After clearing all of the inspection stations, the PUIs riding on the second star wheel travel past three exit chutes. The particular chute into which each PUI drops depends on how the vision-inspection system classifies the pill (see Fig. 4). For example, consider that rejected products are dropped into chute 1, where they are collected for discard, and good products are dropped into chute 2. Furthermore, assume that the PUIs held by vacuum nozzles 3 to 12 are all good, but the PUI on nozzle 13 has serious defects. As nozzles 3 to 12 individually rotate past the reject-product chute 1, the system maintains the vacuum and carries the products to the good chute 2. However, the system drops the defective PUI on nozzle 13 into reject chute 1. This method ensures that only good products approach chute 2. Sensors verify that all rejects are removed from the pill transfer station at reject chute 1 before reaching good chute 2.


Illumination for pill inspection is critical. The SV Research system uses pulsed LED illumination with controlled intensity, which allows the system to select an illumination level that is appropriate for the application.

Take, for example, the situation in which capsules having a dark end and a light end must be inspected. There is no way for the handling system to determine which end of the capsule will be up when it reaches the first star wheel. Whether the dark end or the light end is up for any given capsule is entirely random. This orientation, however, makes a marked difference to the vision system.

The vision system looks at the capsules from six different directions, two of them being axial views from the top and bottom. The illumination level for viewing a dark end must be much higher than when the pill end is light. To solve this problem, SV Research engineers incorporated a sensor that determines whether the capsule's dark end is up or down before the PUI reaches the first camera module. It does so by measuring the PUI reflectance when seen from above. This information goes directly to the system programmable logic controller, which uses it to set the illumination levels for the different camera modules.

The camera modules can take one or two views, depending on the product being inspected. Typically, two views are needed for capsules. Therefore, the camera module simultaneously takes two images of the capsule separated by a 90° angle. After the capsule passes to the second star wheel, another camera module would take two more images at 90°. Together these two inspections would provide images of the capsule every 90° around its circumference for four sideway views.

When inspecting tablets, on the other hand, process engineers typically try to get a straight-on shot looking at the tablet's exposed face on each star wheel, as opposed to two 90° views. In this case, each camera module looks at a single point of view. The engineers also need to get a top and bottom views, which they accomplish with a single two-view camera module.

FIGURE 5. Different views of tablet defects (top) show a contamination spot (far left), surface delamination or "capping" (middle left and middle right), and a blister (far right). Different views of capsule defects (bottom) show a contamination spot (left), an indentation or dimple that might be cosmetic or might indicate a possible puncture (center), and a split (right). The lines show where the system is measuring various dimensions of the capsule.
Click here to enlarge image


In some inspections, defects found on tablets and capsules indicate a problem with the product itself (see Fig. 5). Other defects, such as marks on a tablet, could indicate a contamination problem in the manufacturing process. Drug manufacturers want not only to reject defective tablets and capsules, but also to identify the cause of the problem to prevent its recurrence.

Different types of defects in tablets can indicate a problem in the forming process. For example, a tablet is coming apart or its surface is coming off may indicate that it is not pressed together tightly enough. This defect may cause a tablet that's supposed to dissolve over a ten-hour time period to dissolve in just one hour and release all of its active ingredients at once. In that case, it would not provide the prescribed result and could harm the patient.

Drug manufacturers primarily inspect capsules for breakage. If the capsule is broken, punctured, or torn, its ingredients could leak out. Leaking pharmaceutical products may also be harmful to shipping and handling personnel. Other defects include having a capsule assembled with two tops or two bottoms instead of a top and a bottom, or two tops and one bottom, and so forth.

The image processor that recognizes these defects stores a software library containing all of the required algorithms, such as pattern matching, surface analysis, and texture analysis. To configure the inspection system, the process engineer selects algorithms from the library or from a pull-down menu of filters and attributes. No programs need to be written. To set up the system for a given inspection setup, the process engineer selects the region of interest and then the properties to be inspected.

The software library contains vision configurations for different capsules and for tablets of various shapes. To set up for a new product, the engineer can start with the configuration file for inspecting a similar type product, then reposition, resize, and reshape the inspection areas and add or subtract areas to develop a custom inspection program for the new product.

While the inspection system collects complete data on every tablet or capsule in the system, manufacturers do not normally save all the data. Typically, they want to report pass-fail data and often save the exact readings from failed units. If, for example, 1% of the tablets have black specks, the system could set up an alarm for an engineer to analyze the data and find out the actual size and location of the specks as part of the company's continuous process-improvement effort.

SV Research deliberately specified off-the-shelf components for all system elements. "We've looked at the reliability numbers for custom components typically available in the industry," Lawson points out, "and we looked at the reliability of standard industrial PCs. The industrial PC market shows much higher reliability than the typical company that builds 2000 custom boards a year."

The current inspection system runs on two 850-MHz Pentium III computers that are dedicated to image processing, a Quad-Viper frame grabber from Coreco Imaging (St. Laurent, QC, Canada), and commercial software. "Our current product runs in the Windows 2000 environment," Larson says. "The software that is actually doing the vision algorithms, such as the morphology functions and many of the underlying vision-processing algorithms, are not things we've written, but were obtained from licensed libraries." A typical camera used is the Sony XC55 1/3-in., interline-transfer, progressive-scan CCD from Sony Electronics (Park Ridge, NJ). It provides 646 × 485-pixel resolution, 500 TV lines, and a signal-to-noise ratio of 56 dB.

Upgradability is also a major design consideration. "We're on a standard hardware platform that will grow with the industry," Lawson says. "We don't want to redesign the hardware every three years." Using industry-standard components means taking advantage of technological developments at the best price and with the best reliability.

Voice Your Opinion

To join the conversation, and become an exclusive member of Vision Systems Design, create an account today!