CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Phase Detection

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
shocks



Joined: 10 Aug 2006
Posts: 5

View user's profile Send private message

Phase Detection
PostPosted: Tue Aug 15, 2006 5:40 pm     Reply with quote

Hi Guys
Im stuck on a project .
I have a 3 phase square wave input, 0 to 5 volts . Each square wave is 50 hertz and the phase difference btween phases is 120 degrees.
It basically mimics a 3 phase utilty system set at 50hz. (but in a square wave format.

I need to be able to verify on 3 pic inputs that I have 3 phase voltages present. It sounds straight forward but the voltage goes to zero for 50% of the time on each input, giving a wrong indication.


I would appreciate any ideas.

Im using a 16F877a

Cheers Wink Wink Wink Wink Arrow Arrow
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

Re: Phase Detection
PostPosted: Tue Aug 15, 2006 6:35 pm     Reply with quote

shocks wrote:
I need to be able to verify on 3 pic inputs that I have 3 phase voltages present. It sounds straight forward but the voltage goes to zero for 50% of the time on each input, giving a wrong indication.

Do you mean that there are glitches in your digital inputs?

At the risk of being obvious, here's how I would approach your problem:
Set up a timer to get an interrupt at, say f_sample=1.2kHz rate (the rate depends on how accurately you want to measure the phase). Sample your square waves in the timer ISR. The full cycle of your 50Hz square wave should contain 24 samples. If the phases of your square waves are offset by 120deg from each-other, this means that they are offset by 8 samples. So, just count the samples between the transitions of your square waves.
Storic



Joined: 03 Dec 2005
Posts: 182
Location: Australia SA

View user's profile Send private message Send e-mail

PostPosted: Wed Aug 16, 2006 7:37 am     Reply with quote

It is just a thought, I had produced a dimmer circuit where I applied a full wave rectification on 240V phase to nutral, a couple of limiting resistors to drive a 5V opto that at zero crossing I got a 50 hz pulse. I was measuring a 5V pulse.

How about having all 3 Phase pulses the same instead of a square wave, I expect you are using some sort of 1/2 wave circuit that give you a 50 hz square wave.

Andrew
_________________
What has been learnt if you make the same mistake? Wink
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Wed Aug 16, 2006 8:36 am     Reply with quote

Could a schmitt trigger set with an output pulse longer then the "off" time on all three inputs. or feed them into NAND/AND
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Wed Aug 16, 2006 10:47 am     Reply with quote

Quote:

I need to be able to verify on 3 pic inputs that I have 3 phase voltages present. It sounds straight forward but the voltage goes to zero for 50% of the time on each input, giving a wrong indication.



The only way to find differences of phase between square waves is detecting the
edges but not the levels. Instead when the signal is a sine wave, the implementation
of a zero crossing detector is a must to get a reference.

Humberto
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Aug 16, 2006 11:50 am     Reply with quote

How about:
1) Look for a verified (debounced) rising edge of phase 1 and verify that phase 2 is low and phase 3 is high.
2) Wait for a verified rising edge of phase 2 and verify that 3 is low and 1 is still high.
3) Wait for 3 to rise and verify that 1 is low and 2 is high.
4) Check that the whole process took about the right amount of time (2/3 cycle + debounce time).

This will check that all three phases are there, in the right order, and the right frequency. What more do you need to know?
_________________
The search for better is endless. Instead simply find very good and get the job done.
shocks



Joined: 10 Aug 2006
Posts: 5

View user's profile Send private message

Phase detection
PostPosted: Wed Aug 16, 2006 5:16 pm     Reply with quote

Guys
You have all been a great help.
The ideas are first class.
I have established the actual testing for phase rotation, by waiting for a debouced rising edge on 2 phases at a time, and performing this operation twice on a good result to verify correct rotation.
In reality this may be OTT but in if this works out it will be implemented in a Medium voltage format at 10kv and 20kv. At these voltages the actual test points are electrostatically coupled to the phases. I therefore have no source of current , huge impedance and a possibility of a 'Ghost Phase'.This is the reason for not using the ZERO crossing method. The 10 KV system also uses an earth fault protection system tying the faulted phase directly to earth at the station and increacing the other 2 phase voltage accordingly by adjustment of the star point.
All of these facts requires a need for absolute certainty of the presence of 3 phases before giving an indication of phase rotation, as im sure you know a grounded phase can be highly misleading.

I will post progress and any other glitches.

Much Thanks
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group