A code reader that passed commissioning and now grades its codes a step below the release limit does not need a new camera; it needs its photometry recalibrated — gain, exposure and focus together. On readers with the classic serial command set, the automatic calibration of photometry is one command that sets all three in a single pass. The catch is scheduling: the full routine must run with the inspection stopped, while each parameter can be trimmed individually during runtime once it is linked to a live parameter ID. Below are both procedures: the offline calibration sequence in the right command order, the exposure-before-gain rule that keeps the result out of the noisy high-gain region, and the working-distance budget that tells you when a live focus trim is enough and when the line should stop for a recalibration.
The decision: full calibration offline, individual trims live
Run the full automatic calibration when photometry as a whole is wrong: at commissioning, after any change to the light, the lens, the bracket or the label stock, and whenever decode grade drops below your release limit for no visible cause. Between those events, do not stop the line for a calibration; adjust the one parameter that actually moved, live, over the command channel.
The split exists because of who owns the sensor. The automatic calibration sweeps focus and drives exposure and gain at the same time; a running inspection already claims frames on every trigger. So the routine runs stopped — a few seconds of downtime — and the live parameter IDs handle everything else. Fixed code readers connect over Fast Ethernet, GigE or serial, which puts the command channel on wiring you already have.
| Situation | What to do | Line stops? |
|---|---|---|
| Commissioning, new label stock, light or bracket moved | Full offline calibration (procedure below) | Yes, seconds |
| Line speed changed | Re-trim exposure live against the blur budget | No |
| Label height wanders inside the depth-of-field budget | Trim focus live | No |
| Decode grade sags for no visible cause | Full offline calibration, then re-verify | Yes, seconds |
The same two-track pattern — whole routine offline, individual parameters live — is how smart cameras separate photometry calibration from runtime trims.
What you need
- A command session to the reader: Telnet to its command port, or a serial console. The first-connection habits matter here — the USB setup and readback checks for a fixed code reader are the model to follow: connect, read the state back, then act.
- The reader's desktop configuration tool, used once to link the photometry parameters to live parameter IDs.
- Production lighting firing exactly as in the running cell. A strobed station needs its light controller enabled and wired to the reader's trigger output.
- A tray of labels that includes your worst code: lowest contrast, smallest modules, most curvature — not just the golden part.
Run the full photometry calibration offline
- Open the command session. Telnet to the command port or open the serial console, and confirm the reader answers before touching anything else.
-
Stop the inspection. Send
offline. This halts all inspections; the reader stops acquiring on trigger. - Stage the target. Put a production code at true working distance, at the same height and tilt the line presents, with the cell in its normal setup state. A repeatable staging position is what makes calibrations comparable — see the repeatable camera position for focus calibration.
-
Run the calibration. Send
autocal. The routine calibrates the photometry settings — gain, exposure and focus — in one pass. - Read the settled values back. Note the exposure time, the gain and the focus position it landed on. This triple is your commissioning baseline and the first place to look when grade drifts later.
- Store the values. Issue the save command from the same command set so a power cycle keeps the calibration, then read back once more to confirm the stored copy matches.
-
Restart the inspection. Send
online; all inspections start again. - Prove it on parts. Trigger at least 100 cycles across the worst labels and check decode rate and grades before releasing the line — triggered cycles, not free-run, so every frame corresponds to one part (the GPIO trigger instead of free-run wiring is the clean way to get this).
Set exposure before gain
Exposure time buys signal for free: a longer integration gathers more photons and adds no noise of its own. Gain buys brightness the expensive way: it multiplies sensor noise along with the signal. So cap exposure first, at whatever the physics allows, and let gain cover only the remainder. That single ordering is what keeps a calibration — and every live trim — out of the noisy high-gain region.
Exposure has two ceilings. The bright one is saturation: label whites clip and grades fall. The hard one is motion blur, because blur length equals part speed times exposure time.
Worked example, used through the rest of this guide: a monochrome reader with a 1280 × 1024 sensor of 3.75 µm pixels behind a 12 mm lens set to f/2.8, reading a code field 30 mm wide.
- Magnification: m = 4.8 mm ÷ 30 mm = 0.16.
- Working distance: WD ≈ 12 mm × 1.16 ÷ 0.16 = 87 mm.
- Pixel size on the part: 3.75 µm ÷ 0.16 = 23.4 µm.
- At a belt speed of 300 mm/s (300,000 µm/s), one pixel of blur takes 23.4 µm ÷ 300,000 µm/s = 78 µs.
So the exposure ceiling is 0.078 ms. If the image is still dark at 78 µs, the fix is more light or a wider aperture — not a longer exposure, and not gain. Cap the exposure at that ceiling before the routine runs; the auto-exposure cap that stops motion blur applies the same logic to a general camera. Whatever brightness is still missing, gain supplies — and the least gain that reaches the target wins. Set the target where your release test grades well; the auto-exposure brightness target for inspection covers picking it.
How far focus can drift before you must recalibrate
Focus is the one photometry parameter with a physical budget: depth of field. Inside it, the image stays sharp enough to decode and no trim is needed. Outside it, the blur is optical and no focus value fixes it — the distance itself moved, so focus must be swept again at the new distance, which is exactly what the offline routine does.
The thin-lens approximation, with N the f-number and c the circle of confusion you still accept as sharp — take 2 pixels. For the worked example, N = 2.8, c = 2 × 3.75 µm = 7.5 µm, m = 0.16:
DOF ≈ 2 × 2.8 × 0.0075 mm × 1.16 ÷ 0.0256 ≈ 1.9 mm total, about ±0.95 mm around the 87 mm set distance.
Decision rule: labels that stay within ±1 mm of the calibrated distance need nothing more than a live focus nudge when they drift. A fixture that can move the surface more than that — stack-height changes, a new container, a bumped bracket — needs the offline calibration, because its focus sweep is what finds the new peak.
Put your own focal length, f-number, pixel size and height tolerance into the depth-of-field calculator below and keep the result with the commissioning sheet.
Trim exposure, gain and focus live during runtime
The live path needs one preparation step, done once: in the reader's desktop configuration tool, select the photometry parameters and close each one's padlock. That links the menu value to a live parameter ID. From then on, the inspection keeps running while you write new values over the command session — Telnet in the classic set — with no offline and no restart.
In the classic set, exposure time sits on float101 and focus on int101; gain takes its own ID in the same block once linked. A write applies on the fly, and the next triggered frame already uses the new value. Three trims are worth wiring up this way:
- Exposure, when line speed changes. Recompute the blur budget and write the new ceiling first.
-
Focus, when label height wanders. A few tenths of a millimetre inside the depth-of-field budget is a live nudge on
int101; beyond the ±1 mm of the example budget, stop and recalibrate. - Gain, last. With exposure already at its ceiling, the least gain that holds the brightness target is the right value; every step above it spends signal-to-noise ratio.
If a live write does not take effect, the usual culprit is an active auto mode holding the parameter — turn auto gain off first, the same fix as on a general camera (gain settings not applied: turn auto gain off). Writing parameters live without stopping the pipeline is a general pattern too; changing camera gain at runtime without stopping the pipeline is the closest parallel on a camera line.
Verify the run before you release the line
A calibration is finished when the release test passes on real parts, not when online answers.
- Trigger 100+ cycles across the worst tray labels, not just the golden part.
- Judge the decodes, not only the count: a reader decodes a marginal code on a rigid bench and loses it under line vibration. The read confidence checklist defines what a trustworthy decode looks like.
- Run the full label verification once per calibration run and file the grade report next to the settled values.
- Ambient light is part of photometry. Calibrate under the brightest hall lighting the station will see, or shield the station; the ambient light rejection specification shows how acceptance tests pin this down.
- Log the triple — exposure, gain, focus — with date and reason. The next drift investigation starts from that line, and a value that moved tells you which hardware moved with it.
Grades sitting exactly at the release limit mean the run is not done: add light or aperture, recalibrate, and release with margin.
When the usual answer is wrong
- Shiny or curved packaging. A calibration maximizes whole-image contrast and can settle on a glare hotspot instead of the code. Fix the geometry first — polarized or dark-field lighting on the label — then calibrate; the routine only balances what the optics deliver.
- Parts that pitch in flight. A focus staged on a bench part lies if the part rides higher on the conveyor. Stage at the true in-flight position, or widen the depth-of-field budget with a smaller aperture and pay for it in light.
- Each label variant is its own photometry problem. A direct part mark on matte plastic and the same code laminated under gloss need separate calibration runs; keep one stored job per variant.
- The split is plant-wide. Drives separate big changes offline from trims online the same way; how online versus offline parameter changes work on a VFD walks the same decision on a drive.
Parts for this workflow and the next step
The class: compact fixed code readers with a command channel over Fast Ethernet, GigE or serial, sized from the camera finder. Where throughput is the constraint, the LS-CRD-0028 reads up to 60 codes/s at 30 fps through its 8 mm lens.
- Interface
- GigE
- Resolution
- Up to 3 MP
- Interface
- Fast Ethernet
- Resolution
- 5 MP
- Interface
- GigE
- Resolution
- 6-10 MP
For the 12 mm geometry of the worked example, the MV-ID3013PM-12M-WBN pairs a 1.3 MP global-shutter sensor with a 12 mm lens over Fast Ethernet.
- Interface
- Fast Ethernet
- Resolution
- Up to 3 MP
- Shutter
- Global
- Lens mount
- M12
A strobed station adds a light controller on the trigger line; this one switches four 24 V channels at 200 W and is set over RS232, and the light controller finder sizes the rest.
- Output
- Constant voltage 24 V
- Channels
- 4 channels
- Control
- Digital
- Feature
- Strobe
Size the field of view and working distance first, then start at the camera step of the configurator below. More commissioning procedures sit on the code-reading topic page.
The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.
Questions
Why must the full photometry calibration run offline?
The autocal routine adjusts gain, exposure and focus in one pass and needs exclusive control of the sensor while it does. During runtime the trigger pipeline owns frame acquisition, so the two would fight over the same frames. Stopping the inspection with the offline command frees the sensor for a few seconds, and the online command hands it back with the new values active.
Can I change exposure and focus while the inspection is running?
Yes, once each parameter is linked to a live parameter ID in the configuration tool and its padlock closed. In the classic command set the exposure time sits on float101 and focus on int101; a write over Telnet applies on the fly, with no offline step and no restart. Link gain the same way if you trim it live too.
How often should the automatic calibration be re-run?
Run it at commissioning, whenever the light, lens or bracket changes, and whenever decode grade falls below your release limit. Between those events the depth-of-field budget decides focus: for the 30 mm field example in this guide that is about ±1 mm of working distance, so a bracket knocked by more than that needs the offline calibration rather than a live trim.
Should exposure or gain be set first?
Exposure first, up to the motion-blur limit. Integration time adds signal without adding noise, while every step of gain amplifies sensor noise along with the signal. Capping exposure at the blur budget first means the brightness target is reached with the least gain, which is exactly where a calibration should converge — and it is the same order for manual live trims.
Do the calibration results survive a power cycle?
Store them first. The routine writes the values into the working set; after autocal, issue the save command from the same command set, then power-cycle the reader once during commissioning and read the three values back to confirm the stored copy loaded. That one reboot proves the calibration will survive the weekend shutdown.
Does strobed lighting change the calibration procedure?
It changes the conditions, not the commands. Run the routine with the strobe enabled and triggered exactly as in production, so exposure is measured against the light pulses the sensor will actually see. Calibrating against a continuously lit bench — or a strobe that is not firing — drives gain to the ceiling, and the values will not transfer to the line.




