Greetings. Based on my previous post finally i came up with the programming. But I need a little favour or guidance if what i done is correct. My project is based on designing a SCR gate controller circuit for a FW H bridge rectifier. So i decided to use arduino Duemilanove to help my cause. I came across a journal where they precisely explained the generation method but they used Atmega-32. So i followed the steps. The following is the method and I have attached the zero cross detection circuit along with its simulated o/p.
Methods:
-
At any time when zero crossing (rising edge of square wave) is detected on the AC mains, arduino is interrupted and the latest values of
ADC is used to manipulate firing delay which is use to determine firing angle. According to the firing angle, the triggering pulse is generated for gate terminal of SCR to trigger the thyristor. On LCD, ADC output and firing angle which is calculated from ADC reading is displayed for the observer who is controlling the converters output. ADC output is 0-1023 which is use to control firing angle 0-180 degrees. Let ADC is the output from analog to digital converter and alpha is the firing angle. So alpha is calculated using the following equation:
alpha = ADC/5.68 -
Nxt is calculating the delay as per the firing angle which is based on the ADC output and ADC output is based on the analog voltage (0-5V). AC supply is 50Hz it have the time period of 20ms and for positive half cycle time period is 10ms, ADC reading is converted into a delay after which firing pulse is to be generated. If ADC is output of ADC and d is the delay in microseconds, then
d=(ADC*5)*1.955
1.955 here is the scaling up factor for the ADC reading and 5 is the reference voltage.
So this is the method i followed but i m having doubts whether it can be fired on the negative cycle of the rectifier. Plus I thought of using an external voltage as the controlling voltage to get the ADC voltage. Any other easy recommendation?
My program:
#include <LiquidCrystal.h>
/*
The circuit:
*LCD RS pin to digital pin 8
*LCD Enable pin to digital pin 9
*LCD D4 pin to digital pin 4
*LCD D5 pin to digital pin 5
*LCD D6 pin to digital pin 6
*LCD D7 pin to digital pin 7
*LCD R/W pin to ground
*/
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
int ZCDpin= A0;
int ADCpin= A1;
int SCRpin1= 9;
int SCRpin2= 10;
attachInterrupt(ZCDpin, loop, RISING);
void setup (){
pinMode (SCRpin1, OUTPUT);
pinMode (SCRpin2, OUTPUT);
lcd.begin (16, 2)
lcd.clear ();
analogReferrence (DEFAULT);
}
void loop (){
if (ZCDpin == 1){
adc_pot1()
}
else if (ZCD == 0){
adc_pot2()
}
lcd.setCursor (0,0);
lcd.print("Angle= ");
lcd.print(alpha);
lcd.write(0);
lcd.setCursor (0,1);
lcd.print("delay= ");
}
void adc_pot1(){
if (int x=0; x<180; x++)
{ int ADC= analogRead(ADCpin);
alpha= ADC/5.68;
d= (ADC*5)*1.955);
digitalWrite(SCRpin1, alpha);
delay (d);
void adc_pot2(){
if (int x=0=180; x<360; x++)
{ int ADC= analogRead(ADCpin);
alpha= ADC/5.68;
d= (ADC*5)*1.955);
digitalWrite(SCRpin2, alpha);
delay (d);