Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

When to pulse the Gate?

Status
Not open for further replies.

Suraj143

Active Member
I’m detecting zero cross in a 50Hz AC wave.When it detects it will go to the ISR through interrupt pin.

I want to know after how many milliseconds it goes to ISR after detecting the next zero cross? does it 10ms?

After turning on the triac does it off automatically?
 
Last edited:
Suraj143 said:
I’m detecting zero cross in a 50Hz AC wave.When it detects it will go to the ISR through interrupt pin.

I want to know after how many milliseconds it goes to ISR after detecting the next zero cross? does it 10ms?

After turning on the triac does it off automatically?

Once a triac is turned on it will not turn off until the current through it falls to zero by external means (a triac can't be shut off by controlling it's gate). If you want it to stay on you could just apply a continuous high to the gate. You don't actually need to pulse it only at the instant you want to turn it on. Nothing bad happens if you just apply a high signal as long as you want the triac to stay on (it will only turn off after you remove the gate signal when it crosses zero though).
 
Hi dknguyen Thanks for your comments.

You have understand my situation.I'm trying to control the power of the TRIAC by adjusting the hold time after detecting the zero cross.

Does the maximum hold time is 10ms?When i increase the hold time closer to 10ms & turning on the triac the output will very dim.Am I right?

So when it comes to the next zero cross it will go to the ISR but still the triac turning on bit is set I'm confused with this.

any comments
 
Suraj143 said:
Does the maximum hold time is 10ms?

For an exact 50Hz, the half cycle time is exactly 10ms. The mains frequency will varies a bit from 50.5Hz to 49.5Hz in some cases. Therefore your max hold time will be the half cycle time from 9.9ms ~ 10.1ms, depending on the AC frequency. You'll need to make some allowance.

Suraj143 said:
When i increase the hold time closer to 10ms & turning on the triac the output will very dim.Am I right?

Yes. You are turning ON the triac near 180 degree so the power it lets through is minimal.

Suraj143 said:
So when it comes to the next zero cross it will go to the ISR but still the triac turning on bit is set I'm confused with this.

Most zero point crossing detecting circuits will trigger when the AC main is a few degrees before actually reaching zero crossing and thus will fire the ISR a little early. This is good.

I would suggest once you are inside the ISR, you immediately check on the power requirement and remove the triac gate drive unless the power requirement demands it to remain fully ON in the next half cycle.

Then how you will ensure the triac drive fires at the desired moment between 0 ~ 10ms for power control will depend on actually programming. You can either use a timer interrupt or set up some count variables to do that.
 
Hi elbc thanks for your superb answers.Here is a sample in my program does it looks good?

Code:
ISR
	---			;saving context
	---
	bcf	TRIAC,0		;turn off the triac
	call	Del_5ms		;delay 5ms (dim half)
	bsf	TRIAC,0		;turn on the triac
	---
	---			;restoring context
	bcf	INTCON,INTF	
	retfie
 
Yes, it will work. Except that you should remind yourself instead of "turn off the triac", it should actually be "removes triac gate drive" in the code comments.

However, spending (aka wasting) 5ms inside an ISR, with the interrupt requests coming at 10ms rate is definitely not a good programming practice.
 
eblc1388 said:
Yes, it will work. Except that you should remind yourself instead of "turn off the triac", it should actually be "removes triac gate drive" in the code comments.
I'll make a note on that.

However, spending (aka wasting) 5ms inside an ISR, with the interrupt requests coming at 10ms rate is definitely not a good programming practice.

I'll use TMR0 for this so before overflowing most of the time the code hangs around in the main routine.In the main routine nothing is there.

eblc1388 do u know a link that shows how to connect an AC signal to a 5V input pin (to detect zero cross)

Thanks for your guidance
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top