The vision step found the part, the robot moved, and the jaw struck the part sitting next to it. The match itself was correct, which is what makes this failure so common: a location match returns poses for the taught outline and ignores everything it was not taught, so a neighbor 15 mm from the target is invisible to it. Treat clearance as its own check, separate from location. Build an exclusion zone around every match from the gripper's swept envelope, test every other part and surface against it, and send the robot only to matches whose zone is clear. This guide gives the formula, a worked example with the arithmetic shown, the 2D and 3D versions of the test, and the routing that keeps an unattended cell picking instead of stopping.
A location match is not a clearance check
A locate or matching node compares the image with the taught outline and returns poses with scores. The score measures how well a candidate resembles the taught part. It says nothing about free space: the node only looks for what it was taught, so the neighboring part never enters the comparison. Tightening the score threshold or the angle tolerance changes which candidates are found, not whether room exists around them — the same reason matching symmetric parts needs its own rotation tolerance logic.
Two things go wrong without the zone. First, the jaw strikes a neighbor, which can damage the target, the neighbor and the tooling in one stroke. Second, a jolted part drops back into the pile and nobody knows which piece took the hit, so a quality escape rides along with good stock. An unattended cell pays a third time in throughput: every contact is a fault, a restart and a lost cycle. The check therefore belongs in the vision step, before motion, on the whole scene.
Set the zone from the gripper envelope, not the part outline
The zone answers one question: how far beyond the part outline can the tooling reach while it grips? Four inputs set it:
- S — the widest jaw opening during the final descent, in mm; use the approach opening, not the opening at contact
- W — the part width at the grip faces, in mm
- F — finger thickness measured along the direction a neighbor would sit, in mm
- m — margin covering calibration, match scatter and part-position scatter, in mm
d is the per-side dilation, the zone is the part outline grown by d on every side, and g_min is the minimum edge-to-edge gap between the target and any neighbor: the neighbor's outline must stay outside the zone. A calibrated cell typically scatters 0.5-2 mm end to end, so m = 5 mm is a sound default; measure your own scatter and set m above the worst case.
If your vision software can only intersect polygon with polygon, testing zone against zone turns the same-parts rule into gap ≥ 2d. That is conservative by d and refuses picks that would physically work. Use it when parts are plentiful; switch to outline-versus-zone when every part counts.
Worked example: 23 mm per side for a 60 mm plate
Part: 100 × 60 mm cover plate, presented flat, approached vertically, gripped on the long sides by a parallel-jaw gripper. The jaws descend at their grip opening of S = 76 mm, which is the 60 mm part plus 8 mm of pad engagement per side. Finger thickness F = 10 mm. Margin m = 5 mm.
d = (76 - 60)/2 + 10 + 5 = 8 + 10 + 5 = 23 mm per side
zone = (100 + 2 × 23) × (60 + 2 × 23) = 146 × 106 mm
Decisions that fall straight out of these numbers:
- Any neighbor closer than 23 mm edge-to-edge blocks this pick.
- With the conservative zone-versus-zone shortcut, pairs closer than 46 mm are refused. Two parts 30 mm apart are physically pickable (30 > 23) but blocked by the shortcut — a known, paid-for loss.
- If the same gripper descends wider open at S = 90 mm and closes on the way down, d grows to (90 - 60)/2 + 10 + 5 = 30 mm. The approach opening is what strikes, not the grip opening.
- For a round part the same d applies radially: a Ø60 mm ring gripped at its rim needs its outline grown to Ø106 mm.
When flat math fails: the height test
The 2D dilation assumes every neighbor is a flat part at part height. Three scenes break that: a tilted part whose edge leans over the target, parts nested at different heights, and anything non-taught in the path. A leaning neighbor can sit 20 mm clear in top view — passing a 2D outline test — yet rise 15 mm above the table exactly where the fingers descend.
The 3D version tests volume instead of area. Take the exclusion footprint, extend it from the grip plane up to the finger top (finger height above the grip plane H_f = 30 mm in this example cell), and subtract the target part's own footprint. Voxelize the depth cloud at 2.5 mm, half the margin, and reject the pick when any remaining voxel lands inside that band. The leaning neighbor rises 15 mm into the 0-30 mm band, so it blocks the pick even though the top-view outlines are 20 mm apart.
A lower part stacked under the target is fine: it sits below the band and the top part grips normally. What matters is anything inside the footprint between grip plane and finger top.
For the camera side of this — mounting height, angle and working distance over the table — see the 3D camera working distance and positioning guide.
Which camera runs the check
| Scene | Check that works | Camera |
|---|---|---|
| Flat parts, one height, tight scatter | Outline dilated by d, tested against neighbor outlines | 2D smart camera or vision sensor |
| Tilted, leaning or nested parts | 3D swept-volume band test on the depth cloud | Structured-light 3D camera |
| Mixed part types, one scene | Per-type envelope, cross-type zone blocking | 3D camera plus per-type matching |
The 2D route runs on a smart camera or vision sensor with the matching library on board: the MV-SC3050XC-16M-ATN-H brings a 5 MP color global-shutter sensor on Fast Ethernet, and the MV-SC5060XM-08M-WBN a 6 MP mono sensor with an 8 mm M12 lens on GigE.
- Interface
- Fast Ethernet
- Resolution
- 5 MP
- Interface
- GigE
- Resolution
- 6-10 MP
The 3D route needs a depth map of the whole scene, and the MV-DPS200P-02 projected structured-light 3D camera is made for table and bin scenes of this kind. Where the hard part is the cluster itself rather than the clearance test, the 3D bin-picking approach for flat parts compares the vision options.
- Type
- Stereo / structured light
Whichever camera wins, the match, the zone test and the robot handshake run continuously, which is a job for a vision controller rather than a shared office PC. The MV-VC3301H-128G66 runs that loop on an Intel Core i3 with 8 GB of memory, 5+ LAN ports and 4 built-in light channels; step up to the MV-VC5525-256G70-NN when the cameras want PoE — it carries PoE camera ports, 32 GB of memory and 8 built-in light channels. Strobed exposure from those built-in light channels keeps the match stable across a shift, so the zone never has to absorb lighting drift. If the cell has no PC at all, the smart-camera route mirrors the robot pick and place build without an external PC.
- LAN ports
- 5+ LAN ports
- USB 3 ports
- 3-4 USB 3 ports
- LAN ports
- 5+ LAN ports
- USB 3 ports
- 3-4 USB 3 ports
Pixels are never the limit
It is tempting to ask whether the camera can even see a 23 mm gap. Work it for a 400 mm field on a 6 MP sensor at 3072 × 2048 px: 400 / 3072 = 0.13 mm per px, so the gap spans 23 / 0.13 ≈ 177 px, and a 1 mm edge erosion still spans 8 px. Match repeatability of a few tenths of a pixel adds under 0.1 mm. Pixels do not set the margin in this cell — calibration and part scatter do, and both already live inside m. What the pixel budget must cover is area: the field of view needs every candidate part plus a d-wide ring around it, and a match clipped at the field edge should be refused, not zone-checked.
Check your own sensor and field with the resolution calculator below.
Build the check into the program
- Calibrate camera to robot. Run 50 presentation cycles, record the gap between camera-reported pick points and the positions the gripper actually found, and set m above the worst case.
- Measure the envelope on the bench: close the gripper on a real part and record the grip opening, the widest approach opening, F and H_f.
- Teach the part outline and set match tolerances; for mixed part types, switch capture parameters per part between scans so each type matches under its own settings.
- Dilate every match outline by d into an exclusion polygon.
- Test. 2D: reject a match whose polygon contains any neighbor outline or match center. 3D: voxelize the depth cloud at 2.5 mm and reject when any non-target voxel lands in the grip-plane-to-finger-top band.
- Route the robot to the unblocked match with the highest score; if every match is blocked, return a “no clear pick” result and index the presentation. Send the coordinates the way the camera-to-robot TCP handoff lays out, and reuse the single-camera reject routing pattern for the blocked case.
- Log every blocked pick with its overlay image. After a few hundred cycles, widen d if the log shows jaw contact, and narrow it by the measured amount if it shows near-miss refusals.
Prototyping the polygon and voxel logic in simulation before wiring I/O pays for itself; a walkthrough of picking two randomly placed parts in simulation shows the pattern end to end.
Pitfalls that cost jaws
- Reading the match score as a clearance signal. A high score says “this is the taught part”, never “space around it is free”.
- Dilating the outline instead of the envelope. In the worked example an outline-only zone gives F + m = 15 mm per side and loses exactly the (S - W)/2 = 8 mm of pad engagement — the space the jaw occupies at grip.
- Using the grip opening in the formula while descending wider open. At S = 90 mm against a 76 mm grip opening, the true d is 30 mm where you computed 23 mm.
- Keeping one m for every cell. A belt-fed presentation with millimeters of bounce needs a bigger margin than a shim-and-fixture cell; m comes from your scatter measurement.
- Tuning d blind. Without blocked-pick images you are adjusting a number with no evidence behind it.
When the usual answer is wrong
- The feeder already guarantees spacing. If tooling presents parts gapped, a per-part zone check is wasted cycle time; audit spacing by sampling instead.
- The grip is internal. Fingers spreading inside a bore occupy almost nothing beyond the outline, so the side envelope collapses to roughly m; neighbors beside the part stop mattering and only raised parts above the band matter.
- Every pick is blocked. On a dense pile where no zone clears, stop widening margins and change the presentation — vibratory feed, a flip station, or the conveyor scene covered in choosing 2D or 3D for conveyor pick and place.
- A strike is intolerable at any margin. Add a second scan after grip or a gripper object-detection layer under the vision check; the layers catch different failure modes.
Parts list and next step
Decisions by case: a flat table with one part height and tight scatter runs the dilated-outline test on a smart camera; tilt, lean or nesting calls for a structured-light 3D camera running the voxel band test; a cell with no PC runs the whole loop on the smart camera itself. The 3D sensors page lists the depth families and the camera finder filters by resolution, interface and shutter. Size the chain end to end in the system configurator, or send the part outline, grip type and a scene photo through the contact page — the envelope math above is then a five-minute calculation. More builds like this sit in the machine-vision applications topic.
Questions
How much clearance does a gripper need around a picked part?
Enough for the swept envelope: d = (S - W)/2 + F + m. With S = 76 mm, W = 60 mm, F = 10 mm and m = 5 mm, that is 23 mm per side. For an internal grip, with the fingers spreading inside a bore, the side envelope collapses to roughly the margin alone — around 5 to 10 mm in the same cell — so neighbors beside the part rarely block the pick. S must be the widest opening used during the descent, not just at contact.
Can gripper force sensing replace the vision clearance check?
No, and the order matters. Force sensing or a gripper's object detection reacts after the jaws have already touched something, so the collision has happened and a dinged part can drop back into the pile unidentified. Run the vision zone test before motion and keep force sensing as the last layer, for what vision cannot see: a part hidden under the target or something knocked into the path after the scan.
Which camera handles tilted or stacked parts in a clearance check?
A 3D camera. Tilted parts break two 2D assumptions at once: the top-view outline no longer matches the taught flat outline, and the raised edges occupy the heights the fingers sweep through. Project the swept band — the exclusion footprint from grip plane to finger top, 30 mm high in the worked example — onto the depth cloud, voxelize at 2.5 mm and reject when any non-target voxel lands inside. Flat single-height tables still run fine on 2D.
How should I choose the margin m in the zone?
Measure it. Run 50 presentation cycles, record the difference between each camera-reported pick point and where the gripper actually found the part, and set m above the worst case. A calibrated cell usually lands between 0.5 and 2 mm of total scatter, which is why 5 mm is a comfortable default; a belt-fed presentation bouncing several millimeters needs more. Re-measure whenever the fixture, belt or camera mount changes.
How do I run the check when several part types share the table?
Per type. Match each taught type, dilate by its own envelope — a 40 mm-wide part and a 100 mm-wide part produce different d under the same gripper — and let a match of any type block any other match's zone. Most interference in practice is same-type, but a large loose part can shadow a small one, and the polygon test runs in microseconds once it exists.




