PID Control for Color

PID control for industrial color measurement and color correction

PID Control for Color: First Define What “Color Error” Actually Means

Color control is used in paints, coatings, plastics, textiles, printing, LED lighting and other processes where the finished product must remain inside a defined color tolerance.

At first glance, the control problem appears simple:

Target color → Measured color → Controller → Process correction

But color is not normally a single scalar process variable like tank pressure or motor speed.

A product may be:

too light,

too dark,

too red,

too green,

too yellow,

or too blue

while still having a similar total color-difference number.

Before applying PID, define both sides of the loop: which numerical color variable is being controlled, and which physical process input can move the color in the required direction?

The general feedback concept is explained in What Is PID?.

CIELAB Gives Color a Numerical Position

One of the most widely used industrial color spaces is CIELAB.

A color is represented by three coordinates:

L* for lightness,

a* for the red-green axis,

b* for the yellow-blue axis.

A target may therefore be specified as:

L* = 52.0

a* = 18.5

b* = 7.2

The production sample can then be compared with that standard using:

ΔL*

Δa*

Δb*

rather than vague instructions such as “make it slightly warmer” or “reduce the green cast”.

How Does a Spectrophotometer Produce L*a*b* Values?

A spectrophotometer measures how the sample reflects or transmits light across a range of wavelengths.

The measured spectral data is then combined with a selected:

illuminant

and

standard observer

to calculate tristimulus values such as X, Y and Z.

Those values can then be transformed into CIELAB coordinates.

This means L*a*b* is not simply “what the sensor saw”.

It is the result of:

spectral measurement + reference illuminant + observer model + color-space calculation.

Why Measurement Conditions Must Be Fixed

Two laboratories can measure the same physical sample and obtain different results if they do not use the same measurement conditions.

Important parameters can include:

illuminant,

2° or 10° standard observer,

instrument geometry,

aperture size,

UV condition,

specular included or excluded,

sample backing,

sample thickness,

temperature.

A color PID loop is only as meaningful as its measurement standard. If the measurement condition changes, the controller may “correct” a product that has not physically changed.

What Is Delta E?

Delta E - ΔE is used to express overall color difference between a target and a measured sample.

But there is more than one Delta E calculation.

Common methods include:

CIELAB ΔE*,

CIE94,

CMC,

CIEDE2000.

Different equations can produce different numerical results from the same pair of samples.

Therefore a quality specification should not simply say:

“ΔE must be below 1.”

It should also define which formula and measurement conditions are being used.

Why Total ΔE Is Often a Poor PID Error Signal

Total ΔE is extremely useful for quality acceptance, but it loses directional information.

Suppose the measured sample has:

ΔE = 3.0

That single number does not tell the controller whether the product is:

too red,

too green,

too yellow,

or simply too dark.

A controller needs to know which way to move the process.

This is why a practical color-control algorithm often examines:

ΔL*

Δa*

Δb*

separately rather than treating total ΔE as one ordinary PID PV.

ΔE is excellent for answering “how far from target are we?” It does not always answer “which process input should move in which direction?”

Metamerism: A Match Under One Light Can Fail Under Another

Two materials can appear to match closely under one light source and differ visibly under another.

This phenomenon is called metamerism.

The two samples may have different spectral-reflectance curves even though their calculated color under one illuminant is very similar.

For example, two paints may match under daylight but separate noticeably under retail LED lighting.

This is why critical color matching may require evaluation under more than one illuminant.

The relationship between illumination and measured appearance also connects naturally with PID light control.

RGB Is Not the Same as CIELAB

RGB usually describes three device channels: red, green and blue.

It is extremely useful when those channels are the physical actuators, such as in an LED lighting system.

But raw RGB numbers are generally device-dependent.

The same RGB command can produce different physical color on different LED modules or displays.

CIELAB and CIE XYZ are more useful when color must be communicated independently of one particular device.

Therefore an industrial closed loop may:

measure color in XYZ or L*a*b*,

calculate the color error,

then translate that correction into RGB channel commands.

Closed-Loop RGB LED Color Control

An RGB LED system may use separate red, green and blue current or PWM commands.

A simplified loop is:

Color sensor → XYZ / chromaticity / L*a*b* calculation → Controller → RGB current or PWM → LED output

The important complication is that the channels are coupled.

Increasing red may affect:

chromaticity,

total luminous output,

and the resulting measured color coordinates.

Changing one actuator therefore influences more than one measured output.

