Go Down

Topic: Set Firing Angle TRIAC using optocoupler with PWM (Read 12422 times) previous topic - next topic

Ninonic

Power factor correction is only necessary for the following
1) The power company charge you more a poor power factor supply. This is because it does not show up on their meters.
I know, but it just prototype,
I just wanna make it, Lets say I am people from power company, I want make all system efficient.
thats all

"power That I need depend on PF"

I mean power compensation (VAR) from capacitors.


For power factor correction the capacitor has to be across the load. There is never any load in your schematics therefore you can not correct power factor.
I know, but in this case, I just wanna know how much voltage I can control with variation of firing TRIAC.
how much power (VAR) I generated, how much power I safe, I using another simulator to do that. its Multism.
but that for project analytic.

Ninonic

So connect that way and generate a 10 second high pulse, then a 10 second low pulse, then keep repeating that pattern, and make sure the triac follows that signal.  It should be off for 10 seconds and on for 10 seconds, and keep repeating that pattern.  You DO NOT have to sync anything for this test.

If you cant get that to work then you have something connected wrong or the triac is bad.  There is no sense trying to get everything to work at once if you are having this much of a problem.  Take it one step at a time.

As you say, I did 10ms HIGH 10ms LOW
there no different



bad TRIAC or bad circuit, I don't have any clues
I just can't accept this because in video just like the same.

I have no idea
What should I do?

MrAl

Hi again,


Well no, i said "10 seconds" high and "10 seconds" low, not 10ms and 10ms.

The idea is to make sure your circuit can actually turn the triac on and off no matter what the time period or pulse width is.  You have to get that to work first or else you can not expect it to work with shorter pulses.

What you have to do is try the 10 seconds and 10 seconds test, and keep that repeating.  The triac much respond with 10 seconds of sine waves followed by 10 seconds of complete silence.

If that doesnt work, then check your pulse to make sure it gets to the gate properly.
You might also have to look up how to test a triac with a meter and small power supply just to make sure it works.  If the triac is bad this will never work.
If you have a second triac, test that one too.

So step 1 is to try the 10 seconds on/off test.
Step 2 is to test the triac.

Step 3 would be to make sure the triac is connected to the microcontoller properly.  MT1 may go to ground with some triacs, but will have to go to +5v for other types of triacs.  You should see the 10 second on/off test work in one of these two modes.

You also have to check the current into the gate.  Make sure it meets the specs of the triac.  Also, post the triac part number so we can look at the data sheet.


Ninonic

I tried 10s ON 10s OFF pulse,
it works

the when I test the TRIAC, nothing change
there is no OFF cycle.

next, I tried to connect ground with MT1,
voltage drop till  mV with same fail wave

I using MOC 3041 optocoupler,
here the datasheet..

hmmm
look like I going to another circuit...

Grumpy_Mike

That opto isolater contains it's own zero crossing detector. Therefore if you pulse the LED for a time which is not coincident with a zero crossing then the triac will not fire. Are you sure your simulator is coping with that type of opto?

MrAl

I tried 10s ON 10s OFF pulse,
it works

the when I test the TRIAC, nothing change
there is no OFF cycle.

next, I tried to connect ground with MT1,
voltage drop till  mV with same fail wave

I using MOC 3041 optocoupler,
here the datasheet..

hmmm
look like I going to another circuit...
Hi,

You should really test the triac then, alone, using a power supply and a few resistors,  See if you can turn the triac on and keep it on, then when you disconnect and reconnect there should be no conduction from MT1 to MT2.  That will at least tell us that the triac actually works as it should.

Ninonic

That opto isolater contains it's own zero crossing detector. Therefore if you pulse the LED for a time which is not coincident with a zero crossing then the triac will not fire. Are you sure your simulator is coping with that type of opto?
I just realize that, since only that opto available in shop at the moment.
I should replace it. Thanks

Hi,

