Light control & strobingGuide

Closed loop lighting control for repeatable vision images

Design closed loop lighting control using a stable reference, fixed camera settings, bounded LED corrections and drift alarms that protect inspection.

LumaSpec Vision11 min read Share on LinkedIn

On this page 11 sections
  1. 01Decide what the loop may correct
  2. 02Choose a reference that cannot follow the defect
  3. 03Build a trustworthy brightness measurement
  4. 04Use bounded corrections rather than unrestricted normalization
  5. 05Work through an illustrative correction
  6. 06Associate each measurement with the correct light command
  7. 07Select hardware by electrical compatibility and control access
  8. 08Validate inspection performance, not just the reference trace
  9. 09Recognize when feedback is the wrong fix
  10. 10Check the design before ordering and release
  11. 11Questions

Image brightness can drift even when the inspected parts remain unchanged. A feedback loop can correct some of that drift, but a poorly chosen reference can also hide defects or drive illumination beyond useful limits. This guide explains how to build a supervisory lighting loop around a stable image region while keeping exposure and gain fixed. You will define its measurement, limit its authority, select compatible hardware and verify that brightness correction preserves inspection performance.

Decide what the loop may correct

Closed loop lighting control measures an image reference, compares it with a target and adjusts the light command. It should correct slow changes in delivered illumination, not normalize every product image to the same average brightness.

A simplified model for a linear, unsaturated image region is:

y = g × t × R × (L_LED + L_ambient)

Here, y is the black-level-corrected image signal, g is camera gain, t is exposure time and R represents the reference reflectance and optical throughput. The illumination terms describe the effective contributions reaching that region. This approximation assumes unchanged geometry and a stable spectral response.

With exposure, gain and the reference fixed, changing LED output can bring y back toward its target. However, the same measurement cannot identify which term originally changed. A darker reference might indicate LED drift, contamination, a moved target or an acquisition fault.

Define a narrow correction objective: maintain the validated reference signal within a specified band, subject to command limits and independent quality checks. Review the camera image quality settings guide before adding feedback. Automatic exposure or gain can otherwise compete with the lighting loop.

Choose a reference that cannot follow the defect

Use a fixed reference patch visible through the inspection optics whenever practical. Its position, surface condition and illumination geometry should remain stable throughout production. Keep it outside product features used to decide acceptance.

A patch near the image edge is convenient, but it must experience illumination changes representative of the inspection region. A reference under a separate light does not measure the same optical path. A glossy reference can also respond strongly to small angular changes.

Choose the reference using these checks:

  • Its reflectance is stable over the expected maintenance interval.
  • Its image remains clear of shadows, product occlusion and strong reflections.
  • Its signal stays above the noise floor and below clipping.
  • Its position can be verified independently of its brightness.
  • A change in the actual defect does not change the reference measurement.

For example, a 40 × 40 pixel region contains 1,600 pixels. Averaging those pixels reduces independent random noise, but it does not remove correlated flicker, a moving shadow or surface contamination. Inspect the region spatially instead of relying only on its mean.

If no fixed reference fits in the production image, consider a dedicated reference capture between inspection cycles. Treat product-based normalization as a different measurement strategy. It can erase legitimate shade or coating differences and should not be introduced as a substitute without validation.

Build a trustworthy brightness measurement

Start with linear image data where available. Hold exposure, gain, black-level settings, gamma and processing corrections fixed. On a color camera, also hold white balance fixed and define which channel or channel combination drives the loop.

A practical measurement sequence is:

  1. Locate the reference and verify its expected position.
  2. Reject the frame if the reference is occluded or clipped.
  3. Calculate a mean or trimmed mean within the valid reference region.
  4. Subtract the validated black-level offset.
  5. Record the measurement with the frame identifier and active light command.

A trimmed mean can reduce the influence of isolated bright or dark pixels. It cannot make an occluded reference valid. Keep separate limits for clipping, patch visibility and spatial variation.

For an illustrative 8-bit measurement, suppose the reference averages 128 counts and the validated black offset is 8 counts. The corrected signal is 128 − 8 = 120 counts. Use that corrected value consistently when calculating relative errors.

Do not chase every noisy frame. A five-frame moving average can smooth random fluctuations, but it also adds delay. Begin with slower updates and evaluate the resulting response before adding more filtering.

For color-sensitive inspection, monitor channel ratios as well as brightness. The discussion of white LED color temperature explains why equal brightness does not establish equal spectral conditions.

Use bounded corrections rather than unrestricted normalization

A supervisory loop usually needs less authority than a general-purpose process controller. Start with a modest proportional correction, a deadband, a maximum command change and absolute output limits.

One possible update law is:

If the reference is invalid or y <= y_min: hold the command and raise a diagnostic If abs(r - y) <= d: hold the command Otherwise: delta_u = clip(K × u × (r - y) / y, -s, +s) u_next = clip(u + delta_u, u_min, u_max)