This is already different from a simple one-input, one-output pressure PID loop.

LED Temperature Can Shift Color

LED optical output is not perfectly constant with temperature.

Changes in junction temperature can affect luminous flux and chromaticity.

Drive current can also shift optical behaviour.

This means one fixed RGB PWM combination may not generate exactly the same measured color under:

cold startup,

normal operating temperature,

high thermal load.

For high-accuracy systems, temperature measurement can be used for compensation, or optical feedback can continuously trim the RGB channels.

Ageing can introduce another long-term source of drift.

Color Sensor Feedback Can Correct LED Drift

A color sensor can continuously compare LED output with a stored reference.

If the measured color shifts, the controller can adjust the individual RGB outputs.

This is useful where temperature, drive-current variation or ageing would otherwise cause visible color drift.

In a simple system, separate PI loops may work reasonably well.

In a precision system, however, the cross-coupling between RGB channels may justify a matrix-based or multivariable controller.

Paint and Pigment Control Is a Different Type of Color Loop

In paint, plastic or textile production, the manipulated variables may be:

pigment dosing rate,

base-material flow,

dye concentration,

solvent addition.

This connects color correction directly with flow and dosing control.

Suppose a measured batch is too yellow.

The correct response is not simply “increase PID output”.

The process model needs to know which pigment or feed change moves the product away from yellow without creating an unacceptable change in lightness, red-green balance or another quality parameter.

Colorant Interaction Makes the Process Multivariable

A formulation may contain several pigments.

Changing one pigment can simultaneously move:

L*,

a*,

b*.

Similarly, one RGB LED channel influences several chromaticity and brightness variables.

The control problem therefore becomes:

multiple manipulated inputs → multiple measured color outputs.

This is a classic area where independent PID loops can begin to interact with each other.

The issue is directly related to the limitations of single-loop PID control.

Can You Use Separate PIDs for L*, a* and b*?

Sometimes, but only if there is a reasonably clear relationship between each control output and each color coordinate.

If one actuator mainly influences a*, another mainly influences b*, and interaction is weak, separate loops can be practical.

If every actuator strongly moves every color coordinate, three independent PID loops can fight each other.

In that case, more suitable methods may include:

decoupling,

matrix transformation,

recipe-based correction,

multivariable optimization,

model predictive control.

This does not mean MPC should automatically replace PID.

It means the controller architecture should reflect the real degree of process interaction.

Feedforward Is Extremely Useful in Recipe-Based Color Processes

When a product recipe is already known, there is little sense in asking PID to discover the complete color formulation from zero.

A stronger structure is:

Recipe → Initial pigment / RGB command

followed by:

Color measurement → ΔL*, Δa*, Δb* → Feedback trim

The recipe provides the main action.

The feedback controller corrects:

raw-material variation,

temperature effects,

dosing error,

LED drift,

process variability.

This is a practical application of the distinction between feedforward and feedback control.

Mixing and Transport Delay Can Cause Color Overshoot

A pigment dose does not necessarily appear immediately at the spectrophotometer.

The colorant may need time to:

enter the mixer,

disperse,

become homogeneous,

travel to the measurement location.

If the controller continues adding colorant before the first correction has been measured, the batch can overshoot the target.

This makes time delay and process dynamics critical in automatic pigment correction.

Colorant over-addition can also be asymmetric: adding more pigment may be easy, while removing an excessive dose may require adding a large amount of base material.

PI May Be More Useful Than Full PID

Many batch color processes are slow.

Proportional action responds to the present color-coordinate error.

Integral action can remove a persistent small bias.

Derivative action reacts to rapid measurement change, but optical measurement noise and sample variation can make D undesirable.

Therefore full PID is not automatically the best choice.

A PI controller, recipe correction or model-based trim may be more appropriate.

The decision should follow the actual process response, as discussed in P, I and D control components.

Measurement Geometry Matters

A glossy coating, matte textile and metallic surface do not interact with light in the same way.

Spectrophotometers can use different optical geometries such as:

45°/0°,

0°/45°,

diffuse sphere geometry.

Whether specular reflection is included or excluded can also change the reported result.

Therefore supplier and customer measurements should use agreed and repeatable measurement conditions.

The measurement device is not the whole measurement system.

Sample preparation, orientation, backing and surface condition are also part of the feedback path.

UV and Optical Brighteners Can Affect Measurement

Paper and textiles may contain optical brightening agents.

