What would be the best way to limit the current into a 2.1Ohms, 12V max heating element fed with a range of known dc voltages (5V to 12V) with also known maximum input currents (2A to 5A)? The load can only be switched from the high side as the low side is shared with a thermocouple.

My first experiment was using a +/- 40 kHz to 400 kHz pwm signal to control a high side mosfet, with the duty cycle as a way to modulate the average current consumption. That led to big inrush currents, even at 1% on time.

So my second idea was to used a buck converter. Given a known input voltage and current sourcing capability (let's say 5V, 2A = 10W) and a estimated efficency of the buck (90%), that gives a certain amount of power that can be fed to the heating element (9W). Finally using ohms law, \$V = \sqrt{P \* R}\$, I can determine the output voltage of the buck (in this case 4.34V).

The second idea works quite well, however I'm aiming for a compact solution, and the coil and the input/output capacitor end up quite having to be quite large when running simulations.

So I thought I would reach out to the community for any other possible solutions. Thanks in advance for your inputs!