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
help with AC phase control
-
- Flowcode V4 User
- Posts: 26
- Joined: Sat Nov 01, 2008 12:11 am
- Has thanked: 7 times
- Been thanked: 10 times
- Contact:
help with AC phase control
- Attachments
-
- ACWave.png
- (65.89 KiB) Downloaded 7000 times
Last edited by jose on Sun Jul 03, 2016 4:08 pm, edited 2 times in total.
-
- Flowcode V4 User
- Posts: 26
- Joined: Sat Nov 01, 2008 12:11 am
- Has thanked: 7 times
- Been thanked: 10 times
- Contact:
Re: help RBO INT plus TMR0...
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
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
- Attachments
-
- 4.txt
- (2.4 KiB) Downloaded 507 times
-
- Flowcode V4 User
- Posts: 26
- Joined: Sat Nov 01, 2008 12:11 am
- Has thanked: 7 times
- Been thanked: 10 times
- Contact:
Re: help with AC phase control
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
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
- Attachments
-
- ac_phase_control.fcf
- (11.47 KiB) Downloaded 543 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: help with AC phase control
Hi jose,
Do you want to see if attached flowchart works any better?
Martin.
Do you want to see if attached flowchart works any better?
Martin.
- Attachments
-
- ac_phase_control2.fcf
- (12.29 KiB) Downloaded 534 times
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: help with AC phase control
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.
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.
- Attachments
-
- ac_phase_control2a.fcf
- (12.29 KiB) Downloaded 551 times
Martin
-
- Flowcode V4 User
- Posts: 26
- Joined: Sat Nov 01, 2008 12:11 am
- Has thanked: 7 times
- Been thanked: 10 times
- Contact:
Re: help with AC phase control
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...
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...
-
- Flowcode V4 User
- Posts: 26
- Joined: Sat Nov 01, 2008 12:11 am
- Has thanked: 7 times
- Been thanked: 10 times
- Contact:
Re: help with AC phase control
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
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
- Attachments
-
- tlp620.jpg (11.82 KiB) Viewed 10670 times
-
- Flowcode V4 User
- Posts: 26
- Joined: Sat Nov 01, 2008 12:11 am
- Has thanked: 7 times
- Been thanked: 10 times
- Contact:
Re: help with AC phase control
now the screen shots...
ch1 yellow - zerocrossing at RB0
ch2 blue - pulse out
ch1 yellow - zerocrossing at RB0
ch2 blue - pulse out
- Attachments
-
- DS0003.jpg (25.95 KiB) Viewed 10668 times
-
- DS0002.jpg (25.76 KiB) Viewed 10668 times
-
- DS0001.jpg (22.83 KiB) Viewed 10668 times
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: help with AC phase control
Hi Jose
Sorry for the delay here is scanned pages as promised
PLEASE READ THE DISCLAIMER ON THE FIRST PAGE
Regards
Steve
Sorry for the delay here is scanned pages as promised
PLEASE READ THE DISCLAIMER ON THE FIRST PAGE
Regards
Steve
- Attachments
-
- scaned pages.pdf
- (440.88 KiB) Downloaded 479 times
Success always occurs in private and failure in full view.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: help with AC phase control
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)jose wrote:Phase = x * 7 / 10 + 74 i have an idea but can you please explain?
Thanks
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
Martin