Hi...
i have prepared three phase controlled rectifier.now i want to test it.i have used R-triggering circuit and i am using arduino due.in that circuit, i have used six opto-coupler for six scr.
and they are giving six pulses as per my coding.but problem is of synchronisation. for that i have sensed line to line voltage and prepared schmitt trigger and it gives me zero crossing of the line to line voltage in terms of square wave then i put one diode to remove negative square pulse.
this pulse of 3.0 volt and i am giving this pulse to arduino due and i am generating six pulses but when i checked it on DSO then first pulse is not at exact zero cross of the voltage.some times it is at zero cross and sometimes it varies. so please suggest me what should i do? and my code is as follow.and also suggest me if there is problem in coding?
In this case, i am sensing the output of schmitt trigger and then i am checking the value of the square pulse whether it it on rising edge or falling edge. i only check it once then i am looping in infinitely and i am delaying all pulses at 3333 micro-seconds.
[MODNOTE]Please use code tags when pasting code... The "#" symbol.[/MODNOTE]
i have prepared three phase controlled rectifier.now i want to test it.i have used R-triggering circuit and i am using arduino due.in that circuit, i have used six opto-coupler for six scr.
and they are giving six pulses as per my coding.but problem is of synchronisation. for that i have sensed line to line voltage and prepared schmitt trigger and it gives me zero crossing of the line to line voltage in terms of square wave then i put one diode to remove negative square pulse.
this pulse of 3.0 volt and i am giving this pulse to arduino due and i am generating six pulses but when i checked it on DSO then first pulse is not at exact zero cross of the voltage.some times it is at zero cross and sometimes it varies. so please suggest me what should i do? and my code is as follow.and also suggest me if there is problem in coding?
Code:
int pin2=2,pin3=3,pin4=4,pin5=5,pin6=6,pin7=7;
int sensor=A0;
void setup() {
Serial.begin(115200);
pinMode(pin2,OUTPUT);
pinMode(pin3,OUTPUT);
pinMode(pin4,OUTPUT);
pinMode(pin5,OUTPUT);
pinMode(pin6,OUTPUT);
pinMode(pin7,OUTPUT);
// put your setup code here, to run once:
}
void loop() {
int i,c;
int d[15];
for(i=1;i<=15;i++)
{
d[i] = analogRead(A0);
Serial.println(d[i]);
d[0]= 1023;
c=d[i]-d[i-1];
Serial.println(c);
if (c>0)
{
goto IRFAN;
}
}
// put your main code here, to run repeatedly:
IRFAN:
while(1)
{
//Serial.println('c');
digitalWrite(pin7,LOW);
digitalWrite(pin2,HIGH);
delayMicroseconds(3309);
digitalWrite(pin2,LOW);
digitalWrite(pin3,HIGH);
delayMicroseconds(3309);
digitalWrite(pin3,LOW);
digitalWrite(pin4,HIGH);
delayMicroseconds(3309);
digitalWrite(pin4,LOW);
digitalWrite(pin5,HIGH);
delayMicroseconds(3309);
digitalWrite(pin5,LOW);
digitalWrite(pin6,HIGH);
delayMicroseconds(3309);
digitalWrite(pin6,LOW);
digitalWrite(pin7,HIGH);
delayMicroseconds(3309);
}
}
[MODNOTE]Please use code tags when pasting code... The "#" symbol.[/MODNOTE]
Last edited by a moderator: