Hello zab,
I have done that for Stud Welding Machine. Following points might be helpful for you,
1) You will need three different ZCDs. Either Star or Delta will do. Step-Down Voltage Transformer followed by OpAmp will give you best results with good safety. Try to minimize the phase difference between actual ZCD and detected ZCD.
2) Having 3 ZCDs will also help you determine Phase-Sequence of R-Y-B. This is required for Correct thyristor firing sequence. You can also detect incorrect phase wiring and prevent undesired operation.
3) For Thyristor firing, some comments from my Source-Code header,
/*
Description:-
==============
We need to drive the 3-Phase Fully Controlled SCR bridge for Voltage/Current
control. Since AC input to this bridge is 50Hz, base frequency is 50Hz, but
actual drive signal must high frequency, i.e. beyond audio, to minimize humming
noise during operation. Also to reduce power requirements for driver, drive
signal is applied only for a pre-defined period instead of entire cycle.
1) Base Frequency - 50/60 Hz
2) Carrier Frequency - 20,000 Hz
3) ZCD Input - Actual +ve & -ve Zero Crossing of each phase.
+ve Zero Crossing - Falling Edge.
-ve Zero Crossing - Rising Edge.
4) Bridge Config - 1 3 5
4 6 2
5) SCR Conduction angle - With firing angle = a,
6+1 - (a+30) to (a+90)
1+2 - (a+90) to (a+150)
2+3 - (a+150) to (a+210)
3+4 - (a+210) to (a+270)
4+5 - (a+270) to (a+330)
5+6 - (a+330) to (a+30)
6) Max. Period for Drive- 1mSec
7) O/p Voltage with Free-wheeling diode at the output,
V(dc) = (3*sqrt(3)*V(ll)*cos(alpha))/pi, for 0 <= alpha <= 60
= (3*sqrt(3)*V(ll)(1+(cos(alpha)/2)-(sqrt(3)*sin(alpha)/2)))/pi, for 60 < alpha < 120
NOTE: alpha=0 is 30 deg from actual zero crossing of line voltage waveform.
v(ll)=Line-To-Line voltage of secondary (not w.r.t. to neutral if secondary is star)
*/
/*======*/
Base frequency is 50Hz.
A ZCD interrupt will occur for each +ve zero crossing of each phase i.e.R,Y,B.
ZCD sequence will be,
INTx Fired INTx Polarity ZCD Detected SCRs to Fire
=========================================================================-
INT1 +R - Falling 1 6+1
INT2 -B - Rising 2 1+2
INT3 +Y - Falling 3 2+3
INT1 -R - Rising 4 3+4
INT2 +B - Falling 5 4+5
INT3 -Y - Rising 6 5+6
** No 2 ZCDs(Edges) occur simultaneously.
For first 30 deg of phase it useless to try & drive the SCR, since it won't
be forward biased, so we add the 30 deg = 1.66mSec phase shift to our calculations.
60-ZCDs per 360 deg, Angle between successive ZCDs is 60 deg.
We can have, Min Prefire delay = 1.66mSec + 0.00mSec - Fired on ZCD + Phase Shift.
Max Prefire delay = 1.66mSec + 3.33mSec - Never fired at all.
Max. Fire Period = 1.00mSec
Min Fire period = 0.00mSec - Never fired at all.
Since we generate pre-fire/fire delays using interrupts & with RTOS, we need
certain minimum & maximum values for these delays.
For maximum possible resolution we use Timer3 16-bit timer in Fast PWM interrupt mode.
@ 16MHz clock, we have, Timer3 tick = 62.5nS
Prescalar = 8
Eff. Timer3 Tick = 500nS
6.66mS = 6.66m/500nS
Note that code is for ATmega128 @ 16MHz, running FreeRTOS 7.0.0.
For actual driving, again 3 transformers were used. Since frequency was 20kHz, we used Ferrite Transformers, resulting in small size. Note that design of the transformers greatly depend on SCR and snubbers must be on actual SCR terminals or very near to it.
I have some docs regarding this which I will try to get from my backup.
Hope this helps,
sam_des