Go Down

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

raschemmel

analogWrite accepts values from 0 to 255. ( not 1024)

Ninonic

Not the best sentence ever produced in English.
Pardon me Sir, for Bad English

You are wasting your time doing anything without synchronising the whole thing with the zero crossing.

Do not try and look at mains voltage on an oscilloscope unless you know what you are doing otherwise the whole thing will explode as it will short out the mains.

I see your point. Zero cross is used to set the time when arduino generate pulse in the right time, isn't it ?

Update the schematic to one that shows what you actually have, no more no less.
I would if I could, Sir
but my design not quite ready,

I try to build power factor correction, Sir
so...
to ask whole system are so complex, maybe some people easy to explain their knowledge about that.
but in the end, even for myself is too much to understand for single Topic
so I try to learn step by step.
I hope you still help me because next are many question to answer.


so we can start it from
1st topic : controling triac with delay variation

 this a little bit silly, I try to make delay (variable), but that can't work. It so basic, but too lack of knowledge, I know that. (thats why I come here, but I hope people will nice to me even I lack of knowledege, just hoping)

2nd topic : phase detector using bitwise XOR

This time, I try to read phi angle (sometimes a.k.a alfa) to define power factor value and display on LCD.
I had problem with electronic stuff here,
actually, I have zero crossing circuit here. one for voltage sensor and current for another.
(I think I can get zero crossing from voltage sensor in this circuit, then set delay for TRIAC trigger)

but, still no have clear solution. somepeople say, it hard to make it happen, because arduino (uno) response time too slow.. (read&write)

3rd topic : problem generate pulse
I try to generate TRIAC pulse here. (problem solved)

4th topic : is here
this time I want voltage control by TRIAC. but the output wave is too weird.

Thats All Sir

sorry for being bad student, please help me.....

MrAl

Hello again,

You might start with the simplest of all tests, which is to make sure your circuit can turn the triac fully on and fully off by using a very long pulse of say 10 seconds on, then 10 seconds off.  If that does not work, then nothing will work so you will have to troubleshoot and fix that first.  Once this works you can move on to the more involved timing tests.  An issue that may come up is that you need to use the right gate polarity depending on the actual triac being used.

The procedure to test more thoroughly is very simple also.  Start by detecting the zero crossing.  Then start your delay timer.  At the end of the timer period, generate a pulse to the gate of the triac.

The simplest way to start is to first detect the zero cross, then wait 5ms, then generate a pulse of 1ms width to the gate.
If you do this you should see a 1/4 wave of the sine wave which will go from 90 degrees to 180 degrees, then another 1/4 wave from 270 degrees to 360 degrees which is the full cycle.  You'll see that for every cycle if you did it right.

Once you get that working you can go on to try to vary the delay to values other than 5ms but dont go over 8.9ms to keep it working correctly.

If your circuit is connected properly you should see this result no problem.
You can look at the pulse too as you have been doing to make sure it turns on at 90 degrees and 270 degrees.

This is a procedure which if successful will tell you that you are probably doing everything right.  If not successful you'll most likely never get it to work with other delays, so troubleshoot the basic circuit first then.

Also note that you need at least some resistive load or else it may appear that the triac does not turn off correctly.

I'd like to see how well you make out with this, so please let me know how it goes.

Grumpy_Mike

Quote
I see your point. Zero cross is used to set the time when arduino generate pulse in the right time, isn't it ?
Yes it is.
Quote
some people say, it hard to make it happen, because arduino (uno) response time too slow.. (read&write)
That is very silly the Arduino is running at 16MHz and half a mains cycle is 100Hz, so in half a mains cycle you can have 160,000 processor instructions. That is plenty fast enough and then some.

To synchronize the program code to the zero crossing, you have to have a loop that waits until the zero crossing occurs. Use a while loop for this. What signal do you get on a zero crossing?

Then once you are at the moment in time when a zero crossing has occurred, you delay by a value that is inversely proportional to the percentage power you want, then generate the triac firing pulse. Then repeat the whole thing over and over.
That small code fragment was fine for the bit after the synchronizing while loop, if you miss out the last delay.