Here, r is the target signal, y is the measured signal, u is a normalized light command and K is a dimensionless correction factor. The deadband is d, the maximum command increment is s and the absolute limits are u_min and u_max. These are application settings, not controller specifications.

The normalized command does not imply that optical output is linear with the controller setting. Characterize that relationship over the intended operating range. If it is strongly nonlinear, use a measured lookup table or a smaller correction factor.

Initially, avoid integral action unless a demonstrated residual error requires it. If integral action is added, include anti-windup and freeze its accumulation whenever the reference is invalid or the output is limited.

Require a persistent error before declaring a drift alarm. Also alarm when the command reaches a boundary without restoring the reference. Holding the last valid command should remain visible as a diagnostic state, not appear to be successful regulation.

Work through an illustrative correction

Assume commissioning establishes these application settings:

Parameter Illustrative value Purpose
Corrected reference target 120 counts Validated operating brightness
Deadband ±2 counts Avoid unnecessary small corrections
Initial normalized command 0.50 Starting operating point
Command bounds 0.20 to 0.80 Restrict correction authority
Correction factor 0.20 Apply only part of the estimated correction
Maximum increment per update 0.01 Limit abrupt changes

These values demonstrate the method; they are not universal tuning recommendations. The deadband corresponds to 2 / 120 × 100 = 1.7% of the target signal.

Suppose the corrected reference falls to 108 counts. Its relative error is:

relative error = (120 - 108) / 108 = 0.111 requested increment = 0.20 × 0.50 × 0.111 = 0.0111 limited increment = 0.01 next command = 0.50 + 0.01 = 0.51

Apply the new command, wait for it to take effect and measure again. Do not repeatedly calculate corrections from frames captured before the change.

At commissioning, one update per second might be a reasonable starting experiment for slow drift. Measure the actual response before selecting the final interval. Faster production acquisition does not automatically require a faster supervisory loop.

For an illustrative persistence rule, five consecutive valid measurements outside the deadband would raise a drift warning. A reference-position failure should instead invalidate feedback immediately. Different fault mechanisms need different timers.

Associate each measurement with the correct light command

The control calculation can be correct while the implementation oscillates because it uses stale images. Acquisition buffering, controller communication and light settling all contribute delay.

Timestamp command requests, acknowledge completion where supported and identify the first frame captured under the new condition. Exclude transitional frames from the next correction. The guide to per-frame exposure and gain verification provides a related method for checking acquisition state rather than assuming a request took effect.

For strobed illumination, keep exposure timing and pulse duration fixed while adjusting the permitted intensity parameter. Changing pulse width can also change motion blur or the fraction of exposure receiving light. Follow the separate guidance on strobe duty cycle and timing before commissioning pulsed operation.

Startup deserves its own state. Load the validated recipe, confirm camera settings, establish the initial light command and collect stable reference frames before enabling correction. If the first capture differs from later captures, investigate first-frame exposure and lighting timing rather than allowing feedback to compensate immediately.

Never assume that a digital controller supports a particular command rate, readback function or synchronization method. Confirm those details in the applicable manufacturer documentation before designing the update sequence.

Select hardware by electrical compatibility and control access

The image-analysis application can implement the supervisory loop, provided the selected controller offers a documented means of setting output. A digital control classification alone does not establish image feedback, a communications protocol or closed-loop functionality.

Start with the light controllers category and use the light controller finder to narrow electrical requirements. Match the light's required drive method, connector arrangement, polarity and allowed operating range before considering software integration.

The LS-CTL-0290 is a digital constant-voltage controller candidate. Confirm its documented control interface and compatibility with the intended light before assigning it to the feedback application.

Light controllersDigital constant-voltage light controller, 60 W, 4 channels (LS-CTL-0290)LS-CTL-0290
Output
Constant voltage 24 V
Channels
4 channels
Control
Digital
$449.00View partBuild a system with it

The LS-CTL-0180 provides a constant-current output alternative. Constant-current and constant-voltage drive methods are not interchangeable merely because both can vary apparent brightness.

Light controllersConstant current controller, 4 ch, 120 W, 89 x 147 mm, for 24 V lights (LS-CTL-0180)LS-CTL-0180
Output
Constant current
Channels
4 channels
Control
Digital
Feature
Constant current
$359.00View partBuild a system with it

For pulsed applications, the LS-CTL-0070 is identified with a strobe feature. Its suitability still depends on documented triggering, output limits and the selected light's requirements.

Specification LS-CTL-0290 LS-CTL-0180 LS-CTL-0070
Trigger mode External trigger and internal trigger Edge + level trigger –
Input voltage 100 ~ 240 VAC, 50/60 Hz – 24 V DC
Output voltage 24 VDC – 24 V
Baud rate – 9600-115200bps optional 9600 bps
Control – Digital (4-digit display, buttons), RS232 Manual encoder knob adjustment, PC remote adjustment
Number of channels – 4 4
Working mode – 0: constant off, 1: constant on, 2: strobe, 3: trigger delay shutdown Constant on / Trigger / Strobe
Dimensions (mm) – 89 x 147 x 175 W 100 x H 156 x D 134 (from the drawing; body 149 high, 110 deep)
Price $449.00 $359.00 $549.00

