Global TMW:
Login  |  Register          Free Newsletter Subscription
Subscribe
Email
Print
Reprint
Learn RSS

Vision meets motion

Combining vision and motion expands the capabilities of inspection equipment.

Jon Titus, Contributing Technical Editor -- Test & Measurement World, 2/1/2005

 
An inspection system can do more than just passively record images as products progress down an assembly line. By combining a motion controller with your vision system, you can instruct your production equipment to take action based on a product's visual characteristics, thereby saving time and money while improving quality. For example, you could use a simple "motion controller" to trigger a solenoid or air jet to push defective devices into a reject bin, making error-prone culling of bad parts by hand unnecessary. The benefits extend from this simple example up the machine-vision spectrum to vision-guided robots that can position components and cameras for many types of inspection tasks.

Work safe

Read other articles from this issue:

Table of contents, February 2005
Economies of scale, Cover story
Test-system development:
   Do everything first

Vision meets motion
Simulate voice networks
Suppose engineers must inspect a machine tool such as a drill bit or an end mill that has many facets. "In that case, engineers could use a robot to reposition a camera so the inspection system can acquire as many images as necessary to inspect the tool," says John Agapakis, senior VP of marketing for RVSI Acuity CiMatrix. "That type of application is fairly basic, because you don't need to relate measurements in one image to those in another image. You just look for a surface defect."

Engineers can take advantage of an inspection system in which a vision system transmits detailed inspection results to a motion controller. "That type of tight coupling between motion and vision lets engineers identify a part, keep track of it, position it, orient it, and perhaps align it with pads on a PCB," says Rahul Kulkarni, product manager for industrial data acquisition and control at National Instruments. "Vision-guided motion requires a fast vision system that will synchronize image-analysis algorithms and a motion-control system in real time."


Calibrate your view

Getting from the push-pull action of a solenoid to more complicated motions involves careful calibration of vision systems and compatible communications between those systems and motion controllers. Consider a simple application in which engineers decide to move a camera a fixed distance across a long object to measure the distance between the centers of two holes (Figure 1). By combining the information in the images acquired at each end of the movement with the movement distance, the engineers can calculate the distance between centers.

Before this apparatus yields useful results, though, the engineers must calibrate the vision system. According to Kyle Voosen, product manager for machine vision at National Instruments, calibration requires more than assigning each pixel a measured dimension. "If you look at an image, you observe parallax errors, and as you move a camera toward or away from an object, you see perspective changes. Lenses also produce optical distortions such as fisheye and pin-cushion effects." In the center of an image, one pixel may equal 1 mm, but at the image edges, a pixel may represent 1.3 mm. Always ensure your pixel measurements represent real-world values, cautions Voosen.

 
Figure 1.  A movable camera can measure distances that require more than one image. This type of inspection system requires calibration to set a relationship between camera pixels and distances in images.

"A scaling factor that relates pixels to distances provides only part of the calibration information," says RVSI's Agapakis. "If a camera mount tilts slightly off the perpendicular, you see perspective errors, so rectangles look like trapezoids, and circles look like ellipses. Engineers must perform a complete camera calibration that takes perspective into account."

 
A Cartesian robotic arm includes an actuator that grasps metal disks and a camera that inspects six tapped and countersunk holes. The system includes a second camera partially hidden behind the vertical structure. Courtesy of Ikusmen Vision Artificial and Dinalot SA.
Vision-system suppliers offer standard target patterns of dots or lines that engineers use to calibrate visual measurements and correct for optical distortions. Algorithms that come with a vision system's suite of tools translate points in the target's image into information the system can use to correct for mounting, lens, and perspective errors. That information ensures a vision system will accurately measure a distance anywhere in a camera's field of view, even though lengths may appear unequal in an image. Keep in mind, though, that any movement of a camera or adjustment of its optics will require a new calibration.

"I've seen cameras mounted on a robot or frame with just one screw," says Perry Cornelius, an advanced systems consultant for machine vision and robotics at ABCO Automation. "When bumped, the camera pivoted slightly and someone had to recalibrate the system. Proper camera mounting sounds simple, and it's easy to overlook, but do it right and you have a robust and reliable system."

