I have been working on a LED buck driver for a while but unfortunately without any succes.
The design is based on a MAX 16820 chip.
I use an attiny13 to generate the pwm signal for the MAX 16820. This part seems to be ok, I can change the pwm's duty cycle.
As the duty cycle changes the LED current also changes.
But if I change the input voltage the led current also changes, so the driver do not stabilize it.
At first I tested it with an XHP70 led, than I changed it to an xm-l2 (the current sense resistor was also changed) but I still have the same issue.
I have attached my calculations and the schematics.
I would really apprieciate any suggestions.