The image pulses: brightness swings frame to frame, measurement tools hunt for gain, and reinstalling the acquisition driver changes nothing. Two driver versions showing the identical flicker is itself the clue, because the variation is not coming from the PC — it is coming from the light the sensor sees. This guide is for anyone commissioning an area scan camera on Camera Link or GigE who has already reinstalled the driver and is still staring at a pulsing live view. You will set the exposure that kills mains beat, prove the light is the cause in five minutes, and separate the two electrical look-alikes: cable and trigger.
Why does the flicker survive two clean driver installs?
Flicker that survives two different driver versions is almost never a software fault: it is the camera exposure window beating against the 100 Hz light ripple on 50 Hz mains, or the 120 Hz ripple where the supply runs at 60 Hz, so both installs reproduce the identical symptom.
Mains power swings positive and negative 50 or 60 times per second and passes through zero twice in every cycle. Gas-discharge tubes and cheaply driven LED fixtures dip in output at each zero crossing, so the room itself modulates at twice the mains frequency: 100 Hz or 120 Hz, depending on the supply. A camera exposure integrates whatever slice of that ripple lands in its window. If the window is not an exact number of ripple periods long, consecutive frames average different phases and the brightness walks up and down. Sensor, cable and frame grabber are passive in all of this, which is why every driver you install shows the same pulsing pixel for pixel.
For the lighting side of the diagnosis in depth, the guide on camera flicker under artificial lighting covers how each fixture type modulates.
What exposure time stops mains flicker?
Set the exposure to an integer multiple of the mains half-cycle — 10 ms, 20 ms or 30 ms on 50 Hz power, 8.33 ms, 16.67 ms or 25 ms on 60 Hz — and every frame integrates the same number of ripple cycles, so the brightness stops changing frame to frame.
Set the value in microseconds so rounding stays harmless: 10000 µs on 50 Hz mains, 8333 µs on the faster supply. The exact half-cycle there is 8333.33 µs, so 8333 µs misses by 0.33 µs, which is 0.004% of the ripple period — brightness variation far below the noise floor of any sensor.
If your software only offers coarse exposure steps and cannot land on 8.33 ms, quantize the frame period instead: when each frame starts a whole number of half-cycles after the previous one, every frame samples the same phase, so the brightness is constant even if it is not perfectly averaged. The same quantization gives flicker-free frame rates:
| Mains | Ripple period | Exposure multiples | Flicker-free frame periods | Frame rates |
|---|---|---|---|---|
| 50 Hz | 10 ms | 10, 20, 30 ms | 20, 40, 50, 100 ms | 50, 25, 20, 10 fps |
| 60 Hz | 8.33 ms | 8.33, 16.67, 25 ms | 16.67, 33.33, 41.67, 83.33 ms | 60, 30, 24, 12 fps |
The full walk-through of this exposure fix, with the symptom isolated at the bench, is in image brightness changes frame to frame: fix mains lighting flicker.
Why does a 30 fps camera pulse at 10 Hz under 50 Hz lights?
Because a 33.33 ms frame period is not a multiple of the 10 ms ripple period: each frame starts 3.33 ms later in the ripple, the phase pattern repeats every three frames, and the brightness pulses at 30 fps ÷ 3 = 10 Hz — slow enough to see and to drag thresholds around.
A 7 ms exposure then integrates 70% of one ripple period from a phase that steps 3.33 ms each frame, so the mean gray cycles high, mid, low and back every three frames. At 30 fps that is a visible 10 Hz pulse, slow enough for an operator to see it and slow enough to pull an auto algorithm off its target.
Run the same arithmetic on the other mains frequency and the conflict disappears: 4 × 8.33 ms = 33.33 ms, exactly one frame period, so 30 fps sits phase-locked and steady. That is why a station accepted in a 60 Hz plant can pulse when the identical hardware lands on 50 Hz power. Check the mains frequency where the machine will run, not where it was built.
How do I prove the light is the cause in five minutes?
Cap the lens completely with your hand or a lens cap and watch ten frames: if the histogram sits flat at dark level with no modulation at all, the sensor, cable and grabber are clean, and every bit of variation is arriving as light on the scene.
- Cap the lens. Ten frames behind a lens cap should sit flat at dark level. If the variation vanishes, the acquisition path is clean and the modulation arrives as light. If sparkle, lines or jumps remain with the lens capped, skip the rest of this section and go to the electrical checks below.
- Kill the suspect fixtures at the breaker. Watch the live mean gray while someone switches the room lighting off. A pulse that collapses with the switch confirms the fixture as the source; never probe live terminals for this test.
- Substitute a steady light. Aim a battery-powered or constant-current light at the part and shut the room lights. A steady image confirms the mains-driven ambient as the cause.
- Apply the half-cycle exposure. Set the value the table above gives for your supply — 10 ms or 8.33 ms — and watch 100 frames. A flat mean gray confirms the beat; keep the rule or move the light to a steady drive.
A mean-gray trend costs nothing: most acquisition tools will log it, and a short script that averages each frame works as well. A smooth 10 Hz sinusoid is the beat from the previous section; random jumps point at the cable or connector instead.
Can a Camera Link cable or trigger setting mimic flicker?
Yes, but the look differs: mains beat modulates brightness smoothly frame to frame, a marginal Camera Link cable produces gray sparkle, shifted lines or lost frames, and a trigger mismatch produces irregular frame intervals that read as pulsing in a live view.
The two mimics fail differently from the beat. A cable breaks signal integrity: gray sparkle over the image, horizontal lines shifted or torn, frames dropped outright. A trigger mismatch breaks the frame clock: the camera sits in external-trigger mode while the pulse source idles, or the grabber waits for a trigger the camera never sends, so frames arrive at irregular intervals. On a GigE link the same marginal-cable problem shows as dropped packets rather than sparkle.
Camera Link cables are specified to 10 m for Base configuration and 7 m for Medium and Full configurations, so a worn or over-length cable is the first hardware suspect. Swap in a known-good cable before you condemn anything else; it is the cheapest test in this guide and it settles the question in a minute. The wiring checks are laid out in camera connected but no image: check the frame grabber cable wiring, and the settings that must agree between camera and card in Camera Link camera and frame grabber compatibility: what must match.
Trigger questions have their own checklist: hardware trigger source not detected: check GenICam line settings walks the line configuration that makes the pulses arrive at all.
One setting-specific trap: when enabling 2×2 binning faults the acquisition, the host is writing a setting the camera configuration file does not define. Reload the camera file for your exact model and configuration, then apply binning on the camera side, and do not chase it as a hardware fault.
If the cable swap clears nothing and a second camera runs cleanly on the same card, the grabber moves to the top of the suspect list, and the frame grabbers category is where the Camera Link replacements live:
- Interface
- Camera Link
Which lights flicker and which do not?
Anything driven straight from the mains ripples at twice the local supply frequency — 100 Hz or 120 Hz, as the table below lists for each — while DC constant-current LEDs are steady and PWM-dimmed LEDs blink at the driver switching rate, typically a few hundred hertz to a few kilohertz.
| Light and drive | Ripple frequency | Depth of modulation | Symptom in the image | Fix |
|---|---|---|---|---|
| Fluorescent tube, magnetic ballast | 100 Hz / 120 Hz | Deep | Strong beat unless exposure is quantized | Half-cycle rule, or shield the scene from it |
| Fluorescent, high-frequency electronic ballast | Tens of kHz | Shallow | Usually none | None needed |
| LED, constant-current DC driver | Negligible | Negligible | Steady | None needed |
| LED, PWM-dimmed driver | Driver PWM rate, typically a few hundred Hz to a few kHz | Full on/off | Pulse on free-running exposure; bands under rolling shutter | Quantize to the PWM period, or strobe |
| LED strip on an unregulated supply | 100 Hz / 120 Hz | Moderate to deep | Beats like fluorescent | Move to a constant-current controller |
A PWM-dimmed light is the worst case for a rolling shutter sensor: rows expose at staggered times, so a light that is off for part of its cycle paints bright and dark bands down the frame — the mechanism behind black bars in some camera images: fix lighting flicker vs exposure. A global shutter sensor shows a uniform pulse instead of bands, but the pulse is still there; the drive of the light decides, not the shutter alone.
If banding under PWM light is part of your camera decision, compare the two shutter types directly:
- Sensor format
- 1/1.7"
- Lens mount
- C-mount
- Sensor format
- 1/1.8"
- Lens mount
- C-mount
When is a strobed light the better fix than a longer exposure?
Strobe when the exposure the mains rule forces is too long for the motion on the belt: a hardware-triggered camera firing a strobed light integrates only while the light is on, so brightness comes from the pulse energy and blur comes from the pulse width.
The half-cycle rule sets a floor on free-running exposure: 10 ms on 50 Hz power, 8.33 ms on the faster supply. A part moving at 100 mm/s smears 1 mm through a 10 ms exposure, which can be the whole tolerance. Strobing removes the floor because the light is off except during the pulse: the camera is hardware-triggered, the controller fires the flash, and the image integrates one clean burst that mains ripple cannot modulate.
The wiring is a chain: trigger source to camera, camera exposure-active output or the same trigger delayed to the controller, controller to light. Tune the delay so the flash lands inside the exposure — first frames that come out dark are almost always a delay problem, and first camera frame dark: exposure settling or light timing? sorts the two. With no pulse generator, frame grabber camera trigger pulse train without a function generator shows how to make the grabber produce the train, and light controller to light cable adapters: connectors and current covers the connectors and the current each line must carry.
Any digital controller with a strobe feature can drive this; size it for one channel per light plus the pulse current:
- Output
- Constant voltage 24 V
- Channels
- 4 channels
- Control
- Digital
- Feature
- Strobe
For a static station with no motion problem, the simpler cure is to take the light off mains ripple entirely with a constant-current drive:
- Output
- Constant current
- Channels
- 2 channels
- Output
- Constant current
- Channels
- 4 channels
What is the fix for each symptom?
Match the symptom to its fix: brightness swings mean quantize the exposure to the half-cycle or drive the light from constant current; gray sparkle, tearing or lost frames mean the Camera Link cable; irregular frame arrivals mean trigger configuration; bands across the frame mean PWM light into a rolling shutter.
- Steady ambient light, static part: fixed manual exposure at the half-cycle multiple from the table above, auto exposure off, free run. Done in one setting.
- Ambient light, moving part: hardware trigger plus a strobed light; the pulse width sets the blur and mains ripple stops mattering.
- PWM-dimmed fixture lighting or leaking into the scene: move that light to constant-current drive, or quantize the exposure to its PWM period.
- Sparkle, tearing or dropped frames: swap the Camera Link cable first; the card only after a second camera misbehaves on it too.
- Irregular or missing frames: trigger mode and camera file first, cable second, grabber last.
Keep the line honest afterwards. Leave every automatic mode off, log the mean gray per frame so a failing ballast or a changed fixture shows up as a trend, and write the mains frequency and the chosen exposure into the station file. When you write the acceptance test, ambient light rejection specification for vision acceptance tests gives wording that stops a fixture change from quietly reopening the beat.
For parts, start at the area scan cameras and strobe-capable light controllers categories, filter the camera finder by shutter type, and step through the configurator to match camera, lens, light and controller. The cameras topic page collects every guide around this fault.
Questions
Does a global shutter camera remove flicker?
No. A global shutter samples every row at the same instant, so a mains-driven or PWM light produces one uniform bright-dark pulse per frame instead of the bands a rolling shutter paints. The pulse itself remains, and threshold tools still see it. The cure is unchanged: quantize the exposure to the ripple period, or move the light to constant-current or strobed drive. Shutter type changes how the flicker looks; the light drive decides whether it exists at all.
Why did the image get brighter and the acquisition fault when I enabled 2x2 binning?
Binning adds the charge of neighboring pixels, so a uniform scene gives up to four times the signal: the brightness jump is expected, not a fault. The acquisition fault usually means the host wrote a setting the camera configuration file does not define, which is common on Camera Link where the file describes the camera register set. Reload the file for your exact model, apply binning on the camera side, and treat the brightness change separately from flicker.
Can I remove mains flicker from an image in software after capture?
No. The exposure already mixed bright and dark slices of the ripple, so the information about true scene brightness is gone before the frame reaches memory. Post-processing can hide a slow beat from your eye, but it cannot restore a consistent gray level, and any measurement from those frames carries the modulation. Fix it at acquisition with the exposure rule, a constant-current light or a strobe; use software only to detect the beat early by logging the per-frame mean.
Does the same rule apply to PWM-dimmed LED lights?
Yes, with the PWM frequency in place of twice the mains. Make the exposure an integer multiple of the PWM period: at a 1 kHz driver that means 1 ms, 2 ms, 3 ms and so on. If the exposure cannot hit the period exactly, quantize the frame period to it so every frame samples the same phase. Above a few kilohertz the ripple averages out inside a normal exposure, which is why high-frequency PWM drivers rarely show the problem.
Does flicker affect measurements or only the live preview?
Measurements take the hit. A 10 Hz beat swings the mean gray of consecutive frames, so threshold-based tools return sizes and positions that jitter with the beat, auto gain chases it and makes it worse, and pass limits tuned on a bright frame fail a dark one. Sorting the light drive or the exposure comes first; measurement stability follows the gray level, not the other way round.