Vision problems aren't always obvious, either. "A customer told us a robot wouldn't pick up parts properly," says Cornelius. "We found an optical element in a camera lens had loosened. Most machine-vision lens suppliers offer industrial-grade lenses that include set screws, and they're worth the cost."

Are we related?

When adding robotic or other motion operations to an inspection station, engineers must relate an image's 2-D pixel measurements to the real-world coordinates in which a robot operates. "That calibration can create a headache for engineers the first time they configure a system," according to Jay Williams, director of business development at DVT. "They must deal with two 'brains' that operate with different types of measurements." After presenting the vision system with a calibration target, engineers position a robotic arm or manipulator at specific target points and capture coordinate data.

After a system makes several such measurements, algorithms in vision-system vendor's toolkits or wizards transform, or map, one set of coordinates onto the other. The operation requires no manual math, because the software takes care of all calculations.

"Most smart-camera and vision-system suppliers offer calibration routines for specific types of robots, so often calibration amounts to simple point-and-click operations," says ABCO's Cornelius. "But engineers often forget to machine a precision calibration target or fixture that approximates their product or its location for a robotic system, and they forget to account for the geometry of their robot's effector." (An effector holds a tool or functions as a tool.)

"Say a robot must place a pneumatic suction cup on a product to lift it. It's difficult to center the cup on a calibration target by eye," explains Cornelius. "You need a pointer on the robot to represent the center of the cup and its contact plane. And you need a small hole in the center of the calibration target that represents the cup's landing point. Then, by aligning the point and the hole, you accurately relate the mechanical and the visual coordinates."

Coordinate systems may change, though. "If you have a loosely fixtured part and you move a vision system to view it, you may need to change the coordinate system based on the part's orientation rather than forcing an existing coordinate system on the part," said DVT's Williams. Changing the orientation of the coordinates can simplify measurements and robot motions.

 
 
Figure 2. A SCARA robot performs angular movements to position itself at x and y coordinates. A z-axis actuator moves up and down and rotates. Note the camera attached to the long, straight black tube on the robot. Courtesy of Epson Robots.
Add
a dimension

Some systems require more complex combinations of vision and motion. If you have an actuator on the end of a Selective Compliance Assembly Robot Arm (SCARA), the system must "think" in 3-D and include a rotational dimension for the actuator (Figure 2). This type of system may require multiple cameras to acquire 3-D information. "That gives you some 'fun' math to work out—the x, y, and z dimensions, plus a theta value," says NI's Voosen. "If possible, engineers should use software that eliminates any hand calculations and simplifies movements to vector-like operations."

If engineers require 3-D operations, they might choose a 2-D system that obtains z-axis information indirectly. "Engineers can apply structured lighting that projects a line or point of light onto an object at a preset angle," explains RVSI's Agapakis. "The point at which the light intersects an object varies in an image depending on the height of the object. Once you have an image, you can apply geometry and math to get the third dimension." (Figure 3.)

Cognex uses geometric pattern matching to locate a component or device in an image, and the company's vision systems convert the location into x and y coordinates for a motion controller. "When a camera views a stack of parts, the top part appears smaller as the stack gets shorter and its distance from the camera increases," notes George Blackwell, director of marketing at Cognex. "We use the apparent change in size to calculate the top part's height. Then a robot can continue to add or remove parts from the stack. We call that type of measurement 21/2-D."

When it comes to moving a camera or robotic actuator, Agapakis of RVSI warns engineers, "If you specify a certain accuracy in your vision system, look for a similar accuracy in your motion equipment. Combine a high-resolution camera with a low-resolution mechanism and you lose the accuracy you paid for. Don't buy individual components and just slap them together. Factor sources of errors and inaccuracies into your design specifications."

Many vision systems rely on subpixel, or fractional-pixel, image-analysis operations that locate a feature within a pixel based on its gray-scale value. If a motion system must operate with subpixel accuracy, include that consideration when you specify motion systems and controllers.

 
Figure 3.  A laser diode’s beam intersects a plane at different points depending on its height. Once you know the position information, you can calculate precise height information.

