IADJ is licked
I started this PWM the iadj pin thing, so I'm finishing it. I worked out by hand and time slice integration/simulation, the situation with iadj, with the two agreeing. Bacgkround, the iadj pin can only take up to 1.24 V input to control current output of the light. Any more gets cut to 1.24 anyway by an internal diode.
Now, imagine a resistor R1 on the left in series with a capacitor C1 on the right, and they meet at Vout in the middle. A resistor R2 is in parallel with the cap, both connecting to ground on the right. R1 connects to a PWM voltage V1 on the left.
This happens to be just like your circuit except R2 is infinity, no problem. (my R1 is your Rf2)
The result is the maybe not surprising (I'd call it less obvious than it appears, when you start proving): Vout= V1* D * [R2/(R1+R2)]
If R2 is infinity this is just Vout=V1*D * 1
D is duty cycle.
Great so far. So we can make 100% max range 1.24 V if Vin is 5V by making R2=0.33*R1 in the usual voltage divider way (requires adding pads for R2, and I think it's best to add it, can always not use it)
Or we can just leave it alone and just use a duty factor of 25% for max output.
But what about ripple voltage? Ripple is obviously zero at duty cyle of 1. So if we set the max to 1.24, we get zero ripple at max power. That's kind of nice.
On the other hand, ripple (p2p) as a fraction is, (don't read the equation, just skip to the words past it)
dVout/Vout = (1-D)*(R1+R2)/(R1*R2) *1/(fC)
This is a max at (near) 0 voltage output, and if R2 is infinite max fractional ripple is just:
1/R1 * 1/(fC)
The ratio of max fractional ripple as R2 is decreased from infinity is just the inverse of the ratio of the max output voltage.
So for 1.24V output range, the max ripple (which is at minimum output) is 4 times higher than if setup for a 5V output range! (that's too bad)
So for 1.24V output range, we get better control ripple (0) at the max light ouput, but 4 times worse ripple at lowest output (near zero), compared to using the full 5V output range. I'm not exactly sure where they cross. Easy enough to work out, just didn't do it.
This is a little significant because for 1.24V output range, and R1 10kohm and cap of 1uF, the max ripple is 2% at 20khz PWM, not soooo tiny, and it's 1% at 50% outpu and .5% at 75% output etc.
Of course we care most about ripple at max output so I still like setting max to 1.24 by adding another 3.3kOhm resistor.
I like it anyway, because it just seems more sensible and probably more matched with existing direct drive software to have 100% PWM actually be the max output, not 25% PWM being the max output.
So let's add another resistor.