In brief: working distance (WD) is where the lens must sit relative to the part — a mechanical and geometric decision. Depth of field (DOF) is how much height variation around that position stays in focus — a tolerance decision. They interact but they are not the same dial: WD decides where the machine stops, DOF decides how much the part is allowed to move. Selecting a lens by matching only one of the two is the most common way an otherwise correct lens ends up on the wrong machine.
Part of the POMEAS Machine Vision Optics Comparisons series — see the Machine Vision Optics Comparisons index for all 15 articles in this set, grouped by the option being compared.
WD answers: at what distance must this lens be mounted to frame the part correctly? DOF answers: once mounted there, how much can the surface height change before focus fails? The first is a question about the machine; the second is a question about the part. A lens selection is only finished when both have been answered with numbers.
Working distance is measured from the lens front (or its reference plane) to the object. In a real machine it is consumed from three directions at once:
Depth of field is the axial range around best focus within which the image stays acceptably sharp. For a given lens it is governed mainly by the f-number (aperture), the magnification and the wavelength — smaller aperture, lower magnification and longer wavelength each extend it. In production terms DOF absorbs:
Practical rule: sum the part height tolerance + loading error + stage repeatability. That total must be smaller than the DOF — otherwise some parts will defocus no matter how carefully the lens is focused.
| Aspect | Working distance (WD) | Depth of field (DOF) |
|---|---|---|
| Question it answers | Where does the lens sit? | How much can the part move? |
| Set by | Lens design + your machine layout | Aperture, magnification, wavelength |
| Decides | Clearance, FOV at rated spec, lighting room | Height tolerance absorbed in one shot |
| Typical failure | Lens cannot be mounted, or FOV drifts off design | Top of part sharp, bottom blurred (or the reverse) |
| Extending it | Choose a long-WD design — costs size and magnification headroom | Stop down, lower magnification, more light, Z-stack |
| Who sets it first | Machine designer | Part + process engineer |
They trade off indirectly. For a fixed magnification, extending DOF by stopping down costs light — and at long WD every lost stop must be bought back with brighter illumination or longer exposure, which risks motion blur on moving parts. Long-WD telecentric designs hold their measurement geometry across a defined WD range, which is why they are preferred when the machine cannot guarantee a tight WD — but no design escapes the aperture/magnification arithmetic of DOF. The order that works is: fix WD from the machine, fix required DOF from the part, then choose the lens family and aperture that satisfies both — not the other way around.
Choose the working distance first, because it is bounded by the machine: if the WD does not clear the fixture and lighting, the lens cannot be installed at all. Then check depth of field against the part height variation, and change the lens or aperture if the DOF is too small for the process.
No. For a given magnification, DOF is governed mainly by the aperture, magnification and wavelength, not by the WD number itself. Long-WD lenses help when the machine needs the clearance and when a telecentric design must hold its geometry over a WD range, but a long WD alone does not buy focus depth.
That is the classic signature of a height step larger than the depth of field: both surfaces are imaged, but only the one near best focus is sharp. The options are a smaller aperture, a lower magnification, a lens with more DOF, splitting the field into Z-stacks, or refocusing between surfaces if the cycle time allows.
Stop the aperture down one or two steps and compensate with more illumination or a longer exposure, because aperture is the strongest lever on DOF you can operate without touching the optics. Reducing the magnification also helps, but that changes the field coverage, so it is a selection decision rather than a tuning one. For a concrete part, send us the height tolerance and the machine envelope.
Simply enter your email to receive the latest news and insights from Pomeas. Stay connected with Pomeas and be the first to discover new innovations in optical excellence.
