Page 1 of 1
help with AC phase control
Posted: Thu Jun 30, 2016 11:48 pm
by jose
Hi to all,
I'm trying to program a thyristor controller using external interrupt on RB0 INT attached to photocoupler to detect AC zero-cross, and then, maybe use timers/pwm to create the pulse t2 and adjustable delay t1 until max t3 on the picture
Any help please...
Thanks
Re: help RBO INT plus TMR0...
Posted: Sun Jul 03, 2016 11:16 am
by jose
Hi
the following arduino example works fine and i will like to implement it in flowcode but i still can't get it to work because i don't know how to deal with the timer / comparator functions yet...
I'm sure this will be "kid's stuff" for some of you, i will be grateful for any tips to do this
thanks
Re: help with AC phase control
Posted: Sun Jul 10, 2016 11:40 am
by jose
Hi again,
This is the way i find to get it work.
Basically, after zero detection, we set the timer with a starting value for the delay angle...now is easy!
The flowchart is commented
Any suggestions / improvements are welcome
Regards
Re: help with AC phase control
Posted: Sun Jul 10, 2016 2:19 pm
by medelec35
Hi jose,
Do you want to see if attached flowchart works any better?
Martin.
Re: help with AC phase control
Posted: Sun Jul 10, 2016 2:47 pm
by medelec35
I'm only using two different simulators.
The other simulator this attached flowchart works best.
I would be better if you can attach a circuit diagram since results is going to be dependent on input AC waveform.
Re: help with AC phase control
Posted: Sun Jul 10, 2016 5:20 pm
by jose
Hi Martin, thank you!
The pulse is contained inside half cycle now, but sometimes randomly I see an extra pulse.
To discard any ADC problem I used a fixed number but get same results. I will continue testing...
Re: help with AC phase control
Posted: Sun Jul 10, 2016 5:58 pm
by jose
I just see and test your new file. It look stable
For zero detection I'm using a TLP620 like picture below, in my case with 2k2 resistor to 24Vac and the other side a 10k resistor connected to RB0 and 5V that gives a pulse about 600us. Also some oscilloscope screens shots
Phase = x * 7 / 10 + 74 i have an idea but can you please explain?
Thanks
Re: help with AC phase control
Posted: Sun Jul 10, 2016 6:03 pm
by jose
now the screen shots...
ch1 yellow - zerocrossing at RB0
ch2 blue - pulse out
Re: help with AC phase control
Posted: Tue Jul 26, 2016 1:04 pm
by Steve001
Hi Jose
Sorry for the delay here is scanned pages as promised
PLEASE READ THE DISCLAIMER ON THE FIRST PAGE
Regards
Steve
Re: help with AC phase control
Posted: Tue Jul 26, 2016 1:38 pm
by medelec35
jose wrote:Phase = x * 7 / 10 + 74 i have an idea but can you please explain?
Thanks
The reason for that is I had determined the range to load timer interrupt should be no higher than 252 or will be hogging resources and no less than 74 (from testing with a simulator) as you need a trigger a little after zero crossing)
That's what the formula does.
Converts ADC (0 - 255) to (74 - 252)
To find the ideal values, you could:
Temporarily disable formula and use Phase = x
Send the value of x to a LCD or via RS232 while adjusting pot and make a note of the ideal range.
Post the range then a new formula can be derived.
Alternatively if not got LCD or UART to RS232 converter then just measure the voltage as accurately as possible on the ACD pin of microcontroller of the min and max ideal setting.
Post that and I can derive a new formula for you.
Martin