Quote
I have zero crossing circuit here. one for voltage sensor and current for another.
If the current and voltage are out of phase then the triac might never turn off. That is why you have power correction to bring them into ( or close to ) in phase with each other. But don't start with an inductive load. Get your circuit to use first of all a resistive load like an incandescent light bulb.

Quote
4th topic : is here
this time I want voltage control by TRIAC. but the output wave is too weird.
No the waveforms look like that because they are not synchronized together and there is no triac firing which would cause the input waveform to collapse once it is conducting. In other words the top waveform is not measured at the correct place.

Boardburner2

Not the best sentence ever produced in English.

Is english your first language ?
Do not try and look at mains voltage on an oscilloscope unless you know what you are doing otherwise the whole thing will explode as it will short out the mains.


And likely destroy your oscilloscope.
400 V on mine.


Can you provide a link to where you found this diagram ?

be80be

#20
Jul 25, 2016, 12:55 am Last Edit: Jul 25, 2016, 01:01 am by be80be
Back about 8 years ago I posted a video on youtube just for fun of PWM firing a triac it's a hit and miss kind of thing useless for and kind of control. I kind of lined up the pwm by hitting a button when the light flickered.
some times you got lucky and the pic stayed in sync with the light bulb. Most times you didn't

This video I made was to show that ac dimming using just a uc no zero crossing is a waste of time it doesn't work
http://www.youtube.com/watch?v=bVHHAKb8M60

Ninonic

analogWrite accepts values from 0 to 255. ( not 1024)
thanks for information, I control firing TRIAC with program

Hello again,

You might start with the simplest of all tests, which is to make sure your circuit can turn the triac fully on and fully off by using a very long pulse of say 10 seconds on, then 10 seconds off.  If that does not work, then nothing will work so you will have to troubleshoot and fix that first.  Once this works you can move on to the more involved timing tests.  An issue that may come up is that you need to use the right gate polarity depending on the actual triac being used.

Hii :D  yap, you're right

If your circuit is connected properly you should see this result no problem.
You can look at the pulse too as you have been doing to make sure it turns on at 90 degrees and 270 degrees.

This is a procedure which if successful will tell you that you are probably doing everything right.  If not successful you'll most likely never get it to work with other delays, so troubleshoot the basic circuit first then.

Also note that you need at least some resistive load or else it may appear that the triac does not turn off correctly.

I'd like to see how well you make out with this, so please let me know how it goes.
ya, I tried to copy some circuit that I get in youtube, international journal, I replicated it. but the result still different. If I not bother you, can I get your tested circuit? I will make it in my simulation using proteus, if that different software, its OK. I will remake in proteus

I will message you the project progress later.
thanks

That is very silly the Arduino is running at 16MHz and half a mains cycle is 100Hz, so in half a mains cycle you can have 160,000 processor instructions. That is plenty fast enough and then some.
in topic 2  
based my post #28.
in osciloscope, I try to convert half wave ADC (voltage and current input) to digital,
the green one is signal that define XOR between voltage and current by using bitwise XOR in my program,
the red one is same signal but using XOR component,
as we see that, the green frequency not same as input frequency,
that silly people said, we know that arduino hae 16Mhz its for couple pin like interrupt can do that, and unfortunatelly its only for digital. it can properly run in ADC pin.

and someone tell about post #48
can you explain about this?

To synchronize the program code to the zero crossing, you have to have a loop that waits until the zero crossing occurs. Use a while loop for this. What signal do you get on a zero crossing?


that must be yellow one, from voltage sensor, its from main trough step down transformator and comparator which is digital input.

If the current and voltage are out of phase then the triac might never turn off. That is why you have power correction to bring them into ( or close to ) in phase with each other. But don't start with an inductive load. Get your circuit to use first of all a resistive load like an incandescent light bulb.
Unfortunatelly, I used inductive load, since my purpose to correction bad power factor.
I used resistor and inductor component. since it just kinda prototype, so there I take sample.

No the waveforms look like that because they are not synchronized together and there is no triac firing which would cause the input waveform to collapse once it is conducting. In other words the top waveform is not measured at the correct place.

No idea for this one, I tried many reference. but dont work well for me, others do
I got design from here
application note

