A brand-new global shutter camera that arrives shooting soft, uniformly blurred frames almost always has one cause: the lens is mechanically focused for a different distance. Global shutter fixes rolling-shutter skew, not focus. This guide is for anyone bringing up a board-level or area scan camera with an M12 lens on a bracket, a robot wrist or a production line. You will separate defocus from motion blur, compute how far to unscrew the lens before touching it, set and lock focus at your real working distance, and know how much drift to expect afterwards.
Why does a new global shutter camera return a blurry image?
Almost always the lens is focused for the wrong distance, not a shutter fault. A global shutter removes rolling-shutter skew, but it cannot remove defocus. M12 lenses usually arrive threaded close to their infinity-focus position, so every close working distance looks uniformly soft.
A global shutter exposes all pixels at once, removing the skew and partial-exposure artifacts a rolling sensor produces on moving scenes. It does nothing about a lens whose image plane sits millimetres away from where the sensor sits. On an M12 board camera there is no autofocus — the screw thread is the focus actuator, and the factory setting suits a far scene, not your bench. Every build on board-level cameras with an M12 mount inherits this; a typical part is the MV-CB016-10GM-M-W, a 1.6 MP GigE board-level camera with an IMX296 sensor, global shutter and M12 mount.
- Sensor format
- 1/2.9"
- Lens mount
- M12
- Interface
- GigE
- Resolution
- Up to 3 MP
Is it defocus or motion blur?
Freeze the scene first. When a taped-down target stays equally soft in every frame, the lens is defocused. When the target is sharp but moving parts smear along their direction of travel, the exposure time is too long — and no shutter type removes that smear.
The two failures look similar in a saved frame and behave differently live. Defocus is uniform: everything softens together, and the blur does not change when the motion stops. Motion smear is directional and proportional to exposure time — a part moving 100 mm/s during a 1 ms exposure smears 0.1 mm on the object. Halve the exposure on the same scene and motion smear halves while defocus stays put. That test, plus more exposure limits for moving targets, is covered in cap the maximum auto exposure time; the sensor-type trade itself is explained in global vs rolling shutter sensors.
How many turns does it take to focus an M12 lens?
Compute the extension before touching anything: δ = f²/(WD − f), so a 12 mm lens brought to a 150 mm working distance needs 144/138 ≈ 1.04 mm of extension — about 2.1 turns on a standard M12×0.5 thread, unscrewed away from the sensor from the infinity position.
Worked example, using a 12 mm lens at 150 mm working distance:
- δ = 12² / (150 − 12) = 144 / 138 = 1.04 mm
- turns = 1.04 / 0.5 = 2.1 turns out, about 750°
- sensitivity: WD²/f² = 150²/12² = 156 mm of focus travel per millimetre of thread, so one full turn moves the sharp plane about 78 mm and a quarter turn about 20 mm
If the lens arrives one turn in from the infinity position, its best focus already sits near 12 + 144/0.5 = 300 mm, and you need roughly one more turn to reach 150 mm. Wide lenses flip the intuition. A 2.8 mm lens at 150 mm needs only 2.8²/147.2 ≈ 0.053 mm — about 38° of rotation — and one full turn swings its best focus by roughly 1.4 m. That is why wide M12 lenses look either already sharp or hopelessly off with almost nothing in between. The same physics is what fixes blurry close-range shots on wide camera modules. Thread pitch is the multiplier in all of this, and M12 thread pitch and focus shift works through it.
The lens behind these numbers is a common one — a 12 mm, 5 MP low-distortion M12 lens for a 1/1.8-inch sensor:
- Sensor format
- 1/1.8"
- Mount
- M12
- Resolution
- 5 MP
- Image circle
- 8-11 mm
Pick the focal length for the field of view first, from the M12 board lenses range, then set focus mechanically — the order of those decisions is laid out in choose a board camera lens by working distance and field of view.
How do you set and lock the focus?
Focus is set mechanically in five moves: live view at full sensor resolution, a target taped at the exact working distance, half-turn steps to get close, small-degree steps to finish, then the lock ring run up against the mount so vibration cannot rotate the barrel.
- Tape a target with fine detail — printed text or a checkerboard — at the working distance, measured to the front of the lens.
- Open live capture at full sensor resolution with exposure and gain fixed; a scaled preview hides defocus, so judge only at 100 %.
- Unscrew in half-turn steps. Unscrewing moves the lens away from the sensor and pulls best focus closer; screwing in pushes focus farther out.
- Inside the last half turn, work in 10-15° steps — at the 12 mm and 150 mm numbers above, each 15° step moves best focus about 3 mm.
- Check the corners while you finish: they should sharpen with the centre. One-sided softness means a tilted seat; reseat the lens square and repeat.
- Hold the barrel still and run the thin lock ring forward until it bears on the mount, finger-tight. The ring keeps vibration from rotating the focus thread.
- Re-check focus after routing cables and again once the camera reaches operating temperature.
The corner check and the lock-ring routine are the same ones detailed step by step in M12 lens focusing: adjust, check corners and lock.
How much focus error can you tolerate?
At 150 mm working distance a 12 mm F2.8 lens on a 5 MP 1/1.8-inch sensor holds about ±1 mm depth of field for a one-pixel blur circle, ±2 mm at two pixels — a lock ring that slips a quarter turn wipes the margin out.
Here m = 12/138 = 0.087, the f-number N = 2.8, and a 5 MP layout on a 1/1.8-inch format has pixels near 2.8 µm (7.2 mm ÷ 2592 pixels). The estimate gives 2 × 2.8 × 2.8 µm / 0.087² ≈ 2.1 mm of total depth, about ±1 mm. Stopping down one stop to F5.6 doubles it to ±2 mm but costs a factor of four in exposure time — which is how defocus margin quietly turns into motion smear on a moving line. Run your own combination through the depth-of-field check:
Most M12 board lenses fix the aperture at the factory, so you choose depth of field when you choose the lens. All three below mount on any M12 board camera and cover a 1/1.8-inch image circle:
- Sensor format
- 1/1.8"
- Mount
- M12
- Sensor format
- 1/1.8"
- Mount
- M12
- Sensor format
- 1/1.8"
- Mount
- M12
The LS-MBL-0113 is the bright option — a 12 mm, F2.8, 5 MP lens for 1/1.8-inch sensors with the thinnest focus margin of the three. For longer stands, the LS-MBL-0031 is a 25 mm, 5 MP lens for the same 1/1.8-inch format. At a 300 mm working distance its focus sensitivity works out to 0.5 × 300²/25² = 72 mm per turn — nearly the same behaviour as the 12 mm lens at 150 mm.
Why does focus drift after you set it?
Two mechanisms undo a focus setting. The first is a barrel that vibration slowly rotates — a quarter turn moves best focus about 20 mm at these distances. The second is temperature, which changes barrel and optics dimensions until the camera reaches thermal equilibrium.
Vibration loss is preventable: a lock ring seated against the mount and a rigid bracket are usually enough on their own. Temperature loss is managed, not prevented: a station that is sharp at start-up and soft after an hour of running is the classic signature, and camera focus drift with temperature walks through the diagnosis. On moving arms the same mechanism shows up as a wrist camera that blurs whenever the program runs.
What if the image stays blurry after focusing?
Work the remaining causes in order of probability: a protective film still covering the sensor window, condensation on that window, a tilted or damaged lens seat, then the sensor or the link itself — each has a one-minute test before you replace hardware.
| Order | What you see | Likely cause | One-minute test | Fix |
|---|---|---|---|---|
| 1 | Uniformly soft, static scene | Lens focused for another distance | 100 % view of a taped target | Set focus at working distance, lock the ring |
| 2 | Sharp still scene, smeared moving parts | Exposure too long for the speed | Halve exposure: smear halves | Shorter exposure, more light, or strobe |
| 3 | Centre sharp, corners soft | Tilted seat or field curvature | Focus sweep: corners peak with centre? | Reseat square; split focus centre/corner |
| 4 | Soft even through a full focus sweep | Film, dust or condensation on the window | Bright light raked across the window | Peel the film; clean and dry the window |
| 5 | Fixed dark spot or dead columns | Sensor defect or corrupted link | Raw capture, second lens | Isolate format and wiring before replacing |
Before ordering hardware, the isolation routine in black spot in camera image rules out a persistent defect, and the format checks in board level camera image corrupted rule out the link itself.
The decision, one line per case: static and uniformly soft — set focus at the working distance and lock it; sharp when still, smeared when moving — cut exposure and add light; soft after locking — film, condensation or a tilted seat; thread ran out — a spacer or a longer focal length. For a new camera build, run the whole bring-up against the board camera evaluation checklist so focus, format and mounting are signed off together.
The same routine covers c-mount area scan cameras — only the flange mechanics differ. To size the pairing, start at the camera configurator or the lens step; the lens finder and camera finder filter by sensor format and focal length. If a lens and camera still refuse to snap in, send the working distance, sensor and lens list through the contact page and we will size the optics with you. More bring-up guides sit on the cameras topic page.
Questions
Does a global shutter eliminate motion blur?
No. A global shutter removes rolling-shutter skew, not blur. Blur comes from exposure time: a part moving 100 mm/s during a 1 ms exposure smears 0.1 mm on the object, about 3 pixels on a sensor with 2.8 µm pixels imaging at 0.087 magnification. Cut exposure, add light or strobe to freeze motion.
Why is the centre sharp but the corners soft after focusing?
Usually field curvature or a tilted lens seat. A flat target imaged through a curved focal surface cannot be sharp everywhere at once: focus halfway between the sharpest centre and sharpest corner, or stop the aperture down if the lens allows it. One-sided softness that follows one direction points to a tilted seat — reseat the lens square and refocus.
How tight should the M12 lock ring be?
Snug finger-tight is enough — the ring only has to stop the barrel rotating, and over-tightening tilts the lens or crushes fine threads. If vibration still walks the focus through a shift, add a small dot of low-strength removable thread adhesive to the lock ring only, never to the focus thread you may need to turn again.
My lens runs out of thread before it reaches focus — what now?
The thread cannot provide the extension your distance needs. Add a shim or spacer: a 0.5 mm spacer on a 12 mm lens moves the far focus limit to about 300 mm (12 + 144/0.5) and pulls everything closer into the travel the thread has left. Beyond two or three spacers, a longer focal length is the cleaner fix.



