+ Post New Thread
Results 1 to 12 of 12
  1. #1
    Full Member level 6
    Points: 4,138, Level: 15

    Join Date
    Oct 2006
    Posts
    395
    Helped
    2 / 2
    Points
    4,138
    Level
    15

    AC power meter dsign with power factor information

    hi

    I want to design a energy meter using 8 bit Pic micro-controller.

    I want to know the following

    1)How voltage is measured.
    2)How current is measured.
    3)How Power factor can be measured.

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 80,310, Level: 69
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,295
    Helped
    3695 / 3695
    Points
    80,310
    Level
    69

    Re: AC power meter dsign with power factor information

    Hi,

    There are dedicated "energy meter chips". Do you want to use one of them?
    --> if yes, then read their datasheet and application notes.

    If you want to use the PIC inside ADC:
    * there are a lot of examples and hobby solutions in the internet. Read through them.

    * in general you need a fixed and stable sample rate to read both voltage and current continously.
    * then take the samples of one (or integer multiples) full wave (line frequency)
    * calculate the RMS voltage
    * calculate the RMS current
    * multiply both to get apparent power
    * Calculate active power
    * calculate: active_power / apparent_power = power_factor

    There are other(less reliable) solutions by just using zero cross timings

    Klaus


    2 members found this post helpful.

  3. #3
    Full Member level 6
    Points: 4,138, Level: 15

    Join Date
    Oct 2006
    Posts
    395
    Helped
    2 / 2
    Points
    4,138
    Level
    15

    Re: AC power meter dsign with power factor information

    Thanks for reply.

    kindly explain this

    "then take the samples of one (or integer multiples) full wave (line frequency)"
    What should be the adc sampling frequency?
    What about negative cycle (rectifier required?) or generate rms by using diode opamp circuit?



    •   AltAdvertisement

        
       

  4. #4
    Super Moderator
    Points: 80,310, Level: 69
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,295
    Helped
    3695 / 3695
    Points
    80,310
    Level
    69

    Re: AC power meter dsign with power factor information

    Hi,

    "then take the samples of one (or integer multiples) full wave (line frequency)"
    With 50Hz line frequency one full wave is 20 ms. --> Take samples of 20.0ms, 40.0ms, 60.0ms, 80.0ms... (donīt choose 43 ms for example)

    What should be the adc sampling frequency?
    Nyquist says you need more than twice the input frequency. Including the statment above it means you need at least 3 times the line frequency, as long as you donīt expect overtones.
    You can choose 3, 4, 5, 6, 7, .. time the line frequency)

    I recommend to use a sample frequency of (about) 32 x lines frequency. Use an appropriate analog low pass filter to avoide alias frequencies.
    With 50Hz line frequency it means 1600 Hz sampling frequency (for each channel) .

    What about negative cycle (rectifier required?) or generate rms by using diode opamp circuit?
    For sure you need the information of the negative cycle. So your analog input signal needs an offset of 1/2 ADC input range (ideally)
    If you are not interested in DC, then no OPAMP is needed. some Rs and Cs do the job.

    Klaus


    1 members found this post helpful.

  5. #5
    Full Member level 6
    Points: 4,138, Level: 15

    Join Date
    Oct 2006
    Posts
    395
    Helped
    2 / 2
    Points
    4,138
    Level
    15

    Re: AC power meter dsign with power factor information

    Why alias filter is required? Are there high frequency harmonics in Main?
    I need reference design for filter + ads side.



    •   AltAdvertisement

        
       

  6. #6
    Super Moderator
    Points: 80,310, Level: 69
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,295
    Helped
    3695 / 3695
    Points
    80,310
    Level
    69

    Re: AC power meter dsign with power factor information

    Hi,

    Why alias filter is required? Are there high frequency harmonics in Main?
    There are harmonics in the mains voltage. But ther are way more harmonics in the current.
    Consider all the small power supplies without PFC.
    The input current waveform is far away from sine.

    I need reference design for filter + ads side.
    You should read some "energy metering IC" datasheet, just to see how they do this. You donīt need to do the same, but itīs good information.

    A simple LPF is just an R and a C.

    Klaus


    1 members found this post helpful.

  7. #7
    Full Member level 6
    Points: 4,138, Level: 15

    Join Date
    Oct 2006
    Posts
    395
    Helped
    2 / 2
    Points
    4,138
    Level
    15

    Re: AC power meter dsign with power factor information

    Ok.

    Sampling the mains at 1600 Hz and then apply RMS formula to get the value?

    Are you talking about ADE7751 type chips?



  8. #8
    Super Moderator
    Points: 30,002, Level: 42
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    8,949
    Helped
    1134 / 1134
    Points
    30,002
    Level
    42
    Blog Entries
    9

    Re: AC power meter dsign with power factor information

    Quote Originally Posted by KlausST View Post
    With 50Hz line frequency one full wave is 20 ms. --> Take samples of 20.0ms, 40.0ms, 60.0ms, 80.0ms
    Hi Klauss,


    There are some regulatory specifications for measuring mains voltage that define the sampling frequency as being not exactly the multiple of the wave period. The reason for that is due to the risk of happening synchronized noises occurring between samples, and therefore would be not detected, don’t you agree ?

    An example of that was illustrated here:
    https://www.edaboard.com/thread207641.html#post885041

    Doing that, at least part of the artifact could be accounted by integrating the average over time.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



  9. #9
    Super Moderator
    Points: 80,310, Level: 69
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,295
    Helped
    3695 / 3695
    Points
    80,310
    Level
    69

    Re: AC power meter dsign with power factor information

    Hi Andre,

    yes, sampling a 20ms fullwave with a sample rate of 19ms is undersamling.

    While it has itīs benefits, it also has itīs drawback.

    I didnīt mention it because it makes things (sampling theory) more complicated.
    I did this with an 8 channels (lines frequency) true RMS voltmeter.
    Continous sampling (If I remember right then it was 48 samples in 100ms, this makes it usefull for 50Hz as well as 60Hz)
    a total sample rate (480Hz x 8 channels = 3840Samples/s) and an output every 100ms for all 8 channels, all within a ATMEGA32.
    Very precise and stable readings.

    Klaus



  10. #10
    Advanced Member level 5
    Points: 18,428, Level: 32
    Achievements:
    7 years registered

    Join Date
    Nov 2012
    Posts
    3,267
    Helped
    815 / 815
    Points
    18,428
    Level
    32

    Re: AC power meter dsign with power factor information

    How accurate you are going to aim? There are short time frequency and phase errors on the line frequency. Also you need a switch to select the mains frequency, 50/60 Hz. You should also ensure that the PIC clock is TXCO giving a good stability. If you just want an (approximate) idea of the power consumed, then you can assume the line voltage is a sine wave and the load current is also a sine wave. Then you will get the power consumed at the fundamental frequency. Measuring phase accurately with a 8 bit accuracy is not easy because of the conversions involved (sine and cosine functions). If you want to include harmonics in the overall calculation, you will need to average over 2-3-4-5 cycles and also sample over 1/2, 1/3, 1/4, 1/5 the line period (20 ms for 50Hz). As KlausST has pointed out, you also need to take care of the Nyquist theorem.

    It will be a fun project to do.


    1 members found this post helpful.

  11. #11
    Member level 3
    Points: 731, Level: 5

    Join Date
    Aug 2015
    Location
    Nieuwpoort, Belgium
    Posts
    67
    Helped
    6 / 6
    Points
    731
    Level
    5

    Re: AC power meter dsign with power factor information

    Perhaps this DIY project can be of some help: https://www.edaboard.com/thread343354.html
    Kind Regards,
    DanyR



    •   AltAdvertisement

        
       

  12. #12
    Full Member level 6
    Points: 4,138, Level: 15

    Join Date
    Oct 2006
    Posts
    395
    Helped
    2 / 2
    Points
    4,138
    Level
    15

    Re: AC power meter dsign with power factor information

    hi,

    I have just implemented this circuit for current sensing. For this circuit i am using MCP6022 rail to rail op amp with large rc constant out put filter as described in the document.

    Current transformer rating is 1:1000 load and resistor is 130 ohm.Here are some readings

    (Load) (Clamp meter current readings ) (Voltage at op-amp output)
    (Watts) (A)


    200 0.72 220mv
    400 1.57 400mv
    600 2.38 580mv
    800 3.23 760mv
    1000 4.07 940mv
    1200 4.89 1.14v

    Now i am looking for voltage sensing circuit. Do i need zero cross detect circuit?

    - - - Updated - - -

    In a current transformer with bridge rectifier , how voltage drop 0f 1.4 v is compensated?


    1 members found this post helpful.

--[[ ]]--