Is english your first language ?
And likely destroy your oscilloscope.
400 V on mine.

Can you provide a link to where you found this diagram ?
main voltage around 400 phase to phase, ya
its very dangerous
I decide to take double rubber glove next time.
Oscilosope using 10x magnitude, it can read that

there I got diagram http://www.littelfuse.com/~/media/electronics/application_notes/switching_thyristors/littelfuse_thyristor_phase_control_using_thyristors_application_note.pdf.pdf

Boardburner2

This thread is wandering all over the place.

Can we start again.

What do you want to control.
LOAD, inductive or resistive.

I assume AC mains is the power source.

What voltage and current does the load require.

What range of power control do you need.

PWM as a term is normally used with DC power sources here and is probably the wrong term to use but i suspect a language understanding problem.

Ninonic

Hahaha
Actually I got some answer from my title in this topic (thread)
But in my simulation software, It still not complete,

There something wrong with my triac to control voltage,
Beside that, dc and ac control need safety, thats why I describe the whole system, asking that OK or not.

The load inductive+resistive

Yap, AC are main source

Voltage depend on power factor, if power factor is too low, that mean we need more power in other word, more voltage

I hope I can control triac firing angle from 0 - 180 degree,  both postive and negative cycle.

raschemmel

#24
Jul 25, 2016, 07:45 am Last Edit: Jul 25, 2016, 07:46 am by raschemmel
Or you can add capacitance to correct the power factor.

MrAl

thanks for information, I control firing TRIAC with program

Hii :D  yap, you're right

ya, I tried to copy some circuit that I get in youtube, international journal, I replicated it. but the result still different. If I not bother you, can I get your tested circuit? I will make it in my simulation using proteus, if that different software, its OK. I will remake in proteus

I will message you the project progress later.
thanks

in topic 2 
based my post #28.
in osciloscope, I try to convert half wave ADC (voltage and current input) to digital,
the green one is signal that define XOR between voltage and current by using bitwise XOR in my program,
the red one is same signal but using XOR component,
as we see that, the green frequency not same as input frequency,
that silly people said, we know that arduino hae 16Mhz its for couple pin like interrupt can do that, and unfortunatelly its only for digital. it can properly run in ADC pin.

and someone tell about post #48
can you explain about this?


that must be yellow one, from voltage sensor, its from main trough step down transformator and comparator which is digital input.
Unfortunatelly, I used inductive load, since my purpose to correction bad power factor.
I used resistor and inductor component. since it just kinda prototype, so there I take sample.

No idea for this one, I tried many reference. but dont work well for me, others do
I got design from here
application note

main voltage around 400 phase to phase, ya
its very dangerous
I decide to take double rubber glove next time.
Oscilosope using 10x magnitude, it can read that

there I got diagram http://www.littelfuse.com/~/media/electronics/application_notes/switching_thyristors/littelfuse_thyristor_phase_control_using_thyristors_application_note.pdf.pdf
Hello,

I looked in that littlefuse link and they have a 470 ohm resistor from an i/o output to the gate, with MT1 grounded.  Depending on the type of triac you are using, you may have to connect MT1 to +5v and use a low (0v) output to turn on the triac.
If you use an opto isolator then so much the better.

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.




Grumpy_Mike

Quote
if power factor is too low, that mean we need more power in other word, more voltage
RUBBISH.


Ninonic

What range of power control do you need.

PWM as a term is normally used with DC power sources here and is probably the wrong term to use but i suspect a language understanding problem.
power That I need depend on PF.
TRIAC connected to capacitor to generate capacitive (VAR) to compensation inductive (VAR).
lets say 0 - 220 V and 4uF (Xc about say it 200).

based

Q = V^2 / Xc

Q = 220.220/(200)
Q = 242 VAR (max), voltage depend on PF quality

just for example

Sorry, for bad english.

Grumpy_Mike

Quote
power That I need depend on PF.
No it does not, why do you keep saying that?

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.
2) You need to control a triac or SCR where to turn it off you need the voltage to be below a minimum value and the current needs to be below a minimum value in order to turn it off. - This is the case you have.

Quote
Yap, AC are main source
Mains means the electricity supplied to homes.

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.

Go Up