Вы находитесь на странице: 1из 5

1

Here we outline how machine-design engineers


can integrate machine-vision software, vision
sensors, smart cameras, image-based barcode
readers, and OEM vision into machines, devices,
and other capital equipment.
Basics of
Designing Machine Vision
into OEM Equipment
CONTENTS
Machine-vision
hardware 1
Case in point:
Pen-making
application 2
Machine-vision
networking 3
More
specifcally: 4
Machine-vision
software 5
Presented by
Machine vision is commonly used in
semiconductor, electronic, automotive,
and consumer-products applications, and
is spreading in medical, pharmaceutical,
and aerospace designs. Uses include gaug-
ing (to measure parts or examine critical
dimensions), inspection (to sort parts based
on physical characteristics), guidance (to
accurately locate or place parts with robots),
and identifcation (to determine whether the
right part is present by inspecting its physical
characteristics or barcode).
Machine vision is traditionally installed
at the end of the line to check for fawed
products before theyre sent out. However,
the cost for machine-vision systems has fallen
and network bandwidth has increased, so
now its practical in many applications to in-
stall vision at multiple production points
to catch defects as they occur, reduce scrap
and rework, and address inventory problems.
As well explore, the decreasing cost for pro-
cessors has also made it practical to distribute
vision smarts and replace multiplex vision
cameras (operating of a single processor).
Machine-vision hardware
Vision hardware includes a camera to
captures images, lighting to enhance con-
trast or features of interest, and optics that
accurately represent the image to the camera
In inspection applications, machine-vision
systems take videos of manufactured parts
or assemblies and then use microprocessors
and image-analysis software to interpret the
videos images, usually to verify whether the
parts have faws or not. That information gets
reported to PLCs, robots, HMI/SCADA devices,
printers,
and machines
along the
production line
that can then
take action as
needed to sort out any
problem parts. Shown here is the
Cognex Advantage 100 vision system and AE2
Advantage engine integration in cost-sensitive
OEM applications including printing, kiosk, and
medical-device designs.
Sponsored by

2
M
a
c
h
i
n
e
-
v
i
s
i
o
n

s
o
f
t
w
a
r
e


5
M
o
r
e

s
p
e
c
i
f
c
a
l
l
y
:

4
M
a
c
h
i
n
e
-
v
i
s
i
o
n

n
e
t
w
o
r
k
i
n
g

3
M
a
c
h
i
n
e
-
v
i
s
i
o
n

h
a
r
d
w
a
r
e

