The triggerin in an antiparallel SCR configuration is different than from a Triac.
In a Triac you will always have three quadrant triggering and in select types, four quadrants.
But in the antiparallel SCR only two quadrants are available.
Actually i am trying to make a dimming circuit that can be controlled through the number of zero crossing. It looks something like this(fig 1). I am trying to trigger gate of triac to give variable power to the load.My overall program is this:
volatile byte count=0;
int AC_LOAD = 3;
int dimming = 128;
void setup()
{
Serial.begin(9600);
Serial.println("Zero Cross count");
pinMode(AC_LOAD, OUTPUT);
attachInterrupt(0, zero_crosss_int, RISING);
}
void zero_crosss_int()
{
count++;
firing();
}
void firing()
{
int dimtime = (75*dimming);
delayMicroseconds(dimtime);
digitalWrite(AC_LOAD, HIGH);
delayMicroseconds(10);
digitalWrite(AC_LOAD, LOW);
}
void loop() {
delay(1000);
noInterrupts();
int zc = count;
count = 0;
interrupts();
Serial.print("n=");
Serial.print(zc);
Serial.println(" ZC per second");
if(zc>=100)
{
dimming=0*128;
}
else{
dimming=0.5*128;
}
}
But the problem is : when i count the zero crossing per sec it works well, When i fire the triac alone it too works well, but when i tried to control the firing according to number of zero crossing
per second as below
, there appears a problem.
if(zc>100)
dimming=0*128;
else
dimming=0.5*128;
The problem is if i call function firing() within void zero_crosss_int() (as below) then number of zero crossing per second (which is want) goes higher than it should. I think this is due to delaymicroseconds() inside firing() which is causing some delay and made the time more than 1 second.
void zero_crosss_int()
{
count++;
firing();
}
Can you please suggest how can i do both stuff ( calculating zero crossing per second as well as firing the traic) at once. Thank you.