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 Angle using PIC

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



Joined: 31 Mar 2010
Posts: 1

View user's profile Send private message

Phase Angle using PIC
PostPosted: Wed Mar 31, 2010 3:05 am     Reply with quote

I want to know procedure how to calculate Phase angle of Input AC signal using PIC 18fXXXX.
_________________
sarada
MiniMe



Joined: 17 Nov 2009
Posts: 50

View user's profile Send private message

PostPosted: Wed Mar 31, 2010 5:36 am     Reply with quote

I suggest you to use 3 ext interrupts and timer0. (do not forget to use pullup resistor on ext interrupt pin)

if you are looking into precise measurements i suggest to use timer overflow interrupt count + timer flow value.


How to calculate is up to you... You need to get into few not so complicated equations.

Good luck ! hope to hear something back about your progress.
Ttelmah



Joined: 11 Mar 2010
Posts: 19480

View user's profile Send private message

PostPosted: Wed Mar 31, 2010 7:15 am     Reply with quote

For normal measurment like this, you need two zero crossing detectors. measure time between them triggering. If you know the frequency, then the period, is the reciprocal of this, and the angle is simply:
((time between the two zero triggers)*360)/period (for angle in degrees).
If you don't know the frequency, then you can measure the period between successive triggers of the reference zero crossing detector instead.

Best Wishes
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