Vision meets motion
Combining vision and motion expands the capabilities of inspection equipment.
Jon Titus, Contributing Technical Editor -- Test & Measurement World, 2/1/2005
![]() |
| 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 |
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. |
"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. |
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. |
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
|