Talk nicely

Correlating image coordinates with motion-control coordinates assumes compatible communication between a motion controller and a vision system. Most equipment suppliers still rely on an RS-232 serial link and on the ASCII character set as a "protocol" for information exchange. Vision systems let users format ASCII-encoded information to make it compatible with many popular motion-control and robotic systems. But incompatibilities still exist, and engineers should budget time and money to iron out any communication difficulties.

Blackwell of Cognex observes that although equipment manufacturers often use proprietary-bus architectures, many have started to offer an Ethernet interface. Ethernet provides an open standard, and it costs little to connect equipment to an Ethernet cable.

"Ethernet now offers the preferred communications channel between a vision system and a robot," explains Blackwell. "But you can't just connect components to a network and expect everything to work." A factory-floor network requires a solid design right from the start. In a production setting, Ethernet must provide deterministic response.

"Normally, a system integrator would resolve any data incompatibilities," notes Blackwell. "In many cases, engineers can program a vision system to communicate using the protocol—Modbus, Profibus, CANOpen, and others—a motion controller expects."

But Williams at DVT suggests some caution, "Even though systems talk the same language, they may have subtle differences that cause confusion."

"We have had some glitches with Ethernet," adds ABCO's Cornelius, "but RS-232 still works well and we can count on it when we need to fall back on it."

If electrically incompatible systems must communicate, engineers can purchase "bridges" that convert one form of communication to another, say, Ethernet to RS-232 and vice versa. And engineers should remember that Ethernet establishes only a communication protocol, it doesn't force a specific format on user information. Thus, engineers can adapt Ethernet packets to a variety of data needs.

For more information

* On inspection, visit WWW.TMWORLD.COM/INS

 

Work safe

Whenever a system involves motion, safe operation becomes a primary design concern. Thus, motion controllers must supply digital inputs that sense limit-switch conditions and stop motors before they exceed mechanical norms. In addition, interlock switches and light curtains that technicians and operators cannot bypass must halt operation when people open access doors or insert objects—such as hands and arms—into hazardous areas. Large, easy-to-reach, well-marked panic buttons must instantly halt operations.

Because the systems described above include cameras, a shutdown operation could trigger an image acquisition from each camera to record the state and position of equipment at the time an emergency occurs. The system also should save the state of limit switches, light curtains, and other sensors. That information can aid testing and debugging.

A mechanical test system may not know the state or position of movable apparatus after an emergency stop or after a stop due to power loss. So, upon power-up, software should always assume the apparatus stopped in a worst-case state and proceed to initialize itself carefully.

Software may include another safety feature—a timer. A motion-control algorithm could set a watchdog timer for x ms, a period that provides sufficient time for the algorithm to complete its task. At the end of the algorithm, a command either disables the timer or resets it. If the algorithm fails to execute within the x-ms period, the watchdog timer "times out" and triggers a shut down or turns on a fault indicator.

Email
Print
Reprint
Learn RSS

Talkback

We would love your feedback!

Post a comment

» VIEW ALL TALKBACK THREADS

Related Content

Related Content

 

By This Author

Sponsored Links



 
Advertisement
SPONSORED LINKS

More Content

  • Blogs
  • Podcasts

Blogs

  • Martin Rowe
    Rowe's and Columns

    November 5, 2008
    Technical articles retain value
    I'm always amazed, and pleased, when I hear from readers who still find value in old T&MW articl...
    More
  • Martin Rowe
    Rowe's and Columns

    October 31, 2008
    Measurement proverbs
    The other day, I received some measurement proverbs that I'd like to share. The proverbs come from K...
    More
  • » VIEW ALL BLOGS RSS

Podcasts

Advertisements





NEWSLETTERS
Click on a title below to learn more.

Test Industry News (3 Times Per Month)
Machine-Vision & Inspection (Monthly)
Communications Test (Monthly)
Design, Test & Yield (Monthly)
Automotive, Aerospace & Defense (Monthly)
Instrumentation (Monthly)
Resource Center E-Alert (Monthly)
©2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy
Please visit these other Reed Business sites