Crude picture!
PWM is simple MC34063. Vin, Vout, ground, and FB shown. (some not shown)
The PWM will work hard of FB<1.25 volts.
The PWM will stop working if FB>1.25V.
To get 1.25V across the 1K resistor current must flow from the transistor. This same current will cause 2.50V across the 2K resistor.
To get the transistor turned on, the voltage across the LM317 must be about (2.50+0.65=3.15).
If you don't like the 3.15V number change either resistor.
View attachment 102211
The 100 ohms on the base is not critical. Could be 1k.