These materials can absorb ultraviolet energy and emit visible fluorescence.

Changing the UV component of the measurement source can therefore change the measured appearance.

For critical white products, measurement standards may need to define the UV condition as well as illuminant and observer.

PLC Integration

A PLC can manage the process-level parts of color control, including:

receiving L*a*b* or XYZ measurements,

storing target recipes,

calculating ΔL*, Δa* and Δb*,

controlling dosing pumps,

handling minimum and maximum additions,

Auto / Manual operation,

batch transitions.

Where a color sensor provides a conventional electrical output, correct analog signal scaling may also be required.

The broader architecture belongs to PID control with PLCs.

Measurement Update Rate Sets a Practical Control Limit

An inline spectrophotometer may produce a new valid measurement only at a defined rate.

The product may also take several seconds or minutes to travel from dosing point to sensor.

The complete feedback delay can therefore include:

mixing time,

transport delay,

instrument integration time,

network update time.

Running the PID task much faster does not create new process information.

The controller timing should therefore be consistent with the real sensor update and process delay, a principle also covered in real-time PID control.

Output Saturation and Integral Windup

A pigment pump has a maximum flow.

An RGB LED channel has a maximum current or PWM duty.

If the required correction exceeds that physical range, the controller cannot continue moving the color in the requested direction.

If integral action continues accumulating error during saturation, integral windup can result.

Once the process re-enters a controllable region, the stored integrator may drive the system too far past the target.

Output limits, anti-windup and actuator capacity should therefore be included in PID troubleshooting.

What Should SCADA Record?

A useful SCADA record should contain more than total Delta E.

Useful values include:

Target L*

Measured L*

ΔL*

Δa*

Δb*

ΔE

Pigment or RGB channel outputs

Product temperature

Production rate

Recipe number

This tells the process engineer not only that color moved out of tolerance, but how it moved.

Common Color-Control Problems

Delta E is acceptable but the customer still sees a mismatch: verify illuminant, observer, Delta E formula, measurement geometry and possible metamerism.

The same sample gives different results on two instruments: compare calibration, geometry, aperture, UV condition and inter-instrument agreement.

The color measurement is unstable: inspect sample position, surface texture, ambient-light influence and measurement repeatability.

The controller repeatedly adds pigment and then compensates back: process delay or integral action may be too aggressive.

Total Delta E improves but the visible hue moves in the wrong direction: inspect ΔL*, Δa* and Δb* separately.

RGB LED color drifts as the fixture warms up: investigate temperature and current-dependent chromaticity shift.

One recipe controls well but another does not: pigment interaction and process gain may be formulation dependent.

Color changes long after the correction command: mixing, curing, drying or transport delay may dominate the process.

Typical Applications

Paint and coatings: batch correction and product-to-product consistency.

Textiles: dyeing control and lot-to-lot color consistency.

Printing: ink, density and color-difference control.

Plastics: masterbatch and pigment dosing.

LED lighting: closed-loop RGB/RGBW chromaticity control.

Quality control: objective pass/fail evaluation against a documented tolerance.

Color-Control Commissioning Check

1. Which color space defines the target?

2. Which illuminant and observer are being used?

3. Which Delta E formula defines the tolerance?

4. Is measurement geometry documented?

5. Are UV, specular and sample-preparation conditions fixed?

6. Are ΔL*, Δa* and Δb* available in addition to total Delta E?

7. Which actuator moves each color direction?

8. Are the manipulated channels strongly coupled?

9. Is mixing or transport delay known?

10. Can a pigment pump or LED channel reach saturation?

11. Is anti-windup implemented where integration is used?

12. Can a recipe or feedforward command provide the initial correction?

13. Does temperature shift the measured or produced color?

14. Is metamerism relevant to the customer application?

15. Has the final product been checked under the actual required viewing conditions?

Related PID and Color-Control Topics

PID fundamentals: What Is PID? - P, I and D Components - PID Gain and Tuning - PID Limitations

Measurement and physical influences: PID Light Control - Temperature Sensors - Analog Signals

Process and dosing control: PID Flow Control - Time Delay and System Dynamics - PID and Other Control Strategies

Control infrastructure: PID with PLCs - PID with SCADA - Real-Time PID - PID Troubleshooting

Industrial color control requires more than one target number. Color space, Delta E formula, illuminant, standard observer, measurement geometry, sample preparation and the physical relationship between each actuator and the resulting color should all be defined before closing the control loop.