Hello,
I am trying to use LM5021 to convert 220V AC into 5V DC.I have one doubt from the reference design of LM5021.What is the purpose of D2 and D4? According to me only D4 should be there because when MOSFET (Q1) turn OFF then D4 will provide a path for the current to flow through inductor (3-1) of transformer and prevent MOSFET from damage.But having D2 would prevent this current from flowing and due to this a large voltage can be appear on the Drain of the MOSFET and can damage it.