I've just finished modifying an LED light that had a rather odd circuit. I haven't got any questions here and I'm posting because what I found might be of interest.
The LED light had significant flicker at about 100 Hz when I got it. I'm sensitive to that so I had to change it.
The light runs from a regulated 24 V supply, and when I measured the LED voltage, it was being switched at around 50 kHz and the 100 Hz, variable duty cycle PWM was enabling that. I worked out the circuit, which is "before.pdf". There is sufficient gain in the op-amp and the two transistor that the circuit oscillates at about 50 kHz, so the op-amp is controlling the average current, not an instantaneous current. The current produced a voltage drop across the 1 Ohm resistor, and that was compared with a reference voltage divided down from 5 V
I don't know the values of the unlabelled capacitors, but and I don't understand what they are doing, but without the between the op-amp input the oscillation frequency is near 1 MHz.
The PWM was achieved by turning on and off the supply to the op-amp, so the op-amp was powered from the I/O pin of a microcontroller.
I moved the op-amp supply to the 5 V, and connected the current reference to a smoothed version of the PWM signal. That worked quite well but the lights never turned off. I added the 1k and 1M resistors to add small offset to make the op-amp turn off completely at 0% PWM. The circuit is in "after.pdf".
The were a couple of other things that I don't understand about the circuit. Firstly, it was all through-board components, and looked like it could have been made in the 1990s, although the LEDs are on a separate aluminium board, and they are surface mount. Secondly, there are two independently controlled banks of lights, and the arrangement of supplying the op-amps with the PWM signals meant that two separately packaged op-amps had to be used. They had used dual op-amps, LM358s, so their odd arrangement cost an extra op amp.