A C-mount lens that looked sharp on the bench goes soft a week into production, and nobody touched it. The cause is almost always the same sequence: the focus was set with the aperture stopped down, at the wrong distance, and the ring was never locked. The fix is a short procedure with firm numbers: seat the flange at the C-mount's 17.526 mm, focus at the smallest f-number on the ring with a target at the true working distance, pick the working f-number from a depth budget — for a 35 mm lens at 200 mm working distance, F4 gives about ±0.37 mm of tolerance — then lock and re-check. Work through the six steps below and you finish with a focus that holds and an aperture chosen on purpose.
The six steps in brief
- Thread the lens into the mount until its flange seats fully — the seat, not the ring, sets the flange distance.
- Open the aperture to its widest setting, the smallest f-number.
- Place a flat, matte focus target at the measured working distance, square to the lens axis.
- Turn only the focus ring until the target is crisp at full magnification.
- Check center and corners wide open, then stop down to the working f-number and re-check.
- Snug the focus-ring locking screws and re-check the focus once more.
What you need
- A camera with live view you can magnify to 100 %, so you judge pixels rather than impressions. Browse the area scan cameras if you are picking one alongside the lens; the LS-CMR-0166, a 12 MP USB3 camera, streams 4000 × 3000 frames at 30 fps.
- Sensor format
- 1/1.7"
- Interface
- USB3
- Resolution
- 12 MP
- Shutter
- Rolling
- The lens and its datasheet, for the aperture range and the specified distance range.
- A flat matte target: a calibration plate with 0.5 mm dots, or fine print on matte paper. Glossy surfaces show highlights, not focus.
- A ruler or calipers for the working distance.
- The hex key that fits the lens locking screws.
- Adapter rings and extension tubes if the spacing needs work — the lens accessories category carries them.
The numbers: seat, magnification and depth budget
Two numbers run this procedure. The first is the seat: the C-mount standard fixes the distance from the mount face to the sensor at 17.526 mm. Threading the lens fully home sets that distance mechanically, and the focus ring then moves glass groups inside the barrel without disturbing the seat. That is the whole reason you focus with the ring and never by unscrewing the barrel. The thread itself is a 1-inch, 32 threads-per-inch UNS form, detailed in the C-mount thread article.
The second number is the depth budget. Magnification, field of view and depth of field all follow from four inputs:
Here f is focal length and WD is working distance, both in mm; N is the f-number; c is the circle of confusion, which you can take as one pixel for a strict check. The depth formula is the standard close-range estimate, valid while the depth of field is small next to the working distance — that covers most machine-vision set-ups. The working distance and field of view formula guide works another case end to end.
For the same example at other apertures:
| f-number | Total depth of field | Half in front / half behind |
|---|---|---|
| F2.8 | 0.52 mm | ±0.26 mm |
| F4 | 0.74 mm | ±0.37 mm |
| F5.6 | 1.04 mm | ±0.52 mm |
| F8 | 1.49 mm | ±0.74 mm |
| F11 | 2.04 mm | ±1.02 mm |
| F16 | 2.97 mm | ±1.49 mm |
For this example (c = 3.45 µm, m = 0.212) the budget works out to 0.186 × N mm; accept two pixels of blur instead of one and every number doubles.
The lens used in the example:
- Type
- Machine vision fixed
- Sensor format
- 2/3"
- Mount
- C-mount
- Resolution
- 6-10 MP
Run your own numbers in the depth of field calculator:
Step 1: thread the lens fully home
Turn the lens clockwise until the flange face stops square against the mount. Hand-tight is enough; the face, not muscle, sets the spacing. If the barrel sits proud at one edge, the thread is crossed — back it off and rethread rather than forcing it, because a tilted flange tilts the image plane and no ring position will rescue it.
A long barrel becomes a lever on a small mount: support the lens body with your free hand while threading, and never carry a camera by its lens. A cracked flange shows up later as a focus that will not settle. If a fully seated lens still cannot find a sharp image anywhere on the ring, suspect the camera's flange distance before the lens — fixing flange tolerance with shims covers that fault.
Step 2: open the aperture wide
Turn the aperture ring to its smallest f-number before touching focus. The bright image runs a short exposure with no gain, and the thin depth of field makes the true sharp plane obvious — wide open is the honest setting for focusing. Ranges differ by series.
The LS-FFL-0567, a 16 mm lens for 1.1" sensors, runs F2.8-22. Faster FA lenses commonly open at F1.4.
- Type
- Machine vision fixed
- Sensor format
- 1.1"
- Mount
- C-mount
- Resolution
- 16-25 MP
Keep the working f-number for Step 5. Focusing stopped down hides the error you are trying to remove: with deep depth of field, several ring positions look equally acceptable, and the plane you lock can sit near the edge of the budget without showing it. For how the f-number sets that budget, see aperture f-number and depth of field.
Step 3: set the target at the true working distance
Measure the working distance and put a flat target there, on the plane the parts will occupy. A calibration plate like the LS-LXR-0029 — a 0.5 mm dot grid on a 76 x 76 mm plate — works well; fine print on matte paper works too. Square the target to the lens axis within about a degree: a tilted target pushes one edge outside the depth budget even when the focus itself is perfect.
- Type
- Calibration targets
Focus at the distance the parts occupy in the cell, not at whatever the bench happens to give. A lens focused at 100 mm on the bench is not sharp at 300 mm on the line — focusing at the working distance covers that classic complaint.
Step 4: turn the focus ring, not the barrel
The ring does the focusing. Most industrial C-mount lenses sweep about 270° from the close limit to the far limit, so one slow sweep takes seconds. Approach the sharp plane from one direction each time: the helicoid has some backlash, and reversing direction mid-adjustment can mask part of the travel. Overshoot, come back from the same side, and stop when the dots are crisp.
Magnify the live image to 100 % before you judge anything. The focus preview zoom technique shows how to pin a small region and watch it while you turn the ring.
Step 5: check the corners, then stop down
At the widest aperture, judge the corners as well as the center. A lens focuses one plane, so field curvature or a slightly tilted sensor shows up as corner-only softness. Refocus to split the error so center and corners both sit inside the depth budget. If corners stay soft after an honest attempt, the sensor itself may be tilted — active sensor alignment is the camera-side fix to ask for.
Stop down to the working f-number and re-check. Pick the number from the budget table: take the placement tolerance the mechanics actually hold, double it, and choose the smallest f-number that covers it. Resist stopping further for safety's sake: with a 3.45 µm pixel under an 850 nm light, the Airy disk at F8 already spans 2.44 · 0.85 · 8 ≈ 17 µm, about five pixels, so extra f-number buys depth with sharpness. The diffraction limit sets that exchange, and the aperture, working distance trade-off walks the rest.
Step 6: lock the ring and re-check
Tighten the focus locking screws until snug — the screw stops turning under moderate finger force on the key. Crushing the helicoid leaves the ring gritty or frozen, and a ring that cannot move cannot be re-focused at the next changeover. Lock the aperture ring too where the lens gives it its own screws. Where the station vibrates — robot wrists, conveyors with a thump — put a drop of removable medium-strength threadlocker on the set screws. The lens locking screws article covers screw types and enclosure clearance.
Re-check the focus after locking. A stiff screw can walk the ring a fraction before it bites, and the lock belongs at the sharp plane, not beside it.
When the focus ring is not the answer
- CS-mount camera. C-mount optics expect a 17.526 mm seat; a CS-mount camera seats its sensor at 12.5 mm, five millimetres closer. The focus range then ends before sharpness at distance. A 5 mm C-to-CS adapter ring restores the spacing — C-mount versus CS-mount covers the pair.
- Fixed-magnification lenses. Some lenses carry no focus ring at all. The LS-FFL-1023 is fixed at 0.5x with a 150 mm working distance at F13.4; you set that distance mechanically and trim with spacers and shims.
- Type
- Machine vision fixed
- Sensor format
- 1/2"
- Image circle
- Up to 8 mm
- Closer than the close limit. Extension moves the usable range inward. The LS-LXR-0255 tube adds 15 mm of C-mount spacing; every added millimetre brings the sharp range closer and costs depth of field.
- Type
- Extension tubes
- End of travel, still soft. Work the list in order: adapter first, then the lens's specified distance range (focus range diagnosis), then flange tolerance as in Step 1.
Checklist before you release the station
- Flange seated fully and square; the barrel never used for focusing.
- Focusing pass made at the widest aperture.
- Target flat, matte, at the measured working distance, square to the axis.
- Focus approached from one direction and judged at 100 % magnification.
- Center and corners both sharp wide open, with any error split into the budget.
- Working f-number chosen from the budget table and re-checked after stopping down.
- Focus and aperture locking screws snug; threadlocker where vibration is real.
- Focus re-checked after locking and again after a 30-minute thermal soak at running speed.
If you are choosing the lens and camera together rather than rescuing one, start with the machine vision lenses page or the lens finder, or build the system around your sensor and working distance. The lenses topic page collects the rest of the focus and optics guides.
Questions
Can I focus a C-mount lens by screwing it in and out like an M12 lens?
No. An M12 (S-mount) lens has no focus ring, so the thread travel itself sets focus. A C-mount lens seats at a fixed 17.526 mm and focuses with its ring; screwing the barrel in and out changes the flange distance, so the image shifts while the optical path leaves the geometry the lens was corrected for, and vibration finishes the job by unscrewing it.
How do I focus a C-mount lens on a CS-mount camera?
You cannot reach a sharp distant image without spacing. A C-mount lens is designed for a 17.526 mm flange distance and a CS-mount camera puts its sensor at 12.5 mm, five millimetres closer, so the focus range ends before sharpness. Fit a 5 mm C-to-CS adapter ring between lens and camera, thread the lens fully home, and focus as normal.
What aperture should I focus at, and what aperture should I run at?
Focus at the widest aperture, the smallest f-number, because the thin depth of field shows the true sharp plane; run at the working f-number chosen from the depth budget. In the worked example at 0.212x, F4 tolerates about ±0.37 mm of part travel and F8 about ±0.74 mm; take the smallest f-number that covers your mechanical tolerance.
Why is the center sharp but the corners soft?
Three usual causes, in order: field curvature in the lens, a sensor tilted a fraction of a degree, and a target not square to the lens axis. Refocus to split the error so center and corners both fall inside the depth budget; if corners stay soft, ask for a camera with active sensor alignment before replacing the lens.
How tight should the focus locking screws be, and should I use threadlocker?
Snug, with moderate finger force on the hex key: enough that the screw will not turn, not enough to crush the helicoid. On stations with real vibration, such as robot wrists or conveyors, add a drop of removable medium-strength threadlocker to the set screws. Always re-check focus after locking, because the last fraction of a turn can walk the ring off the sharp plane.
My lens reaches the end of its focus travel with no sharp image — what is wrong?
Check three things in order: whether the camera is CS-mount, which needs a 5 mm adapter ring; whether the working distance is inside the lens's specified range; and whether the camera's flange distance is within tolerance. If the first two are fine, an out-of-tolerance flange shows exactly this symptom, and shimming the mount restores it.




