Your capture script pulls ten frames and one comes back with black bars across it. The next nine are clean, then another striped frame appears. Nothing else changed: same part, same lens, same room lighting. That pattern — periodic bands, in a minority of frames, on an otherwise well-exposed image — is the signature of an exposure time beating against a pulsed light source, and it is a settings and drive problem, not a camera fault. What follows gives you the numbers behind the bars, a five-minute bench test that names the culprit, and a decision between three fixes: a whole-period exposure, a DC-driven light, or a strobe from a controller.
The decision first
Bars that come and go while the rest of the image stays sharp are arithmetic, not damage: the exposure time is not a whole multiple of the light's pulse period, so some rows integrate a bright slice of each light cycle and others a dark slice. Three fixes, in order of cost:
- Set a whole-period exposure. 20.00 ms on 50 Hz mains, 16.67 ms on 60 Hz. Costs nothing, works the moment you type it, and holds as long as the part can stand the exposure time.
- Take the flickering source out of the image. Drive your own light from a DC controller, hood the station, and the exposure is free again.
- Strobe from a controller. The light is on only during the exposure, so room lighting stops contributing and no period matching is needed at all.
Sort the symptom first, because neighbouring faults go to different pages. Bands inside frames is this page. Whole frames swinging bright and dark points to mains flicker in the frame mean. An occasional fully black frame points to the black-image checklist, not to banding.
Where the bars come from
A mains-driven LED tube or fluorescent lamp is not continuous. A full-wave driver draws current twice per mains cycle, so the light pulses at twice the mains frequency: 100 Hz on a 50 Hz grid, 120 Hz on a 60 Hz grid. A PWM-dimmed lamp adds its own switching rate on top. Every camera row integrates that ripple for the exposure time, and the shutter decides what the fault looks like.
With a rolling shutter, the rows of an area scan camera expose in sequence, each row at a slightly different point of the light cycle. If the exposure is a whole number of light periods, every row integrates exactly the same light and the frame is flat. If it is off by any fraction of a period, row brightness follows the light's phase and the frame carries bands. With a global shutter all rows share one exposure window, so there are no bands — the frame mean steps up and down instead, the case the camera flicker diagnosis walks through. A global-shutter body such as the MV-CU020-90GC, a 2.5 MP GigE camera with a 1/1.7" sensor, turns the same ripple into brightness steps; the cure below is identical.
- Sensor format
- 1/1.7"
- Lens mount
- C-mount
- Interface
- GigE
- Resolution
- Up to 3 MP
| Light source | Ripple | Period | Exposures with no banding |
|---|---|---|---|
| LED or fluorescent on 50 Hz mains | 100 Hz | 10.00 ms | 10, 20, 30 ms |
| LED or fluorescent on 60 Hz mains | 120 Hz | 8.33 ms | 8.33, 16.67, 25 ms |
| PWM-dimmed lamp or display backlight | the PWM rate | 1 / PWM rate | whole multiples of it |
| Vision light on a DC controller | none | — | any |
Worked example: one striped frame in ten under 100 Hz high-bays
Inputs, each with its source. A 50 Hz factory lit by LED high-bays on full-wave drivers, so the ripple is 2 × 50 Hz = 100 Hz and T = 1/100 Hz = 10.00 ms. A 4000-row rolling-shutter camera, commanded 25 fps but delivering 24.6 fps on the timestamps, so the frame period is 1/24.6 = 40.65 ms. An exposure entered as a nominal 10 ms that the camera quantizes to 10.40 ms. A part moving at 150 mm/s with a 0.5 mm feature tolerance.
The arithmetic:
- Offset from a whole period: 10.40 − 10.00 = 0.40 ms of every row sits at a sliding phase, giving ripple of 0.40/10.40 ≈ 4%, around ten gray levels on an 8-bit frame. Drop the exposure to 5.00 ms and rows land either on the crest or in the trough: those are the near-black bars.
- Row period: 40.65 ms / 4000 rows = 10.16 µs. One light cycle spans 10.00 ms / 10.16 µs = 984 rows, so a band repeats every 984 rows — about four bands across the frame.
- Drift: each frame starts 40.65 mod 10.00 = 0.65 ms later in the light cycle, so the bands crawl by 0.65 ms / 10.16 µs = 64 rows per frame.
- Beat: the phase walks a full cycle in 10.00 / 0.65 ≈ 15 frames. The deepest band is fully developed for only a couple of frames per cycle, so roughly one frame in ten to fifteen looks striped — exactly the reported rate.
The decision, with thresholds:
- Fix A, whole-period exposure: 20.00 ms = 2 × 10.00 ms. Bands vanish at any phase. Motion check: 150 mm/s × 20.00 ms = 3.0 mm of smear against a 0.5 mm tolerance — rejected.
- Fix B, strobe: a 100 µs pulse from a controller. Smear is 150 mm/s × 100 µs = 0.015 mm, far inside tolerance; duty at 24.6 fps is 100 µs × 24.6 = 0.25%.
Decision: strobe. The high-bays stay where they are; during a 100 µs pulse their contribution to the pixel charge is negligible and the pulsed light owns the image. If you take Fix A on a slower line, keep the exposure within about 0.1 ms of the multiple: the residual ripple is then about 0.1/10.00 = 1%, which row profiles cannot see.
Diagnose it in five minutes
- Turn auto exposure and auto gain off. Auto modes chase the ripple and bury the evidence — the same discipline that stops brightness drift over time.
- Set the exposure to 1.00 ms, aim at the suspect light, and grab 30 frames. Stripes that crawl across frames confirm a pulsed source.
- Sweep the exposure from 1 to 30 ms in 1 ms steps and plot the frame mean. The curve cycles with the light period: a 10.00 ms spacing is 100 Hz ripple on 50 Hz mains, 8.33 ms is 120 Hz on 60 Hz mains, and 20.00 ms is a half-wave driver pulsing at mains itself.
- Count the bands in one frame and divide the row count by that number: the answer is rows per light cycle, T divided by the row period, which ties the ripple to the light without trusting any label.
- Apply the whole-period exposure, grab 100 frames, and check that the frame means sit flat.
The fix for each case
| Situation | Fix | Number that ends it |
|---|---|---|
| Room mains light, part static or slow | whole-period exposure | 20.00 ms on 50 Hz, 16.67 ms on 60 Hz |
| Part too fast for that | DC-driven light, short exposure, or strobe | blur budget = v × t_exp |
| Your own inspection light is PWM-dimmed | dim by current, not by PWM | constant-current output |
| Two flicker sources at different rates | no exposure satisfies both — strobe or hood | — |
| Auto exposure still running | lock a manual whole-period value | any n × T |
The motion budget is the tie-breaker: blur = v × t_exp, and once that product exceeds about a tenth of the feature you measure, the exposure cannot grow and the decision moves to the drive. Capping exposure for motion is its own discipline — see capping the maximum auto exposure time — but with flicker you cap at a whole period, not at any convenient value.
Strobe the light and stop chasing the mains
Wire the camera's exposure-start signal to a strobe input on a light controller and the light is on only while rows collect charge. Room lighting contributes almost nothing during a 100 µs pulse, so there is no period to match and no band to hunt. The drive limits live in the controller, not in guesswork: overdrive, duty cycle and strobe timing sets those numbers, and LED strobe rise time covers the microseconds between trigger and usable light. When a strobed image comes back black, trigger polarity and delay are the first suspects — strobe on but image black. In robot cells the same pulse can fire from robot IO: triggering strobe lighting from robot digital outputs.
The LS-CTL-0070 is a digital control box with 4 channels, 200 W and a strobe feature, addressed over RS232.
- Output
- Constant voltage 24 V
- Channels
- 4 channels
- Control
- Digital
- Feature
- Strobe
Pair the controller with the light you already own, or size a new one from bar lights. The LS-BAR-1047 is a 290 x 30 mm bar light that runs on 24 V and covers a mid-size field from opposing pairs.
- Size
- 200-400 mm
- Type
- Standard
- Voltage
- 24 V
Drive the light on DC and the ripple disappears
Constant-current and constant-voltage controller outputs carry no 100 Hz envelope. The camera sees steady photons, and every exposure from tens of microseconds to seconds is clean. This also ends banding when your own dimmed lamp is the source, because current dimming leaves no square wave for the sensor to integrate. Hood the station against room light and the ambient question closes with it; how much ambient a station must reject is a number you can specify in acceptance tests.
- Output
- Constant current
- Channels
- 4 channels
- Output
- Constant voltage 24 V
- Channels
- 4 channels
The LS-CTL-0180 is a 4-channel constant-current controller rated 120 W, for 24 V lights. The LS-CTL-0322 takes AC100-240V 50/60 Hz on its input and delivers 24 V across 4 channels with 8 A total output — mains on one side, no ripple on the other.
Checks before you close the ticket
- 100 frames at the final exposure: the spread of frame means stays within about 2 gray levels on an 8-bit image.
- A row profile through the old band location stays within about 4 gray levels of the frame mean.
- The blur arithmetic, v × t_exp, written out against the feature tolerance.
- The frame rate still meets the cycle after the longer exposure — long exposures cap GigE frame rate at longer exposure times.
- Repeat with room lights on and off, and with the door open and shut: each changes which sources reach the part.
When the whole-period rule fails
- Two sources, two rates. A 100 Hz tube and a PWM lamp share no period; no exposure is a whole multiple of both. Remove one source, hood the station, or strobe.
- The striped thing is a screen. LCD backlights PWM at their own rate and mains multiples do nothing to them; take the display out of the field of view or change its backlight drive.
- The first frame after start-up only. A dark first frame with clean followers is exposure or light settling — first frame dark, not flicker.
- Bands survive an exact multiple. Re-run the exposure sweep: the ripple may not sit at twice mains. Half-wave drivers and some dimmers pulse at rates outside the table.
Quick checklist
- Auto exposure and auto gain off; exposure locked manually.
- Ripple period measured by the 1-to-30 ms exposure sweep, not assumed.
- Exposure set to a whole number of measured periods, within 0.1 ms.
- Blur budget v × t_exp inside the feature tolerance.
- Frame rate re-checked at the new exposure.
- 100-frame capture flat in frame mean and in a row profile.
- Room lights toggled, door opened and shut; bands stay gone.
- If a strobe is used: pulse width and duty inside the controller's drive limits.
Pick the controller and light together so the drive matches the pulse you plan. The light controller finder filters by channels and output type, and the configurator below starts at the controller step.
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.
If the station is already built and the bars refuse to die on a whole-period exposure, bring the frame timestamps and one striped frame to the contact page and we will work the arithmetic with you.
Questions
What exposure time removes black bars under mains lighting?
Take the smallest whole multiple of the light period your motion budget allows: 10.00, 20.00 or 30.00 ms where the mains is 50 Hz, and 8.33, 16.67 or 25.00 ms where it is 60 Hz. No shorter exposure works while that lamp dominates the scene, because bar contrast only reaches zero at whole multiples. If the smallest multiple already smears the part, the decision moves to a strobed or DC-driven light.
Why do the bars appear in only some frames?
Because a free-running camera starts each exposure at a slightly different point in the light cycle. The walk per frame is the frame period modulo the light period: with a 40.65 ms frame against a 10.00 ms period that is 0.65 ms, so the phase repeats every 10.00 / 0.65, about 15 frames, and the deepest bar lands in roughly one frame per cycle. Locking the frame rate so the frame period is a whole multiple of the light period freezes the bars in place — proof of the cause, not a cure.
Do global shutter cameras get black bars too?
No. A global shutter exposes every row at the same instant, so a flickering light shows up as whole-frame brightness steps from frame to frame instead of bars inside the frame. The cure is the same whole-period exposure rule; when you need exposures shorter than one light period, a DC-driven or strobed light is the answer. Rolling-shutter banding and global-shutter flicker are one fault seen through two shutters.
How do I separate flicker bands from a failing light or a loose cable?
Bands are periodic: they hold a fixed spacing in rows, their depth follows the exposure length, and they crawl at a steady rate. A failing LED or a loose connector produces randomly timed dark frames with no period, at any exposure. Set the exposure to 1.00 ms, grab 30 frames, and plot each frame mean: a repeating pattern points to flicker, scatter points to the hardware.
Can I raise the PWM frequency instead of changing the exposure?
Yes, when the dimmed lamp is yours to drive. Push the PWM rate far above the row rate and each row integrates many cycles, so the ripple averages out — row periods sit near 10 µs, which puts the target in the tens of kHz. The cleaner route is to stop PWM dimming and dim by current with a constant-current controller: the output then carries no square wave to integrate, and every exposure is clean.




