OK, test on the above circuit was good based on LM358 chip because I could not handle the tiny OPA one. It worked very good on the PWM signal with good regulation.
Now I would like to add a current limir because the MOSFET cannot handle over 500mA and burns instantly, although I selected a FQP4P40 one that say can accept up to 3,5A being a 400V transistor.
The scheme I tried muted the MOSFET and is not working at all, as it seems to short the G-S! Tried either NPN or PNP configuration but even with no load current the MOSFET stays off. Can anyone please explain why is that happening?
Thanks
Ioannis