PID Control for Light

Measured: 250 lux
Lamp output: 0%
Illustrative closed-loop model only; this is not a calibrated photometric simulation.
PID Control for Light: First Decide What “Light Level” Actually Means
Closed-loop lighting control can be used in offices, laboratories, warehouses, production areas and other spaces where the illumination at a working surface should remain near a defined target.
A basic loop is:
Illuminance setpoint → Light sensor → PI/PID → LED driver or dimmer → Measured illuminance
Before tuning the controller, however, the controlled photometric quantity must be defined correctly.
Lumens, lux, candela and luminance describe different things. For room or task-lighting feedback, the process variable is commonly illuminance measured in lux at a defined plane.
The underlying feedback concept is described in What Is PID?.
Lumens, Lux, Candela and Luminance Are Not Interchangeable
Luminous flux - lumen describes the total visible light output of a source.
Illuminance - lux describes how much luminous flux reaches a surface.
Luminous intensity - candela describes light output in a particular direction.
Luminance - cd/m² is more closely related to the brightness of a surface as viewed from a direction.
A luminaire may produce several thousand lumens while the illuminance on a desk depends on:
mounting height,
optical distribution,
room surfaces,
luminaire spacing.
A 70% driver command and 500 lux on the desk are completely different measurements.
What Does a Lux Sensor Measure?
An illuminance sensor measures the light arriving at its sensing plane with a spectral response intended to approximate photopic human vision.
Measurement quality depends on factors such as:
spectral response,
angular response,
measurement range,
calibration,
installation orientation.
A high-quality sensor installed in the wrong place can still give the controller the wrong information.
Sensor Placement Is Part of the Control Design
If the objective is 500 lux on a work surface, the feedback sensor must represent that work area in a meaningful way.
A sensor mounted directly below one luminaire may overestimate the average illumination of the room.
A sensor looking toward a bright window may react mainly to daylight near that window while a deeper part of the room remains underlit.
Sensor location should therefore consider:
the controlled task plane,
daylight direction,
luminaire position,
shadows,
sensor field of view.
Poor sensor placement cannot be repaired by increasing Kp.
Daylight Harvesting
Suppose the target work-plane illuminance is 500 lux.
If daylight already provides 350 lux, the electric lighting only needs to supply the remaining portion.
When a cloud reduces daylight, the controller increases electric-light output.
When sunlight increases, electric lighting can be dimmed.
This is commonly called daylight harvesting or daylight-responsive lighting control.
The physical idea is simple:
Total measured illuminance = Daylight contribution + Electric-light contribution
Daylight is not a disturbance that must always be cancelled. It is free illumination that the electric lighting system can complement.
Closed-Loop and Open-Loop Daylight Sensing
A closed-loop photocell often sees some combination of daylight and electric light in the controlled space.
An open-loop daylight sensor can be positioned primarily to measure available daylight and calculate the electric-light demand from that information.
The best arrangement depends on:
room geometry,
daylight zones,
sensor position,
lighting layout.
The controller should always be designed around what the sensor actually sees rather than around an assumed lux value.
P, I and D in Lighting Control
Proportional action responds to the present lux error.
Integral action can remove a persistent difference between measured and target illuminance.
Derivative action responds to the rate of change of the error or measurement.
The LED source itself can respond extremely quickly, but the complete loop may contain slower elements such as:
sensor averaging,
network communication,
driver fade time,
software filtering.
Short shadows or reflections can also cause fast sensor changes that make D unnecessarily active.
For many building-lighting loops, PI control or a deliberately slow daylight-control algorithm is often sufficient.
The general behaviour of the terms is covered in P, I and D components.
The Fastest Lighting Loop Is Not Necessarily the Best
If every passing cloud causes the luminaires to brighten immediately and then dim again a few seconds later, the numerical lux control may be tight but the space can feel unstable and distracting.
Lighting control often benefits from:
fade time,
rate limiting,
deadband,
minimum change thresholds,
intentional filtering.
Visual comfort can be more important than achieving the smallest possible instantaneous lux error.
Driver Output and Lux Are Not Perfectly Linear
A 50% controller command does not guarantee 50% of full-scale measured lux.
The relationship can be affected by:
driver dimming curve,
minimum dimming level,
luminaire optics,
daylight contribution,
sensor geometry.
Different drivers can also produce different optical output at the same nominal control signal.
This is an example of the real-world nonlinearities discussed in PID limitations.
0-10 V LED Dimming
Many LED drivers accept a 0-10 V control signal.
A PLC, controller or lighting gateway can convert the calculated dimming demand into an analog voltage.
However, the actual behaviour near:
0 V,
1 V,
5 V,
10 V
depends on the driver.
Some drivers switch completely off below a threshold.
Others remain at a minimum light level.
Commissioning should therefore verify the real relationship between voltage and optical output.
A correct analog signal does not guarantee a perfectly linear light response.
PWM Dimming
LEDs can also be dimmed through Pulse Width Modulation - PWM.
The LED is switched rapidly and average light output is varied by changing duty cycle.
This can provide a wide dimming range, but PWM frequency and modulation depth matter.
Poor implementation can create:
visible flicker,
stroboscopic effects,
camera artifacts.
A lamp can follow the PID command correctly while still producing unacceptable temporal light modulation. Dimming performance and flicker performance are separate checks.
Why Flicker Matters Around Machinery
Strong temporal modulation can make moving or rotating machinery appear:
slower,
discontinuous,
or under some conditions almost stationary.
This stroboscopic effect makes lighting quality particularly important in industrial environments.
The lighting controller should therefore not be judged only by average lux and energy consumption.
What Is DALI?
DALI - Digital Addressable Lighting Interface is a digital lighting-control system used to communicate with compatible lighting equipment.
A DALI or DALI-2 installation can include:
LED drivers,
application controllers,
light sensors,
occupancy sensors,
manual input devices.
Individual luminaires or groups can be addressed and controlled digitally.
This provides a structured alternative to one analog dimming signal controlling an entire group.
DALI-2 Light Sensors and Occupancy Sensors Have Different Jobs
A light sensor provides an illuminance measurement.
An occupancy or presence sensor reports whether a space is occupied.
The application controller can use both signals.
For example:
Unoccupied → Lights off or reduced
Occupied → Activate required lux target
Daylight increases → Reduce electric-light output
This means the lux PID is only one layer of the total lighting-control strategy.
Occupancy Logic Should Sit Above the Lux Loop
The lux controller answers:
“How much electric light is needed to meet this setpoint?”
Occupancy control answers:
“Is this setpoint required at all right now?”
A perfectly tuned PID that maintains 500 lux in an empty room can still be an inefficient control system.
PID maintains a setpoint; supervisory logic decides when that setpoint should be active.
This is a useful example of the distinction between PID and other control strategies.
Minimum Dimming Level
Not every LED driver can dim smoothly from 100% all the way to 0%.
A driver may remain stable only down to:
10%,
5%,
1%,
or another specified level.
Below the useful range, behaviour can include:
drop-out,
pop-on,
flashing,
unstable output.
If the PID does not know this physical limit, it may continuously request outputs that the driver cannot reproduce.
Controller limits should therefore reflect the real driver and luminaire behaviour.
Integral Windup Also Occurs in Lighting
Suppose the target is 750 lux, but the installed luminaires can provide only 600 lux under current conditions.
The controller reaches 100% output and cannot increase illuminance further.
If integral error continues accumulating, the loop develops integral windup.
When daylight later increases, the stored integral can keep the lamps unnecessarily bright for some time.
The reverse can occur at minimum output when daylight alone already exceeds the setpoint.
Output limiting and anti-windup are therefore also part of PID troubleshooting for lighting.
Human Brightness Perception Is Not Linear Lux Measurement
Reducing physical light output to 50% does not necessarily make the light appear “half as bright” to a person.
Human visual perception is nonlinear.
This matters especially for:
manual dimming,
scene transitions,
fade curves.
Photometric lux regulation and subjective brightness perception are related, but they are not the same control objective.
Lux Control and Color Control Are Separate Problems
In tunable-white or RGB/RGBW lighting, the system may have two separate objectives:
illuminance
and
color / chromaticity / correlated color temperature.
A fixture can produce the correct lux while having the wrong color.
It can also produce the correct chromaticity while total illumination is too low.
High-performance systems therefore treat light level and color as separate variables.
This links directly to PID color control.
LED Temperature Can Change Light Output
LED optical output can change as junction temperature changes.
Color coordinates can also drift in some products.
The same electrical command may therefore produce slightly different lux at:
cold start,
normal operating temperature,
high ambient temperature.
Closed-loop lux measurement can compensate part of this drift automatically.
This is one physical connection between lighting and temperature control.
Feedforward from Daylight
An external or facade daylight sensor can sometimes detect a major sunlight change before the indoor controlled sensor has fully responded.
The lighting system can reduce electric-light demand immediately and let the indoor lux feedback trim the remaining error.
A possible structure is:
Outdoor daylight → Feedforward dimming estimate
plus:
Indoor lux PI → Final correction
This combines early disturbance response with accurate local feedback.
One Lux Sensor May Not Represent a Large Room
A large office, warehouse or production area may contain very different illumination conditions.
A window zone may be at 800 lux while an interior aisle is only at 250 lux.
Controlling the entire space from one sensor can overlight one area and underlight another.
It may therefore be better to create separate:
daylight zones,
interior zones,
task zones.
Each zone can then use an appropriate sensor and luminaire group.
Lighting Loops Still Have Delay
LEDs themselves can respond extremely quickly.
The complete digital loop may still contain:
sensor averaging,
PLC scan time,
network communication,
DALI fade time,
software filtering.
A lighting controller therefore should not be made extremely fast simply because the LED source is fast.
The complete loop should be evaluated using the same principles discussed in time delay and system dynamics.
What Can a PLC Do?
A PLC can:
read lux sensors,
execute PI/PID control,
generate 0-10 V dimming commands,
communicate with a DALI gateway,
process occupancy signals,
manage schedules,
handle manual overrides,
manage lighting zones.
But a complete lighting-control system is broader than the PID block.
Scene control, occupancy, daylight logic, emergency-lighting requirements and user commands may belong to higher-level supervisory logic.
This architecture is related to PID control with PLCs.
What Should SCADA or BMS Record?
A useful SCADA or BMS trend can include:
Lux SP
Lux PV
Dimming output
Occupancy state
Daylight-sensor value
Manual / Auto state
Driver or luminaire fault
Lighting-zone state
This makes it much easier to determine whether a complaint about poor lighting comes from:
sensor placement,
driver behaviour,
daylight logic,
occupancy state,
or the PID loop itself.
Common Lighting-Control Problems
The lights continuously brighten and dim: gain may be excessive, integral may be too fast, or daylight filtering may be inadequate.
A small passing cloud changes the whole room dramatically: review sensor placement, daylight zoning and response rate.
PID output is 100% but the target lux cannot be reached: inspect luminaire capacity, dirt depreciation, sensor position and the real lighting design.
PID output is 0% but lux remains above setpoint: daylight alone is already above the target and electric lighting cannot reduce it further.
Lux is correct but people still dislike the lighting: glare, luminance distribution, color temperature or flicker may be the real problem.
LEDs flicker at low output: inspect driver minimum dimming level and control-interface compatibility.
The 0-10 V command changes but light output does not: check wiring, driver configuration and dimming range.
Different luminaires look different at the same command: driver and luminaire characteristics may not be identical.
The room is empty but lighting stays at full target: the problem is likely supervisory occupancy logic, not PID tuning.
Lighting-Control Commissioning Check
1. Is the controlled variable lux, luminance or another optical quantity?
2. Does the lux sensor represent the actual task plane?
3. Are sensor calibration and range appropriate?
4. Is daylight contribution understood?
5. Is the area divided into sensible daylight and interior zones?
6. Does occupancy logic work correctly before the lux loop is enabled?
7. Is the 0-10 V, DALI or other dimming interface configured correctly?
8. Is the driver's minimum dimming level known?
9. Has the real command-to-lux relationship been tested?
10. Is PI/PID response unnecessarily fast?
11. Are fade time and rate limits comfortable for users?
12. Are output saturation and anti-windup handled?
13. Has flicker or temporal light modulation been checked?
14. Is color temperature or chromaticity a separate control objective?
15. Do manual override and scene control work correctly?
16. Has the system been tested at night, in bright sun and under rapidly changing daylight?
Related PID, Lighting and Optical-Control Topics
PID fundamentals: What Is PID? - P, I and D Components - PID Gain and Tuning - PID Limitations
Optical and electrical control: PID Color Control - PID Power Control - PID Current Control - 0-10 V and 4-20 mA
Dynamics and advanced control: Time Delay and System Dynamics - PID and Other Control Strategies - PID Troubleshooting
Control infrastructure: PID with PLCs - PID with SCADA
Reliable lighting control requires more than a light sensor and a PID block. The controlled photometric quantity, sensor position, daylight contribution, dimming interface, LED-driver behaviour, minimum dimming level, flicker, occupancy logic and visual comfort all affect the final performance.