You should really test the triac then, alone, using a power supply and a few resistors,  See if you can turn the triac on and keep it on, then when you disconnect and reconnect there should be no conduction from MT1 to MT2.  That will at least tell us that the triac actually works as it should.
Look like so
I hope it run smoothly

Ninonic

Hello I am back,
I tried to TRIAC test



the result so good
Thanks for everyone help :D



actually, next I try to manage TRIAC trigger pulse,


I used this code for making TRIAC trigger pulse

Code: [Select]

const int ledPin =  13;      // the number of the LED pin

void setup()
{
 pinMode(ledPin, OUTPUT);     

}

void loop()
{
digitalWrite ( ledPin, ( (millis() % 9) == 0 ) ) ;
}


That just code for single pin,

I need to 3 output trigger pulse with 4ms different each other...
to make it work in 3 phase control.
lets say...

A = 0 ms
B = 4 ms
C = 8 ms

How to make that code? without delay

Best Regard,


Ninonic

Grumpy_Mike

Quote
I used this code for making TRIAC trigger pulse
What is this line supposed to do?

Code: [Select]
digitalWrite ( ledPin, ( (millis() % 9) == 0 ) ) ;

Basically it is weird. Form what I can see it will be low for 8mS and high for 1mS. This is not the way to generate a pulse.

Ninonic


Grumpy_Mike

Is it because "ledPin" ?
No.
It is the bit where you link the logic output to the System timer. This requires you to continuously call the digitalWrite function at least every mS.
There is no way you can synchronised this to the zero crossing which is what you need to do.
You have been continuously told this and yet you keep ignoring this. Until you get your head round this fact you are wasting everyone's time.

Ninonic

What a sad truth
I was not ignoring that, I just don't understand
Sorry for wasting your time,
Sorry

I dunno what to do....
God
Help me

Ninonic

Ok, maybe this my final question

Sir

What if I use 2 arduino,

1 for reading input and decision maker

Another just for digitalWrite output?

Grumpy_Mike

Quote
What if I use 2 arduino,
Then you make the problem 10 times harder to write.

Quote
I was not ignoring that, I just don't understand
By not saying that you don't understand you are ignoring me.
The way this forum works is that if you don't understand something you ask.

You need to be able to detect when the zero crossing of the AC waveform you want to control has occurred, and hang all your timing off that.

The simplest way is to get a logic level square wave generated from the AC signal, through an optical isolator.
Then the code needs to enter a loop that waits until the signal changes. This is simple, suppose the signal is coming in on pin 4 then the code:-
Code: [Select]

while( digitalRead(4) != lastRead) { } // this only exits when pin 4 changes state
lastRead = digitalRead(4);
// now do the delay and then fire the triac

where "lastRead" is a global or static int


Ninonic

You need to be able to detect when the zero crossing of the AC waveform you want to control has occurred, and hang all your timing off that.

Look like we got misunderstanding here.
Ok
I did zero crossing, but just single zerocrossing(I prefer one, because using 3 zcross it change whole my circuit board).
Since I have 3 TRIAC to trigger(3 phase)

so I hang with 1 zerocross input, but need to write 3 output

*NOTE : 3 phase balanced with same load and measured phase before

lets say... for time delay like this

phase A to B 4ms, phase B to C 4ms
A = 0 ms
B = 4 ms
C = 8 ms

code I using :
Code: [Select]

int lastread = LOW;
unsigned long phaseA;
//unsigned long phaseB;
//unsigned long phaseC;
unsigned const interval = 1;

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(4,INPUT);
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(11, OUTPUT);
  while(digitalRead(4) != lastread)
  {
      digitalWrite(13,(millis()%9)
      millis()=phaseA;
      if(phaseA-interval>=4UL)
      {
      digitalWrite(12,(millis()%9)
            if(phaseA-interval>=8UL)
            digitalWrite(11,(millis()%9)
      }
  }
  lastRead = digitalRead(4)
}
// the loop function runs over and over again forever
void loop()
{
     
}


Is that code you mean?
I am not sure with timing code one

Go Up