Given:

V = L di/dt

I(t) = I(t0) + 1/L × ∫ V(t) dt

Rearrange:

(L/V) × (I(t) - I(t0)) = dt

Using the formula:

PWM on-time = (L/V) × 2 × (I_{DESIRED} - I_{START})

For most applications, the input voltage can't change very quickly-because of large input-filter capacitors. Therefore, you needn't calculate the time-consuming divide operation (L/V) for every execution of the control algorithm.

To reduce the computational workload, you can share this calculation among a number of PWM cycles. By treating the (L/V) term as a quasi-constant, the remainder of the duty-cycle calculation becomes trivial. By not using an analog comparator for PWM termination, the analog comparator becomes available for detecting unexpected severe load-current transients or output overvoltage conditions.

It's important to select the optimum method for digital current control in a specific application. There are several methods for implementing it.

METHOD 1: PEAK DIGITAL CURRENT CONTROL

This method calculates the voltage across the inductor, measures the starting
current, and calculates the desired inductor current based on the output-voltage
error.

You then calculate the duty cycle using:

Duty cycle = (L/V) × 2 × (I_{DESIRED} - I_{START})

METHOD 2: AVERAGE DIGITAL CURRENT CONTROL

There are several methods to measure the average inductor current. One involves
measuring the current midpoints of the PWM on-time or off-time. A second method
is to measure the peak and valley currents at the PWM transitions, sum the values
together, and then divide by two. Directly measuring the average current doesn't
require a low-pass filter or integrator as it would with an analog controller,
which improves transient response.

The control software needn't calculate PWM based on the inductance and applied voltages. Instead, it can use a gain coefficient to scale the difference between the average measured current and the desired current. That product becomes the PWM duty-cycle value. Choose the gain coefficient value to provide good response without oscillation.

METHOD 3: VARIABLE-FREQUENCY DIGITAL CURRENT CONTROL

For most DSCs, software can control the PWM period as well as the duty cycle.
The software can measure the inductor current at any point—at the start
or end of the PWM pulse or at a midpoint to detect minimum, peak, or average
current values.

An advantage of variable-frequency techniques is that they reduce switching losses with load-current reductions, which helps to improve power-conversion efficiency. The disadvantage of variable-frequency, current-loop-control schemes is that the operating frequency varies, which can make electromagnetic-interference control more difficult in larger systems because it makes it harder to avoid critical system frequencies.

METHOD 4: HYSTERETIC DIGITAL CURRENT CONTROL

It's possible to implement hysteretic current-mode control without using analog
comparators. The software on the DSC can control both the PWM duty cycle and
the period. It also can change these values during PWM operation. The PWM off-time
represents the period minus the PWM on-time.

Calculating the PWM on and off times is similar to the process described earlier—by
measuring the voltage across the inductor and the inductance and knowing the
desired average current via the voltage error (see
the figure)*. *Then, calculate the PWM on and off times and load the
PWM generator control registers with the duty-cycle and period values. It's
also possible to measure the peak and valley currents instead of the midpoint
average currents. Because software determines the PWM on and off times, it's
easy to set the ADC sampling times to capture the peak and valley currents.

ADVANCED SENSORLESS DIGITAL CURRENT CONTROL

A more sophisticated method uses the voltage versus current equations for capacitors
and inductors to predict the current through the inductor:

Given:

V(t) = L di/dt

I(t) = I(t0) + 1/L × ∫ V(t) dt

I(t) = C dv/dt

V(t) = V(t0) + 1/C × ∫ i(t) dt

If additional information is available (such as the ESR of the output capacitor) and the resistance of the inductor is known, more accurate current estimates can be made. Calculate the ripple current by knowing the voltage across the inductor and the time the voltage is applied.

By measuring the voltage drop across the inductor, you can calculate the dc component of the current by subtracting the inductive voltage drop from the measured voltage drop. To calculate current, divide the voltage difference by the inductor resistance. Use a similar process for the voltage ripple on the filter capacitor.

FEED-FORWARD TECHNIQUES

One of the benefits of current-mode control is improved response to input voltage
variations. With digital control of SMPS systems, providing feed-forward compensation
for input voltage variations becomes easy. Most SMPS topologies have relatively
simple transfer equations that describe the output voltage in terms of input
voltage, duty cycle, and transformer turns ratio. You can add a voltage feed-forward
term to either to the current set point or in parallel with the current control
loop. The transfer equation for a buck converter is:

V_{OUT} = V_{IN} Duty Cycle/Period

Usually, the desired result of any control calculation is to create a value to be loaded into the PWM duty-cycle register:

Duty Cycle = V_{OUT} (Period/V_{IN})

The cost of calculating the feed-forward compensation for the input voltage is the time required to perform the division operation. The feed-forward compensation techniques are inherently stable and provide faster transient response.