Values as printed in each product's data sheet; open a part for its drawing and full specifications.

Retain the existing camera if it supplies suitable images and stable manual settings. When selecting a replacement, compare area scan cameras through the camera finder. Prioritize the required shutter behavior, usable signal range, acquisition timing and access to unaltered image data rather than resolution alone.

Validate inspection performance, not just the reference trace

First establish a baseline with feedback disabled. Record reference brightness, inspection-region statistics, defect scores, clipping and the light command. Include known acceptable parts and representative defects.

Then enable feedback and introduce controlled disturbances within the approved operating envelope. Use documented output adjustments or approved test conditions; do not exceed electrical or optical ratings.

A useful validation matrix includes:

Test Expected loop behavior Independent acceptance check
Small illumination reduction Bounded recovery toward target Defect separation remains acceptable
Reference occlusion Freeze correction and flag invalid reference No command increase based on the obstruction
Darker product with unchanged reference No brightness correction Product difference remains measurable
Persistent error at command limit Limit holds and alarm becomes active Inspection enters its defined fault response
Delayed command application Wait for confirmed acquisition state No repeated correction from stale frames

Run both darker and brighter disturbances. Check for overshoot, alternating corrections and long recovery times. Repeat at the extremes of the validated production conditions, not only with a stationary reference during setup.

Record the difference between reference stability and inspection stability. A reference held within ±2 counts is useful only if the actual acceptance measurement still separates acceptable and defective parts with the required margin.

Recognize when feedback is the wrong fix

Feedback should not compensate indefinitely for a deteriorating optical system. Contamination can scatter light and reduce contrast even after the reference mean recovers. Defocus can leave average intensity almost unchanged while destroying edge detail.

Ambient illumination is another limit. The controller can reduce its own contribution, but it cannot subtract external light. If ambient illumination alone exceeds the reference target, the loop has no usable correction direction. Reduce the disturbance or redesign the optical arrangement instead.

For intermittent banding or brightness changes between frames, investigate camera flicker under artificial lighting. A slow brightness loop cannot repair illumination variation occurring within an exposure.

Likewise, a reference in one location may miss a changing illumination gradient across a large scene. Check spatial uniformity using the methods in the large field of view lighting guide.

Treat a steadily increasing command as a maintenance indicator. Preserve the command history and investigate the cause before reaching the upper limit. The lighting loop and its alarms are inspection functions, not substitutes for machine safety functions.

Check the design before ordering and release

Use this short checklist to turn the concept into a documented operating recipe:

  • Define the reference material, position, valid region and replacement procedure.
  • Record fixed exposure, gain, image processing and color settings.
  • Set the target, deadband, update interval, slew limit and command bounds.
  • Confirm the light's electrical compatibility and permitted operating conditions.
  • Verify the controller interface, update behavior and startup state.
  • Separate reference-validity alarms from persistent brightness-error alarms.
  • Define what inspection does during startup, saturation and missing feedback.
  • Validate known defects before and after correction, retaining the measurements.
  • Set maintenance limits for command drift and reference deterioration.

Save these settings by inspection recipe rather than letting a single target serve unrelated products. A recipe change should reset or deliberately restore the loop state according to the validated startup procedure.

Use the controller configurator to organize the electrical requirements. If compatibility or feedback timing remains uncertain, send the light requirements, acquisition timing and proposed reference method through application support before ordering.

Questions

Should closed loop lighting control use the whole image?

Use a stable reference that is independent of the product feature being inspected. Whole-image brightness changes with part position, surface coverage and genuine defects. Feeding those changes into the lighting command can hide the very differences the inspection needs to measure.

Does a constant-current controller already regulate image brightness?

Constant-current operation regulates an electrical quantity, not the image signal. Optical output, geometry, surface reflectance and camera settings can still change the measured brightness. Image feedback adds a separate supervisory function, but it requires a suitable reference and a documented controller interface.

How quickly should the lighting loop update?

Set the update interval from the drift rate and measured system delay, not the production frame rate alone. Slow illumination drift often needs only occasional corrections. Wait until the commanded change appears in acquired images before calculating another adjustment, and validate stability under realistic acquisition delays.

What should happen when the reference disappears or output reaches its limit?

Invalid reference measurements should stop further correction and raise a diagnostic. A persistent error at the permitted output boundary should produce a separate limit alarm. The inspection must then follow its documented fault response rather than treating the held command as proof of acceptable imaging.

Does stable brightness guarantee stable inspection accuracy?

No. Restoring a reference mean does not restore focus, spatial contrast or spectral balance. Keep independent checks for those properties and validate actual defect detection across the allowed correction range. Treat growing correction demand as a reason to investigate maintenance or environmental changes.