If you want to try a roll-your-own circuit without using a specialized controller IC, below is the LTspice simulation of a fairly simple constant-current hysteretic control SMPS using common IC components..
A hysteretic control SMPS has the advantage of being unconditional stable with no feedback compensation required.
The simulation shows the output current does not change (expect for the ripple) with an input step voltage change from 4V to 17V.
Note that, as with most SMPS circuits, it will not work well (or at all) if you build it on a plug-in breadboard.
It should be built on a vector board (preferably with a copper ground plane) due to the high frequency, high current signals in such a circuit.
All signal and ground paths carrying the high currents should be built with as short a connection as possible.
View attachment 121076