ADC problem with rectified sine wave

Thread Starter

shoka

Joined Mar 12, 2009
39
hello,
i have a problem with ADC oh PIC18f452.
i try to measure 3 phase voltage and current ,frequency and power factor.
my code depend on the detecting of the peak of the sine wave.
when i detect the peak of voltage of phase 1 i start a timer and when i detect the peak of phase 2 i stop it .
this value gives indication to frequency.
i have a problem the the timer gives sometimes logic numbers and other times false numbers.
i think it's noise
how can i solve it .
 

bertus

Joined Apr 5, 2008
20,528
Hello,

You can also look at the zero crossings in stead of the tops.
For zer crossing there have been some discussions already (use searh on this forum).

Greetings,
Bertus
 

hgmjr

Joined Jan 28, 2005
9,029
What is the ratio of the sampling frequency relative to the frequency of signal being sampled? One explanation might be that you are undersampling.

hgmjr
 

bertus

Joined Apr 5, 2008
20,528
Hello,

If you use a zerocrossing detector and you know the frequency
than you can calculate the delay to find the top of the signal.

Greetings,
Bertus
 

Thread Starter

shoka

Joined Mar 12, 2009
39
i must measure the peak and the frequency.
frequency may be changed so it must be measured and also the peak.
 
Top