Thanks for the reply.
The part I understand is the voltage divider taken from the output thru resistors R4 and R5.
This divided voltage goes to TL431, which has internal 2.5V reference. The difference between voltage divider output and 2.5v is the error voltage.
Depending on the magnitude of the error, the PWM duty cycle varies.
Am I right so far?
The part I don't understand is - why is the optocoupler anode connected before the inductor. Mainly the opto diode-R1 and R2 loop is the part I don't get.
Also what is the need for R6 and C1 in the TL431 ckt.