On this page
A digital temperature controller can stop correcting a persistent small error even though its heater has available power and its integral gain is nonzero. The missing correction may be lost in arithmetic: every small update is rounded away before it enters the stored state. Inspect the accumulator, not just the gain shown on the setup screen.
System boundary
The sampled PI calculation and command conversion for a resistive heater. Numerical examples isolate arithmetic with prescribed error; they are not temperature trajectories or heater ratings.
Integration interfaces
| Interface | Required input | Thick film role | Validation owner |
|---|---|---|---|
| Temperature error to integral increment | Error units, sample interval, integral gain and arithmetic formats. | The heater receives the result of the controller calculation, not the discarded fraction. | Firmware and controls engineers. |
| Stored state to actuator command | Accumulator scale, rounding rule, output counts and limiting sequence. | A retained correction can eventually change power without changing the heater geometry. | Controls integration owner. |
| Command to delivered heat | Driver resolution, valid pulse width and synchronized electrical measurements. | The installed heater still depends on actual voltage, resistance and thermal loading. | Power and thermal engineers. |
Integration risks
| Risk | Control or verification | Validation owner |
|---|---|---|
| A fractional correction is rounded to zero on every update. | Retain sufficient accumulator precision and test the actual conversion points. | Firmware owner. |
| More fractional bits leave insufficient range for the state or intermediate product. | Budget signed range and intermediate arithmetic before selecting the representation. | Embedded software owner. |
| A numerical improvement is mistaken for an improvement in physical actuator resolution or safety. | Validate the driver and independent equipment protection separately. | Equipment integration owner. |
System integration decisions
- Separate the precision of the stored integral state from the resolution of the physical output.
- Locate each multiplication, conversion and assignment that can discard a small correction.
- Verify positive and negative persistent errors with the actual firmware arithmetic.
Identify which resolution stops the correction
There are at least three distinct steps between a small temperature error and a change in heat: the sensor represents the error, the controller accumulates a correction, and the actuator represents the requested output. A high-resolution temperature display does not establish the precision of the integral state. Likewise, a floating-point controller cannot make a switching device deliver a pulse shorter than its supported minimum.
Begin with an error that is visible in the controller's input data and an output safely inside its permitted range. Log the calculated increment, stored integral contribution and final output count. If the increment is nonzero before conversion but the state never changes, the investigation belongs in arithmetic. If the state changes while the actuator stays at one count, investigate the output mapping instead. Keep these observations separate before changing a printed heater resistance.
Give the stored state explicit units
For this discussion the integral state is already an output contribution, measured in actuator-command counts. It is not an unscaled sum of temperature samples. That distinction determines where the gain and sample interval belong. An implementation that stores accumulated error uses a different representation and must be translated before comparing its integer values with this equation.
Write down the order in which error, gain and interval are multiplied and converted. A wide accumulator cannot recover information that was already lost by integer division in an earlier expression. Check the types of intermediate values as well as the declared type of the final variable. Fixed-point assignment can introduce another quantization after an apparently precise multiplication, so inspect the full calculation path.
I[k+1] = I[k] + Ki Ts e[k]
- I is the stored integral output contribution in command counts.
- Ki is integral gain in command counts per kelvin-second.
- Ts is the update interval in seconds; e is target minus measured temperature in kelvin.
- k is the update index; the expression precedes any state or output quantization.
A sampled parallel PI controller with prescribed interval and error. Derivative, feedforward, limiting and mode tracking are outside this isolated arithmetic example.
Calculate a correction that disappears at every update
Consider a hypothetical Ki of 4 counts per kelvin-second, an interval of 0.1 second and a constant error of 0.2 kelvin. The intended increment is 0.08 count per update. If firmware rounds each increment to the nearest whole count before adding it to an integer state, the added value is zero. Thirteen updates still produce zero change, and repeating the same arithmetic indefinitely does not repair the loss.
By contrast, the unquantized accumulated change after thirteen updates is 1.04 counts. The important difference is rounding the accumulated correction rather than separately rounding every increment. These operations are not interchangeable. This example holds the error constant to expose the numerical mechanism; a real thermal loop changes its error with time and needs a separate closed-loop test. Raising the integral gain until the increment exceeds half a count changes the controller response and is not a neutral repair.
Retain fractions without confusing them with output counts
As an explanatory decimal representation, store the state in hundredths of one output count. The increment above becomes eight internal units. Starting from zero, thirteen updates produce 104 internal units, equivalent to 1.04 output counts. If the positive output is converted by taking the floor, the first full output count appears at update thirteen. If final output conversion instead rounds to nearest, it first reaches one at update seven, when the state is 0.56 count.
Neither conversion gives the driver a fractional physical count. Both preserve information between updates that the naive calculation discarded. Specify the final rule explicitly, including ties and negative values. Flooring a positive demonstration is not a complete signed-control policy: always flooring negative values can introduce a directional bias. A signed residual accumulator can serve the same purpose, but its carry, borrowing and reset behavior must be defined and tested.
| Update | Round each increment to integer | Retained state in output counts | Positive floor output | Nearest output |
|---|---|---|---|---|
| 1 | 0 | 0.08 | 0 | 0 |
| 6 | 0 | 0.48 | 0 | 0 |
| 7 | 0 | 0.56 | 0 | 1 |
| 12 | 0 | 0.96 | 0 | 1 |
| 13 | 0 | 1.04 | 1 | 1 |
Budget the remaining internal quantization
More precision reduces a numerical error; it does not automatically eliminate it. With 256 internal units per output count, rounding the 0.08-count increment gives 20 internal units, or 0.078125 count. That is 2.34375 percent below the intended increment. With 1,024 internal units per count, rounding gives 82 units, or 0.080078125 count, about 0.09766 percent above it. These comparisons quantify one increment, not total temperature accuracy.
Choose a format against the smallest correction that must remain effective and the largest state and intermediate product that must be represented. Adding fractional bits to a fixed word length reduces available integer range. Overflow that wraps a positive heater request into another value is unacceptable as an accidental behavior. Establish the intended range handling, conversions and diagnostics; do not select a processor word size from this example alone.
Preserve the separate rules for limits and timing
Accumulator precision and anti-windup solve different problems. Retaining a sub-count correction is desirable when the actuator can respond, but accumulating an unlimited positive state against a saturated output can still cause delayed recovery. Keep the chosen saturation and tracking logic after changing arithmetic precision. Verify that its comparison values and units are converted consistently rather than mixing an internal scaled state with an unscaled command limit.
The update interval also sets the increment. If software assumes a fixed interval but actual execution varies materially, the numerical integral no longer represents the intended elapsed-time weighting. Record the scheduling assumption and determine whether the implementation uses a fixed period or measured elapsed time. Mode changes and parameter updates must preserve a coherent state; a change of scale without conversion can create a large command discontinuity even when the underlying temperature is steady.
Test the arithmetic before energizing the load
Run deterministic firmware tests with prescribed errors and timestamps. Include small persistent positive and negative errors, alternating signs, zero error, reversals after a long accumulation and values just below a quantization boundary. Compare the actual stored values with an independent high-precision calculation. Record every quantizer and the expected difference; a smooth plot can hide a persistent bias or the complete loss of tiny updates.
Then test the complete controller with the approved thermal setup and protection active. Log input error, integral state, requested count and actual actuation on the same time base. A command that alternates between neighboring counts may be normal quantized control or may produce unacceptable thermal ripple; decide from the application response. The arithmetic repair does not establish sensor accuracy, heater uniformity or the safety of a particular switching waveform.
Deliver a reproducible controller integration record
The handoff should include units, gain form, state scaling, intermediate formats, rounding behavior and range handling alongside test vectors with expected results. Preserve the firmware version and timing assumptions. This lets an engineer distinguish a deliberate quantization policy from a compiler conversion or a later change that silently reduces precision.
For a custom ceramic thick-film heater assembly, supply the electrical load and thermal requirements separately from the controller arithmetic. Include the actual driver's command-to-power behavior and any minimum pulse limitation. A reproducible numerical correction can remove one source of persistent control error, but the complete design still needs its electrical, thermal and equipment-level validation.
Review the heater and its digital control interface
Share the heater load, power stage and the numerical command path so the source of a small persistent error can be isolated.
- Heater drawing, required thermal load and source voltage constraints.
- Controller equation, gain units, sample timing and state representation.
- Output resolution, rounding rules and minimum effective pulse information.
- Test vectors and synchronized error, integral-state and actuator traces.
The drawing-upload form loads as you reach this section.

