I was thinking more of a single diode to trigger a synthesised full wave, at the end of which wait for another trigger pulse, then 180 degree switching shouldnt occur.
Yes that is what i am doing currently.
If you rectify the sine wave, you can no longer tell when it is negative and when it is positive.
You have two wires from the transformer. Zero Crossing is when they're the same. Simply connect them to + and - of the comparator (after appropriate conditioning). Comparator will go high for half of the wave and low for the other half.
What I don't understand is why, instead of using the sine wave that you already get from mains, you're trying to dissect it and then re-generate your own. It looks like a lot of work for nothing.
Hello again NG , glad and happy to see you again, helping me out
Maybe i could not explain it clearly earlier.I am trying to make a sine inverter converting DC from the PV to AC.
I have a relay which connects mains to the o/p of the H-Bridge. (Attaching the pdf for that scheme).So irrespective of mains presence or absence , i should be able to run the H-Bridge.
When the drives are present on the H-Bridge and inverter is running, and Mains arrives, the generated should phase-freq lock to incoming mains and then should the relay be switched.Then the inverter/drives can be switched off.
The load in this case will not see any pulse missing.
When mains fails, the inverter will be switched on instantly (few CPU cycles).
Now i am able to sync the Half rectified input wave to the o/p on the generated wave.
For this i took the rectified signal in the internal comparator of my MCU and compared with an internal DAC (set at 100mV)
The Comparator triggers another input capture timer channel.In the ISR for this channel, i reset the PWM pulses' index to zero each time.
Now i see something odd happening at times (grab on the DSO)
Maybe it is happening due to noise on the mains rectified input or something else...not sure..