A five-minute teach is real: set the part under the camera, draw a box around it, name the model, save. What the vendor demo cannot show is that the taught template is a snapshot of one geometry — the stand height, the exposure and the light that happened to be in place at that moment. Teach an object on a setup that drifts and you will spend the shift chasing a match score that was never going to hold. This guide walks the session in the order that holds: the four variables to lock before you press teach, the arithmetic that sizes the field of view and the lens, a worked example for a 60 mm bracket, and the checks that tell you the model will still score tomorrow.
What a five-minute teach actually stores
When a vision camera teaches an object, it stores a gray-level template: the brightness pattern across the part inside the box you drew, plus the geometric relations between the features it finds. At run time the tool slides that stored pattern over each new image and scores the agreement, usually on a 0-100 scale.
Everything the score depends on was frozen at teach time: the working distance that set the image scale, the angle of the camera to the part, the exposure, the light angle and intensity, and any room light that leaked in. Change any of them at run time and the image no longer agrees with the stored pattern, so the score drops even though the part itself is identical.
That is why five minutes is honest but incomplete. The teach takes five minutes; the twenty minutes before it — stand, exposure, light — decides whether it holds. If you have already taught a model and it fails on the line, the other classic cause, streaming instead of snapshot images, is covered in the article on why vision locate works in teach but fails at run time.
Lock the stand and working distance first
Choose the working distance from the field of view you need, not from wherever the camera happens to hang. Then make that height repeatable. A camera on an articulated arm moves every time something brushes it, and each millimeter of drift changes the image scale — and scale is part of what the template matches.
A slide-table stand holds the height you set and prints its position on a scale, so the working distance becomes a written number you can return to after a crash or a clean-up. Record three values with every teach: working distance in millimeters, camera tilt in degrees if the camera is not square to the part, and the stand scale reading. When the cell gets bumped, you restore geometry from the record instead of re-teaching by eye.
Rigidity matters as much as repeatability. A heavy base and a post that does not ring when struck keep the image still during the exposure; vibration writes itself into the template as soft edges that never score high.
A stand with a proper slide table and a written height is the anchor for everything that follows:
- Type
- Camera stands
Browse the full range of camera stands and slide stages, or start the build at the stand step of the configurator.
Size the field of view, then the lens
Field of view is the number that drives everything else: the lens, the usable resolution, even which camera can do the job. Three inputs set it.
- Part: the longest side, plus the feature the template must lock onto.
- Wander: how far the part moves between presentations, per axis, in millimeters.
- Context: template matchers want roughly 10% of background around the part, or they have nothing to hold onto when it shifts.
Combine them:
m is magnification and WD is working distance, in the same units. The last two lines turn a field of view and a stand height into a focal length you can actually order.
Run your own part and stand height through the field-of-view step below; the finder behind its button filters lenses to the focal length the arithmetic gives:
Worked example: a 60 mm bracket at 150 mm working distance
Part: a matte anodized aluminum bracket, 60 mm × 40 mm, with a raised boss 12 mm across. It drops into a shallow tray, so position wanders ±10 mm in x and y and rotation stays under 15°. The robot needs part position to ±0.3 mm.
Field of view: 60 mm part + 2 × 10 mm wander = 80 mm minimum; adding about 10% of context sets a target near 100 mm.
Sensor, illustrative: a 1/2-inch type, 6.4 mm wide, with 1440 × 1080 pixels (the common 1.6 MP layout).
Magnification: m = 6.4 / 100 = 0.064. Focal length: f = 150 × 0.064 / (1 + 0.064) = 9.6 / 1.064 = 9.0 mm, so the nearest stock lens is 8 mm.
Check what the 8 mm lens really delivers at 150 mm: m = 8 / (150 − 8) = 8 / 142 = 0.0563, so FOV = 6.4 / 0.0563 ≈ 114 mm and mm/px = 114 / 1440 ≈ 0.079 mm/px.
Margins: (114 − 60) / 2 = 27 mm free on each side of the part against 10 mm of wander, leaving 17 mm of spare context.
Feature check: the 12 mm boss spans 12 / 0.079 ≈ 152 pixels, far above the 3-5 pixels a matcher wants across its smallest feature.
Accuracy: on clean matte edges a correlation locator repeats to a few tenths of a pixel, so expect roughly ±0.05-0.1 mm — an estimate, and comfortably inside the ±0.3 mm requirement. The four numbers this example hands to the teach record are a 114 mm field, 0.079 mm/px, a 150 mm working distance and an 8 mm lens.
Fix the exposure before you teach
Put the camera in manual exposure and manual gain. Auto modes re-balance every frame, so a part that read 180 gray levels at teach can read 150 at run time; the template did not change, but the score falls anyway.
Set exposure from the histogram. The brightest surface should sit below roughly 240 of 255 so highlights keep their gradient, and the darkest features above about 20 so noise does not eat them. If a shiny boss clips to white, drop the exposure or move the light; never teach a blown-out template.
In a plant lit by mains-powered tubes or high-bays, pick an exposure that is a multiple of the mains half-cycle — 10 ms at 50 Hz, 8.33 ms at 60 Hz — or the ambient contribution beats frame to frame and the score wobbles with it. The article on camera flicker under artificial lighting shows how to tell flicker from plain underexposure.
Write the final exposure and gain into the teach record next to the working distance.
Choose the light geometry, then pin its intensity
Match the light to the feature the template must lock onto.
- Print, labels, matte texture: diffuse light from above, a diffused bar or a dome, so brightness stays even across the whole field.
- Raised edges, embossments, machined steps: low-angle bar lights grazing the surface, so every edge glows against a dark face. The diagram shows dark-field against bright-field.
- Curved or shiny parts: a dome light, which lights the part from every direction and removes moving highlights.
Whichever geometry you pick, mount the light rigidly and drive it at a fixed current rather than adjusting a bench supply by eye. Intensity falls with the inverse square of distance: move a bar light from 100 mm to 200 mm off the part and the part sees a quarter of the light. A light knocked 20 mm out of position is, to the template, a different light.
Set the intensity once at the working distance, re-check the histogram, and record the current or controller channel with the teach. The article on lighting geometry for image contrast covers the geometry choices in more depth.
Three 24 V bar lights for grazing edges or even diffuse fill:
- Size
- 200-400 mm
- Type
- Standard
- Size
- 200-400 mm
- Type
- Diffused
- Size
- 200-400 mm
- Type
- Standard
The light finder filters every type by size, color and wavelength.
Which camera to teach on
Any industrial camera holds a taught model; what differs is where the locate runs and how committed the optics are.
A smart camera runs the locate on the device, so teach, model and decision live in the camera with no PC — that is the hardware behind most five-minute demos. Shutter type still matters: teach on a global shutter, because a rolling shutter smears a part that moves during the exposure into a template the stationary part will never match.
Fixed-lens sensors commit you to one geometry out of the box. The MV-SCA002M-03S-WBN-SR ships with a 3 mm lens focused at 240 mm. That is wide-field geometry for a large tray, the opposite end from a 100 mm bench field at 150 mm.
What matters most in a teaching camera:
- Interface
- Fast Ethernet
- Resolution
- 5 MP
- Sensor format
- 1/1.45"
- Shutter
- Global
The MV-SC3050XC-16M-ATN-H is a 5 MP color vision sensor with a global shutter and an M12 lens mount. A 5 MP sensor in the common 4:3 layout has about 2592 pixels across, so the example's 114 mm field would run at 114 / 2592 ≈ 0.044 mm/px — headroom for a second, tighter inspection in the same image, or for doubling the working distance at the same mm/px.
For contrast, the MV-SC5060XM-08M-WBN pairs a 6 MP mono sensor with an 8 mm M12 lens on GigE; its rolling shutter rules it out for a moving line but costs nothing on a static bench stand.
Filter the smart cameras category by resolution, shutter and mount in the camera finder.
Checks before you press teach
- Histogram: brightest pixel below about 240 of 255, darkest above about 20, no clipping anywhere on the part.
- Exposure and gain: manual, values written down, exposure a multiple of the mains half-cycle.
- Geometry: working distance, tilt and stand scale reading recorded; field covers part + wander + about 10% of context.
- Light: geometry matched to the feature, current fixed and recorded, room light excluded by shroud or bandpass filter.
- Teach, then abuse it: rotate the part ±15°, push it to each edge of the field, re-locate. On a 0-100 score, a model that stays at 80 or higher across those poses will hold in production.
- Set the accept threshold 10-15 points below the worst score from step 5, not at the teach score itself.
- Toggle the room lights and re-check once; if the score moves by more than a few points, shroud the cell.
- Save the teach record: template, exposure, gain, working distance, light model, current, worst-case score.
Day-night swings are the classic silent score killer; the article on ambient light variation in pick and place vision covers shrouding and filtering in detail.
When a taught template will not hold
Locked geometry and clean contrast fix most failed teaches, but some parts need a different decision, not a better template.
- Random orientation with little surface texture: teach the full rotation range or use an orientation-invariant tool; a model taught at 0° crawls at 90°.
- Appearance that changes batch to batch: teach one model per batch, as the article on vision locate with changing part sizes shows, or teach a model that survives changing colors and finishes.
- Moving highlights on shiny surfaces: change the light geometry — dome or full diffuse — rather than the algorithm.
- Tilted parts: a 2D template on a tilted part shifts and scales at once, so either constrain the presentation or move to a 3D sensor.
Before any re-teach, run the part through the feasibility checklist before you teach; some parts never had a 2D answer.
The decision in one place
Teach the object only after the setup holds still: field sized from part plus wander, lens from field and stand height, exposure fixed with a clean histogram, light rigid at a recorded current.
| Lock | Set it from | Worked-example value |
|---|---|---|
| Field of view | part size + 2 × wander + ~10% context | 114 mm delivered by the 8 mm lens |
| Working distance | field of view and lens, then fixed on the stand | 150 mm |
| Exposure | histogram headroom, mains half-cycle | 10 ms at 50 Hz |
| Light | feature geometry, fixed current | low-angle bar, current recorded |
A model taught that way passes the ±15° and edge-of-field tests, and the five minutes stays five minutes.
If you want the geometry checked against your part before you order, send the drawing and the wander numbers through the contact page. More worked setups sit on the applications topic page.
Questions
How much larger than the part should the field of view be?
Add the part's position wander on both sides, then leave about 10% more field so the matcher has background to hold onto. For a part that arrives within ±10 mm of its nominal spot, that works out to roughly 1.5-2 times the long side. The worked example's 60 mm part with ±10 mm of wander needed 80 mm at minimum; the 114 mm field left 27 mm free per side.
Should exposure be automatic while teaching an object?
No. Auto exposure and auto gain re-balance every frame, so the brightness the template stored drifts and the score follows it down. Fix both values, check the histogram, and write them into the teach record. If the camera's auto modes must stay available for other jobs on the device, keep them out of the locate job. Revisit the values only when you also change the light, the stand height or the lens.
What match score means a teach will hold in production?
Most template tools normalize the score to 0-100, some to 0.0-1.0. After teaching, test parts rotated about 15 degrees and pushed to each edge of the field: a model that holds 80 or above rides out normal part and lighting drift, while one under 60 needs better contrast or a tighter field. Set the accept threshold roughly 10-15 points below the worst rotated score.
Do you have to teach again after moving the camera or light?
Yes, or at least re-verify against the recorded score. A taught template is stored against the exact working distance, light angle and intensity it saw. Move the camera 20 mm farther away or swing a bar light, and the pattern shifts and scales enough to cost real score. After any mechanical or lighting change, relocate a known part and compare its score with the teach record before releasing the line.
How small a feature can a taught model reliably find?
Plan on at least 3 pixels across the smallest feature the matcher must lock onto, and 5 or more for a crisp edge. At the worked example's 0.079 mm/px, that puts the practical floor near 0.25-0.4 mm. Smaller features call for a shorter field, a higher-resolution sensor or a closer working distance, not more contrast.
Can you teach under room lighting and run under a strobed light?
No. The stored template includes the room light's contribution, and a strobed run-time image will not agree with it. Teach with the production light on and set to its run-time current, then keep ambient light out of the image with a shroud or a bandpass filter matched to the LED wavelength. Re-check the score once with the room lights toggled.




