Simple buck regulator inductor selection using Python

The following example shows how to compute the ideal, minimum and maximum inductance for a buck regulator using Python and the UliEngineering library.

In our example, we use a LMR36006-Q1 from Texas instruments. Note that the formula is virtually the same for pretty much all modern buck regulators you can buy, from the cheapest Chinese to the rad-hardened space parts.

First, install UliEngineering using

pip install -U UliEngineering

Now you can use the following code to compute the inductor values

from UliEngineering.Electronics.SwitchingRegulator import *
from UliEngineering.EngineerIO import *

Vin = normalize_numeric("48V")
Vout = normalize_numeric("5V")
fsw = normalize_numeric("2.2MHz")
Ioutmaxmax = normalize_numeric("300mA")

abs_max_inductance = buck_regulator_inductance(Vin, Vout, fsw, Ioutmax, K=0.1)
max_inductance = buck_regulator_inductance(Vin, Vout, fsw, Ioutmax, K=0.2)
optimal_inductance = buck_regulator_inductance(Vin, Vout, fsw, Ioutmax, K=0.3)
min_inductance = buck_regulator_inductance(Vin, Vout, fsw, Ioutmax, K=0.4)

# Another minimum inductance based on the desire to avoid subharmonic oscillation
# This highly depends on the IC in use, check the datasheet for more information
# Example is for LMR36006 from Texas Instruments
min_inductance_osc = 0.28 * Vout/fsw

# Compute saturation current rating for the inductors
curent_rating_safety_factor = 1.2
abs_max_inductance_peak_current = buck_regulator_inductor_rms_current(
    Vin, Vout, abs_max_inductance, fsw, Ioutmax, safety_factor=curent_rating_safety_factor
)
max_inductance_peak_current = buck_regulator_inductor_rms_current(
    Vin, Vout, max_inductance, fsw, Ioutmax, safety_factor=curent_rating_safety_factor
)
optimal_inductance_peak_current = buck_regulator_inductor_rms_current(
    Vin, Vout, optimal_inductance, fsw, Ioutmax, safety_factor=curent_rating_safety_factor
)
min_inductance_peak_current = buck_regulator_inductor_rms_current(
    Vin, Vout, min_inductance, fsw, Ioutmax, safety_factor=curent_rating_safety_factor
)

# Compute RMS (thermal) current rating for the different inductances
rms_current_rating_safety_factor = 1.1
abs_max_inductance_rms_current = buck_regulator_inductor_rms_current(
    Vin, Vout, abs_max_inductance, fsw, Ioutmax, safety_factor=rms_current_rating_safety_factor
)
max_inductance_rms_current = buck_regulator_inductor_rms_current(
    Vin, Vout, max_inductance, fsw, Ioutmax, safety_factor=rms_current_rating_safety_factor
)
optimal_inductance_rms_current = buck_regulator_inductor_rms_current(
    Vin, Vout, optimal_inductance, fsw, Ioutmax, safety_factor=rms_current_rating_safety_factor
)
min_inductance_rms_current = buck_regulator_inductor_rms_current(
    Vin, Vout, min_inductance, fsw, Ioutmax, safety_factor=rms_current_rating_safety_factor
)

# Print results
print("Absolute maximum inductance: ", format_value(abs_max_inductance, "H"), 
    " with Isat >= ", format_value(abs_max_inductance_peak_current, "A"), 
    " & Irms >= ", format_value(abs_max_inductance_rms_current, "A"))
print("Maximum inductance: ", format_value(max_inductance, "H"), 
    " with Isat >= ", format_value(max_inductance_peak_current, "A"), 
    " & Irms >= ", format_value(max_inductance_rms_current, "A"))
print("Optimal inductance: ", format_value(optimal_inductance, "H"), 
    " with Isat >= ", format_value(optimal_inductance_peak_current, "A"), 
    " & Irms >= ", format_value(optimal_inductance_rms_current, "A"))
print("Minimum inductance: ", format_value(min_inductance, "H"), 
    " with Isat >= ", format_value(min_inductance_peak_current, "A"), 
    " & Irms >= ", format_value(min_inductance_rms_current, "A"))
print("Minimum inductance to avoid subharmonic oscillation: ", format_value(min_inductance_osc, "H"))

This code will output the following values:

Absolute maximum inductance:  339 µH  with Isat >=  360 mA  & Irms >=  330 mA
Maximum inductance:  170 µH  with Isat >=  360 mA  & Irms >=  330 mA
Optimal inductance:  113 µH  with Isat >=  360 mA  & Irms >=  330 mA
Minimum inductance:  84.8 µH  with Isat >=  360 mA  & Irms >=  330 mA
Minimum inductance to avoid subharmonic oscillation:  636 nH

Note that in order for the circuit to be short-circuit-proof, choose the inductor saturation current to be at least the switch currentl limit of the regulator (this is not included in the code above). For additional safety and considering the tolerance of both the inductor and the switch current rating, I recommend to add a safety margin of 20% to the saturation current rating.

As you can see, the subharmonic oscillator minimum value is rather irrelevant since it’s two orders of magnitude smaller that the “Minimum inductance” value based on ripple current.

Also check out the documentation of buck_regulator_inductance() and other functions from UliEngineering.Electronics.SwitchingRegulator for reference:

Compute the optimal inducitivity of a buck regulator

This formula is based on the the inductor ripple current fraction [K].

The formula we use is:

L = ((vin - vout) * (vout) / (f * K * Ioutmax)) * (Vout/Vin)

(note that Vout/Vin is an estimation for the duty cycle.)

A good assumption which is shared by most major manufacturers is
to choose the inductor value in between K=0.2 and K=0.4.
Typically, the best inductor value is around K=0.3,
but one depends 

It is generally recommended by the more verbose datasheets, to alwas choose
the inductor larger than the value obtained with K=0.1. This is due to the
current mode control scheme which requires a certain level of inductor ripple.

Note that many datasheets also specify minimum inductor values to avoid
subharmonic oscillations. This depends on the part and varies by more than
and order of magnitude and is not handled by the function.

For reference see e.g. TI at https://www.ti.com/lit/ds/symlink/lmr36006.pdf#page=22,
section 9.2.1.2.4: Inductor Selection.