1
and system-based platforms continue to narrow. Ultimately,
application complexity and other variables dictate the fnal
hardware and software requirements.
2. Next the engineer should consider whether an appli-
cation needs linescan cameras instead of area-scan cameras.
Unlike area scan cameras that need to see the entire part to
take a full snapshot, linescan cameras only need to see only a
sliver of the product to build an entire image into memory.
Likewise, monochrome vision systems sometimes dont give
enough detail, even with special lights and fltering. Here,
color systems can sometimes detect the subtle diferences
and execute inspections more accurately.
3. Next, the engineer should verify what camera lens is
most suitable. Te lens locates features in its feld of view
(FOV), ensures theyre in focus, maximizes contrast, and
avoids perspective distortion. Te FOV should cover all
features to be inspected. In alignment and gauging appli-
cations, the lens must also present the image in geometry
calibrated to the objects position in space. Depth of feld
(DOF) is the maximum object depth in focus, and the
F-stop number (F/# or aperture setting) partially deter-
mines DOF. Its the focal length of the lens divided by lens
diameter. As the F/# is reduced, the lens collects less light.
Te absolute resolution limit of the lens is reduced when the
by minimizing distortion and loss of resolution. In
addition, a processor captures, digitizes, and displays
images for analysis or to guide processes. Engineers
should give consideration to nine distinct hardware
features to specify the most suitable.
1. First, the engineer should determine whether
a PC or system-based vision is most suitable for the
application at hand. PC-based vision is usually pro-
grammable through a computer while system-based
vision is confgured through a wizard. PC-based
vision is fastest because it runs on the latest CPU ar-
chitectures, so is suitable for complex or mathemati-
cally intensive applications. Its compatible with the
Microsoft architecture but require vision expertise
and knowledge of low-level programming languages
such as C++ or Visual Basic.
In contrast, vision systems generally require
no programming, and provide more user-friendly
interfaces. Tey have one processor per camera
and can be easily linked together and managed as
a system over a network. Tey provide single-point
inspections with dedicated processing. Most have
built-in Ethernet communications networkability.
Teyre self-contained so dont run on a PC, VME, or PCI.
Teyre also low cost and have become increasingly sophis-
ticated. Te cost and performance gaps between PC-based
BICs New Zealand subsidiary produces about 15
million felt-tip pens per year. Its assembly machine,
customized in-house by BIC NZ, has an excellent
yield, but occasionally pen tips split during insertion.
Machine vision justifed itself on price-performance
grounds. Case in point:
Pen-making application
BIC New Zealand produces pens for the country
and exports to Mexico, Chile, Australia, Canada, and the
U.S. Now the facility uses machine vision to reduce scrap
and improve production capacity. As a small plant we
sufer from economies of scale compared to larger plants
ofshore. Now the price-to-performance for machine
vision which helps us compete with larger plants is
at a level we can justify, says Bernie Jamieson, BIC NZ
Manufacturing Manager. One custom-made assembly
machine produces 15 million felt-tip pens per year. Te
machine has an excellent yield, but occasionally pen tips
split during insertion, or parts can be fed incorrectly. BIC
was relying on manual control by operators to monitor
quality, but at high production speeds manually checking
quality was very difcult. So the plant installed Con-
trolVision to automate inspection. A Cognex In-Sight
5100 module inspects the tips and another inspects
the endplugs. LEDs light both inspection areas. Vision
data transmits through digital I/O to an Omron PLC
that controls the machine and rejects any failed parts. A
touchscreen panel PC running Windows XP and Cognex
In-Sight Explorer software acts as operator and program-
mer interface.

3
M
a
c
h
i
n
e
-
v
i
s
i
o
n

s
o
f
t
w
a
r
e


5
M
o
r
e

s
p
e
c
i
f
c
a
l
l
y
:

4
C
a
s
e

i
n

p
o
i
n
t
:


P
e
n
-
m
a
k
i
n
g

a
p
p
l
i
c
a
t
i
o
n

2
M
a
c
h
i
n
e
-
v
i
s
i
o
n

h
a
r
d
w
a
r
e

1
ing machine vision is communication modules such as I/O
modules and network gateway modules that connect vision
systems to PLCs, robots, and other factory automation
devices and networks.
9. Finally, consider what operator-interface panels (or
human-machine interfaces or HMIs) will be needed with
the machine vision. HMIs are usually designed as plug-and-
play devices that let operators monitor and control vision
without a PC. Touchscreen interfaces are common; some
support multiple camera views. Others have high-speed
visualization so operators can view images and overlay
graphics on the line (and modify inspection parameters or
view inspection results). Some HMIs have impact-resistant
screens and NEMA-rated sealing as well.
Machine-vision networking
Networking lets vision systems communicate with PCs,
PLCs, robots, and other automation devices. (Typically,
pass-fail results go to PCs for analysis or to PLCs, robots,
and other factory automation devices for integrated process
control.) Networking also lets vision systems send data and
image archives onward for trend analysis and automates
changeovers in plants that make several diferent products.
Finally, networking lets machine vision get installed across
many production stations (and not just at the end of lines)
and lets arrays of vision systems form device-level networks.
Tese uplink to plant and enterprise networks and allow any
workstation with TCP/IP to display vision results and sta-
tistical data. Serial communications (not parallel I/O lines)
allows for architecture thats smaller, lighter, more scalable,
and easier to troubleshoot.
aperture is reduced in size.
4. Sensor size is the size of a camera sensors active area,
typically specifed in the horizontal dimension. Its primary
magnifcation is the ratio of its size to FOV. With primary
magnifcation held constant, reducing the sensor size reduces
FOV and increasing the sensor size increases FOV.
Note that vision-system resolution is the imagers size in
pixels. Tose with more pixels capture more data for more
accurate and repeatable measurements. Te appropriate
amount of resolution depends on the feld of view needed.
For example, assume a system must count the number of
parts on a tray. If the feld of view is the width of the assem-
bly line 12 in. and the vision system has a resolution
of 640 x 480, 640 pixels covers the 12 in. for 53 pixels per
in. (so each pixel represents 0.018 in.) which is probably
sufcient. But if were measuring the width of each part and
need a tolerance of 0.001 in., more resolution is needed.
5. Another camera parameter is the modulation trans-
fer function (MTF), a measurement of an optical systems
ability to reproduce levels of detail from objects to images
as shown by the degree of contrast in the image. Te lens
MTF should deliver sufcient contrast over the applications
entire critical area.
6. Does the application at hand require autofocus?
Manual focus setup relies on a subjective of whether images
will be sharp. Its downright impossible if a vision system is
installed in a hard-to-reach area. In contrast, autofocus sim-
plifes setup. Its critical in applications with frequent part
changes because when the vision system sees a new part for
the frst time, it must adjust to focus on the area inspected.
Mechanical autofocus devices move the lens to the needed
position with feedback. Software periodically evaluates and
optimizes image sharpness.
Another autofocus option for barcode readers is liquid
lenses, electronically controllable variable-focus systems
that use two ISO-density fuids insulating oil and con-
ducting water.
7. Another consideration is lighting. Nearly every
installation requires custom lighting to optimize perfor-
mance in the form of ring lights (for soft, even il-
lumination from all directions), back lights (for contrast
between a part and its background), and dark feld lights
(for low-angle illumination and imaging of surface irregu-
larities). Tats because every production area has unique
ambient light conditions, and all parts have varied surface
characteristics.
Integrated lighting simplifes installation by eliminat-
ing the need to acquire, install, and power additional
lighting. It makes the vision system more compact than
those with external lighting, so is particularly suited to hard-
to-reach places on production lines. Some can control the
intensity and strobing of both integrated and external lights.
8. Yet another hardware consideration when specify-
Vision software tools are the backbone of BICs
New Zealands vision engine. By comparing specifc
features of interest within the image to stored data
that comprises a standard, these vision tools perform
image processing and analysis of the captured image.

4
tate vision-system connectivity for integration of vision
data, images, and graphics into factory automation. For
example, ActiveX controls integrate vision-system images
and display graphics into third-party HMIs and SCADAs.
Advanced vision systems support industry-standard OLE
for Process Control (OPC) communication tags to facilitate
data exchange with other OPC systems and software such as
controllers, distributed control systems, and distributed I/O
networks.
To integrate a vision system with the PLCs, robots, and
other automation devices in a plant, the vision system must
also support:
Fieldbus networks, including CC-Link, DeviceNet, and
PROFIBUS. A protocol gateway accessory is usually
needed to add a vision system to a Fieldbus network.
RS-232 and RS-485 serial protocols, needed to communi-
cate with most robot controllers.
Industrial Ethernet protocols such as EtherNet/IP, PRO-
FINET, MC Protocol, POWERLINK and Modbus TCP.
Tese let vision systems link to PLCs and other devices
over a single Ethernet cable, simplifying wiring and elimi-
nating network gateways. Ten control functions execute
tasks based on vision-system information.
EtherNet/IP (IP=Industrial Protocol) is a Rockwell-
defned protocol that links vision systems to Allen-Bradley
PLCs and other devices over a single Ethernet cable,
eliminating the need for complex wiring schemes and costly
network gateways. Te Modbus/TCP industrial network
protocol is defned by Schneider Electric and permits direct
connectivity to Modicon PLCs and other devices over
Ethernet. Likewise, the Profnet industrial communications
protocol (defned by Profbus International) allows vision
systems to communicate with Siemens PLCs and other auto-
mation devices.
In fact, vision systems generate far more process infor-
mation than other factory-foor devices so have accelerated
the use of Ethernet. Ethernet efciently transmits visions
large images and data fles. Vision systems with built-in
Ethernet can link to other vision systems. Tat Ethernet
capability (plus software) lets engineers remotely manage vi-
sion and share vision data with all levels of an organization.
Ethernet-enabled vision systems can communicate with PCs
as well. Tat enables plug-and-play of third-party network-
ing cards and software, so manufacturers can tailor commu-
nications to applications with unique protocols.
More specically:
1. Two or more vision systems can link over Ethernet to
form a dedicated vision area network. Here, vision systems
exchange data and are managed by a host, whether it is a PC
or another vision system. In addition, direct peer-to-peer
communications happen between each system over a single
line, so there are no complicated cabling schemes. Resulting
Standard networking protocols for linking vision to
enterprise-level PCs abound.
TCP/IP client/server enables vision systems to share results
data with other vision systems and control devices over
Ethernet without any code development.
File Transfer Protocol (FTP) allows inspection images to
be stored on the network for later analysis, as it lets users
archive failed inspection images without writing customer
software.
Telnet is an Internet standard protocol that enables remote
login and connection from host devices.
Dynamic Host Confguration Protocol (DHCP) allows
each vision system linked to the network an automatic
assignment of an IP address, enabling true plug-and-play
performance. Systems without it need to have an IP ad-
dress manually assigned and that often involves asking an
IT administrator for available addresses.
Domain Name Service (DNS) permits the naming of each
vision system, such as Transmission Line System 1, instead
of having to rely on a nine-digit IP address. Without
DNS, keeping track of all vision systems running on the
line is difcult, and often requires that every system get
physically labeled with its IP address.
SMTP enables e-notifcations of problems on the produc-
tion line. For example, if ten consecutive parts fail inspec-
tion, the system can send an email to a computer, pager,
or cell phone. Tis provides alerts that the line may need
to be stopped and provides secondary inspection monitor-
ing where operators may miss something.
Other emerging communication protocols also facili-
Todays performance vision systems use geometric
pattern matching to locate parts. This overcomes
variations in part orientation, size and appearance.
M
a
c
h
i
n
e
-
v
i
s
i
o
n

s
o
f
t
w
a
r
e


5
M
a
c
h
i
n
e
-
v
i
s
i
o
n

n
e
t
w
o
r
k
i
n
g

3
C
a
s
e

i
n

p
o
i
n
t
:


P
e
n
-
m
a
k
i
n
g

a
p
p
l
i
c
a
t
i
o
n

2
M
a
c
h
i
n
e
-
v
i
s
i
o
n

h
a
r
d
w
a
r
e

1

5
Here, image-preprocessing tools alter raw images collected
by the cameras to emphasize key features while minimizing
irrelevant features. Preprocessing increases the contrast be-
tween a part and its background, masks potentially confus-
ing image features, eliminates hotspots refecting of part
surfaces, and smoothes rough surface textures.
In inspection applications, vision software also makes
decisions about quality, location, size, and identity by
comparing the features of parts features to stored data. Here,
image processing and analysis also improve results.
Other software lets machine vision read labels and codes
on everything from stamped automotive parts to labeled
medicine bottles. Optical character recognition (OCR) tools
handle variations in stroke width, skewed characters, back-
ground divergences, touching characters, and other printing
deviations. Here, high read rates and font-training tools are
paramount. Te latter builds fonts by learning character
models. Likewise, fexible felding lets the vision detect both
fxed and variable-string-length characters.
In the same way, applications that need codes scanned
need vision that can read data-matrix codes even if the codes
are degraded, poorly marked, or vary in position from part
to part. Tese read regardless of the part material (metal,
glass, ceramic, and plastic) and the type of part marking
method employed (such as dot peen, etching, hot stamping,
and inkjet).
vision data and images from all vision systems can be col-
lected at a central point, and viewed on a single monitor.
Failed images from each vision system are time and date
stamped in an archive for later review (to determine the
cause of specifc failures).
2. Vision area networks can also uplink to existing plant
and enterprise networks so users can remotely manage vision
activity. For example, one could set up and modify vision
applications, share applications with other plant sites, and
remotely troubleshoot problems with technicians without ever
leaving the ofce. Additionally, uplinking vision data to plant
and enterprise networks gives manufacturers direct access to
data related to their products quality from anywhere in the
organization. Tat includes SPC data for quality engineers
and production output for managers. All it takes is a worksta-
tion with TCP/IP capability.
Machine-vision software
Vision software lets engineers setup, manage, and even
change the settings on hundreds of cameras on dozens
of lines running separate applications. Tese application
development and network administration tools make it easy
to centralize control, add new vision systems to an existing
line, or even copy existing vision setups to new installations.
During operation, vision software helps systems locate
parts by pattern recognition. Even tightly controlled manu-
facturing processes allow variability in the way a part appears
to the vision system, so part-location tools must quickly and
accurately compare trained patterns to actual objects moving
down a production line. Pattern-matching tools must toler-
ate large variations in contrast and ignore lighting changes.
Depending on production line speed and throughput
requirements, a very high-speed reader may be in
order. Some vision systems can read more than 7,200
codes per min. Here, Kraft Foods Canada uses image-
based DataMan 300s from Cognex that read labels
within a 5x5-in. FOV without adjustments.
One consideration is the machine-vision optics. Here,
contrast is the separation in intensity between blacks
and whites in an image. Better contrast results in
greater the difference between black and white felds.
Color fltering can be used to increase contrast.
Likewise, diffraction (sometimes called lens blur)
reduces the contrast at high spatial frequencies,
setting a lower limit on image spot size. In the images
shown, the lens used to take the image on the right
gives better contrast because its a better match for
the high-resolution sensor.
M
o
r
e

s
p
e
c
i
f
c
a
l
l
y
:

4
M
a
c
h
i
n
e
-
v
i
s
i
o
n

n
e
t
w
o
r
k
i
n
g

3
C
a
s
e

i
n

p
o
i
n
t
:


P
e
n
-
m
a
k
i
n
g

a
p
p
l
i
c
a
t
i
o
n

2
M
a
c
h
i
n
e
-
v
i
s
i
o
n

h
a
r
d
w
a
r
e