Arduino Control Buck Converter

Morning!
I am looking to use an Arduino to control a buck converter, five independent converters to be exact, but we will just stick with one for now. I need some help with where to start, etc.

The goal is to have a controller with PWM for the new Cree MK-R so that I have extensive control over the brightness... 125mA for 20% flux to 1166mA for 150% flux. However, I can live with any current limitation beyond 700mA since I will have heat dissipation issues.

The voltage source would be LiPo 4S, 5S, and 6S hobby batteries which are 14.8v, 18.5v, and 22.2v respectively. I will have to monitor voltage since these are not protected batteries, but that is not a big deal.

Now my understanding of buck converter (my EE experience is not strong) is that I can use duty cycle to regulate the voltage on the output. So if the Arduino is programmed for the different LiPo batteries called out above, I can just use PWM to regulate the output voltage to 12v no matter the input... unless the components are not sized properly or cannot be versatile enough for this. This is where I need help in selection of of them.

Then to add on to that, how do I regulate the current or the effective on current on the LED to regulate the brightness? How does that play into the buck converter such that the circuit does not become out of balance?

The voltage and current through the LED at any given time while energized will effectively be constant as current is forced out by the buck converter

The resaon why LED's seem dimmer is by virtue of the PWM factor and our eyes inability to discern the actual flash frequency

abrookfield:
The voltage and current through the LED at any given time while energized will effectively be constant as current is forced out by the buck converter

The resaon why LED's seem dimmer is by virtue of the PWM factor and our eyes inability to discern the actual flash frequency

Correct. However my concern is what happens to the buck converter and how do you design a buck converter to have adjustable current or as you brought up, adjustable PWM? The Buck converter already has a switching component to control how much energy is stored in the inductor for converting a high input voltage to a low input voltage.

I've used (very effectively) this driver package Sure 9V-30V PWM Step-down Buck Driver for 3W LED DC/DC Power Supply Module 800mA | eBay

Reading the specs on the driver chip itself (MacroBloc MBI6651) - by changing external components tied to the chip, you can vary the output current

SO, you're going to need a multi-pole switch so you can bring in different resistor and inductor values based on what current you physically want to apply to the led

UNLESS you really just want to turn the current-flow (power) on and off to the led which is what most PWM inputs to buck drivers do anyways,
In essence, by turning power on and off at different intervals by using PWM input to your buck driver, when it is "averaged out" you would end op with lower current (PWM=1) to higher current (PWM=255) overall

Well once I realized I was searching in Google for the wrong wording, I found that a LM3401 may be up my alley (or similar). I also finally have WEBENCH working and it designed the circuit for me! Imagine that. All I need to do is use the Arduino to control the dimming pulse and monitor for low voltage cutoff on the LiPo. The downside is that the circuits will not do the large selection of LiPos I wanted. I am going to need to constrain this to the 14.8 4S 5000mAh LiPo batteries to control the 5 individual 3404, each with a Cree MK-R attached.

Thanks,
Frank