
on the left VCC i apply the pwm. The circuit allows a fixed max. current that is controlled by R1. With the PWM i can pull the circuit below the max value.
If you do not know this circuit i can tell you how it works.
If you remove T2 and R1 you got a simple circuit to control eg. a LED with PWM. The PWM signal is applied on the base of T1 and R2 is calculated as a normal Base resistor. The LED would be connected to OUT. This far everyone knows how it works i guess. Now the Current regulating part.
We use R1 to produce a Voltage difference of ~0.7V (UBE value of T2) between Base and Emitter of T2. And we select the R1 value by -> R1 = (UBE of T2) / Imax
I think an example helps:
We want to limit the current to 350mA. We expect UBE of T2 to be 0.7V .
R1 = 0.7/0.35
R1 = 2Ohm
What happens?
U =R*I
so the Transistor T2 will switch exactly @ 2Ohm * 0.35A
If this happens the Voltage Difference between Base and Emitter of T1 will be 0V because its base is shorted to Ground by T2.
When the current drops below 0.35A T1 starts to conduct again and so on. It is stabilizing itself.
I do not know if my explanation is good enough for you to understand this. Just ask if you don't get it right.
The advantage is that you save energy compared to a LED current limiting resistor that doubles the power consumption. The other advantage i see is that you can apply any Voltage above the minimum Voltage the LED needs. My Power supply is limited @ 24V so i could not test if the LED will still light @100V and above. But as the Current is limited by the circuit it should not be a problem.
For T2 you can use a small signal transistor.
My problem is that T1 get's too hot. Only reason could be that it cannot switch fast enough and is most of the time "half open". Well see
This image my help too

Left y-axis is Voltage in mV. Right y-axis is current in mA. X-axis is time.