Thanks for the advice. I'll do it right away. I'll just let you know the results. I assume that I'm in the right direction because I was beginning to doubt my design and I'm starting to to entertain some other ways of measuring power factor.
IMHO it is better to use a current sensor instead a transformer to measure the current.
A transformer can make some phase shift and so the measurement is faulty, or You have to compensate that.
Galvanic isolation is given too.
You can take a look to Allegro ACS 7xx series, or an other current sensor.