AC RMS current measurement, converting to DC for Arduino

Discussion in 'Test & Measurement Forum' started by ebeowulf17, Jan 11, 2018.

  1. crutschow

    Expert

    Mar 14, 2008
    19,115
    5,341
    That will give you Fourier waveform harmonics up to 500Hz, which probably is sufficient for your requirements.
    You likely want to average the readings over several complete cycles to give a stable and more accurate value.
     
    ebeowulf17 likes this.
  2. Danko

    Member

    Nov 22, 2017
    461
    164
    Maybe you will like Closed loop Hall Effect Sensor for AC , DC , & Complex Currents.
    It gives you information about current in voltage mode.
    http://www.tamuracorp.com/uploads/currentsensor/ClosedlloopPDF.pdf
    EDIT: LA 55-P $24.86 SENSOR CURRENT HALL 50A AC/DC
    https://www.digikey.com.mx/product-detail/en/lem-usa-inc/LA-55-P/398-1010-ND/409823
     
    Last edited: Jan 13, 2018
  3. ebeowulf17

    Thread Starter Well-Known Member

    Aug 12, 2014
    2,112
    357
    Thanks for the idea, and the link. I think my main challenge is just deciding on the best conditioning circuitry and/or code choices. Regardless of transformer or sensor type, I've still got to eliminate negative voltages and get them scaled to suit my needs.
     
  4. Danko

    Member

    Nov 22, 2017
    461
    164
    EDIT: R3/R1=1+R7/R6
    Bridge.png
     
    Last edited: Jan 14, 2018
  5. ebeowulf17

    Thread Starter Well-Known Member

    Aug 12, 2014
    2,112
    357
    I found that one of the Arduino sketches that I might want to add current sensing to is already pretty heavily bogged down, only completing 30 cycles of the main loop per second (I think a lot of the speed issues are related to serial and LCD character display outputs, and plan to do some testing soon to get a better understanding of this.) This realization got me more interested in an analog answer, so I breadboarded my original idea.

    It seems to be working pretty well so far - I don't see any obvious distortions in the waveform from the bridge rectifier, the peak voltages come through the same, and the RC averaging filter seems to work reasonably well. The DC output of the filter read 558mV for a signal that appears to be a little over 900mV peak on the oscilloscope, so the average is just a little lower than I expected, but of course this isn't a perfect sine wave either.

    The pics below show the current transformer waveform for just using a burden resistor vs running through a bridge rectifier, then a burden resistor. The second shot also includes the output of the RC averaging filter.
    IMG_4208.JPG
    IMG_4209.JPG
     
  6. ebeowulf17

    Thread Starter Well-Known Member

    Aug 12, 2014
    2,112
    357
    This looks solid, but it would require a dual power supply, right? I'd like something that can run on a single 5V supply.
     
  7. RamaD

    Senior Member

    Dec 4, 2009
    300
    42
    I would prefer a power meter ic, around $1 in digikey, that can give you Vrms, Irms, real & reactive power and of course, the power factor, again true RMS. Calibration is one issue to be solved though apart from some code. ATM90E26, for example.
     
  8. ebeowulf17

    Thread Starter Well-Known Member

    Aug 12, 2014
    2,112
    357
    Wow, that's a pretty impressive chip!

    All of the projects I currently have in mind will be one-off, hand made jobs, and I'm no good with surface mount soldering, so no help at the moment. I'll definitely keep those in mind if I need power monitoring for any bigger projects in the future.

    Thanks!
     
  9. ebeowulf17

    Thread Starter Well-Known Member

    Aug 12, 2014
    2,112
    357
    So I've been playing around with my circuit quite a bit, with some interesting results. At the moment I'm not measuring anything more than around 15A, so I've been using different burden resistors, but otherwise it's the exact circuit from my first post. The burden resistors I've been using are 220 ohm for general experimentation or 2.2k for measuring lower amperages up to around 3A.

    Most of the things I've tried to measure have given results that made sense, but two of the smallest loads I've tried to measure seemed odd. One in particular is an LED light bulb (the kind that screws into a normal 120V lamp socket) that is marked on the side as drawing 100mA. When I switch it on, I see a momentary spike around 20mA, and then nothing. I've already determined that I have some ADC accuracy issues, but that only accounts for 10-15mA of missing signal. So I'd still expect to read at least 85mA, but I see nothing at all. These attempts were made with the 2k2 resistor, so if the lamp is actually drawing 100mA, that would correspond with a roughly 100mV signal after my RC circuit - and yes, I know that 100mA RMS will be different than what I see with my average-reading circuit, but surely it shouldn't disappear entirely!

    Any guesses as to why this light bulb would appear to be drawing no current? The only thing I can think of is that it's internal power supply is switching at such high frequency that the current transformer's limited frequency response filters it out. The CT is rated for up to 1kHz:
    http://www.crmagnetics.com/high-fre...rs/wire-lead/voltage-output/solid-core/cr8448

    What do you guys think? Is this a frequency response issue? Is there some other explanation? Do CTs have some sort of minimum sensing level below which they drop off? (If so, I've found no useful information in numerous search attempts.)
     
  10. Danko

    Member

    Nov 22, 2017
    461
    164
  11. Danko

    Member

    Nov 22, 2017
    461
    164
    "Before any test on a CT, first the CT should be demagnetized. ANSI C57.13.1 Standard
    lists several methods. All involves driving the CT into saturation one way or another and
    than slowly reducing the magnetizing force to zero."

    https://store.gedigitalenergy.com/FAQ/Documents/489/GET-8402.pdf
    "The polarization current is responsible for magnetic losses in the core.
    It is also responsible for errors of the current transformer.
    There are two types of errors for current transformers: amplitude and phase error.
    Amplitude error has an effect on secondary current amplitude value. Secondary
    current amplitude depends not only on the ratio of the transformer but also on the
    value of amplitude error.
    The phase error is responsible for phase shift between the primary and secondary
    current. If the phase shift value is not constant or approximately constant in considered
    current range, the error of current transformer is very high."

    http://www.kmnipe.pwr.edu.pl/files/prv/id35/wyd/pn/sim33/sim33-art42.pdf
     
  12. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,176
    1,411
    Just a guess here but looking back at your very first drawing for signal conditioning your CT signal while I can see the use of the bat54 Small Signal Schottky Diodes even using the schottkt diodes in a full wave bridge as you have the diodes will have a Vfwd drop X2 for the alternate half cycles of your AC waveform. Somewhere between 240 mV and 800 mV depending on Ifwd. From our friends at CR Magnetics who manufactured your CT:
    "
    ".

    They suggest Precision Rectifier Circuit for CT Signal Conditioning which is how I have generally seen CT signal conditioning done so as not to have issues with forward voltage drops on diodes. Your diodes will not begin to conduct until the output of your CT Burden Resistor exceeds the required voltage, so if the CT is providing current to your burden resistor nothing will happen until those diodes have their threshold voltage and start conducting. Any low end current is likely to do nothing. That would be my guess based on some of these designs.

    Something you can try is use a millivolt meter and measure the voltage drop across your Rburden with a low AC current passing through the CT primary. Then take note when the diodes begin forward conduction. You can also try several, rather than only one turn on your primary by looping your primary current carrying conductor through the doughnut several times.

    Ron
     
  13. ebeowulf17

    Thread Starter Well-Known Member

    Aug 12, 2014
    2,112
    357
    I *thought* I had gotten around the diode drop issue by putting the rectifier before the the burden resistor. My theory was that the transformer would maintain its current ratio and deliver whatever voltage required (as long as the transformer wasn't saturating) to achieve that current.

    It works quite well in simulation, and at first I thought it was working well in real life, but as I look more closely at my small signal readings, I see that I'm still having diode related issues. I did a little bit of experimenting last night, scoping waveforms and going back and forth between a standard burden resistor setup and my rectifier-before-the-burden setup. My setup works great until somewhere fairly low, like 100mV output, but gets wonky at some point. I did confirm that the transformer and burden resistor show me the "missing" LED current just fine, so the issue is definitely in my rectifier choices, not frequency response or anything else from the transformer.

    Thanks for the CR Magnetics link. It looks like that circuit would require a dual power supply, and I'm trying to see what I can do with a simple 5VDC system, but I think I can adapt the concept. I'll report back once I figure something out, whether it's news of success or reporting the lessons from my failure!
     
  14. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,176
    1,411
    I have seen a few applications where the diodes were placed right at the CT output. Something to consider with a CT is the open circuit voltage. Depending on the CT there can be some pretty high open circuit voltages. Typically a CT was specified as for example a 100:5 meaning with a 100 Amp primary the secondary output would be 5 Amps or a 20 to 1 ratio. Normally the burden resistance was below 1 Ohm. Open-Circuited CT Misoperation and Investigation is a good read on the subject. A simple Google of "Current Transformer open circuit voltage" will bring up a dozen hits on the subject. Anyway I always favored using a precision rectifier circuit type design to get around the diode issues. I am waiting for inexpensive (cheap) AC current transducers to start falling off the boat from China. Over the years we removed and replaced dozens of current transformers with the newer current transducers from suppliers like CR Magnetics, not cheap but some real nice stuff.

    I believe your problem is when the voltage off the CT drops enough the diodes simply stop conducting.

    Ron
     
    • CTc.jpg
      CTc.jpg
      File size:
      218.8 KB
      Views:
      7
  15. ebeowulf17

    Thread Starter Well-Known Member

    Aug 12, 2014
    2,112
    357
    So, I've already accepted that my rectifier design is flawed, but I'm still struggling to understand its behavior, and I really hate not understanding why something does or doesn't work!

    Here's the thing that's weird to me: the amount of signal that's lost isn't proportional to the signal magnitude, and it's not simply the Vf voltage drop. It's proportional to the burden resistor size. This implies to me that it's a consistent amount of lost current - the transformer secondary does its job and provides current in the appropriate amount, but then a fairly fixed amount of current is lost somewhere, with the remainder dropping across the burden resistor and being measured.

    Below are some scope shows showing an experiment from last night. I ran the same CT signal with two different burden resistors, both with and without my rectifier setup in the chain. Without the rectifier, the scope traces match the expected values quite nicely. With the rectifier, I don't see a predictable voltage drop like I'd expect from the Vf, but instead I see a little over 10mV error with a 220R resistor, and around 100mV error with a 2k2 resistor. Why is the error amount scaling with the burden resistor?!
    CT-rectifier-comparisons_lo-res.png

    I'm also including an image to show that the voltage of the CT really does rise abruptly to negate the voltage drop of the diodes and deliver (most of) the desired current in my original posted circuit configuration. The following image was the reading straight off of the CT legs within the bridge rectifier, as opposed to reading voltage across the burden resistor after rectification like in the other shots. This was from some earlier experiments with a roughly 100mA test signal (~50uA at secondary.) The voltage seen in the trace below is quite a bit more than what the burden resistor alone would create - it's the combination of the burden resistor and two diode drops adding up that give the high signal levels within the rectifier.
    IMG_4336.JPG

    Anyway, back to my main curiosity, if anyone can help me understand why I'd get an error that is fairly independent of signal level, but varies proportionally with burden resistance, I'd appreciate the help!
     
  16. crutschow

    Expert

    Mar 14, 2008
    19,115
    5,341
    I believe you are seeing the error due to the primary magnetizing current, which is proportional to the transformer voltage.
    A transimpedance amp configured as an ideal rectifier should minimize that error since it creates zero transformer output voltage.
    Then the only magnetizing current would be due to the voltage generated by the transformer secondary winding resistance.
     
    RamaD likes this.
  17. ebeowulf17

    Thread Starter Well-Known Member

    Aug 12, 2014
    2,112
    357
    Very interesting!

    So, in simple terms, basically it takes more magnetizing current to produce the output current plus the voltage of some diode forward voltages instead of just producing the output current and its associated burden resistor voltage? And, since the primary current is essentially fixed, by adding the diodes to the situation I lose a certain amount of secondary current?

    Or maybe another way to think of it is that, for any given burden resistance, it takes a certain amount of magnetizing current just to overcome the forward voltages of the diodes, and beyond that point there's a relatively linear relationship between primary and secondary currents?

    I'm struggling to wrap my head around this, but it's fascinating!
     
  18. crutschow

    Expert

    Mar 14, 2008
    19,115
    5,341
    You basically have it.
    The magnetizing current is proportional to the transformer voltage, not current, so the lower the voltage, the lower the magnetizing current.
    This magnetizing current subtracts from the primary current, so the magnetizing current does not appear in the secondary, causing an error in the measured current.

    Are you interested in using a transimpedance amp to minimize this error?
     
    Last edited: Jan 29, 2018
    ebeowulf17 likes this.
  19. ebeowulf17

    Thread Starter Well-Known Member

    Aug 12, 2014
    2,112
    357
    You are amazingly helpful! Thanks for suggesting a trans-impedance amp. I had heard of them before, but never had an application until now, and didn't understand them until about an hour ago (probably still don't, but I've deluded myself into thinking I do!)

    I hate asking people to hold my hand through every little step, so I tried to do a little research on them and make a first attempt at laying out the design. It's past my bedtime, so I'm quitting for tonight, but I think I've got the basic concept well underway. It looks like many (most?) op amps won't be able to deliver enough current if I want 50A RMS measurements as my top end (would require around 35mA peak current out of op amp with a 2000:1 transformer) ...but I'm assuming I can add a PNP or P-MOSFET output stage, driven by the op amp, to deliver the current. I'll try simming that tomorrow and see if it works the way I expect in simulation. Assuming I'm anywhere near a workable design, I'll hopefully find time to breadboard this in the next few days and see if my low level measurements have improved!
    current-transformer_transimpedance_02.png
    I also wonder if I'm pushing my luck trying to do this without a dual power supply. It seems like the error signal (right terminology?) will be a negative voltage/current below ground at the inverting input, but it should be cancelled out nearly instantaneously by the op amp's response. If the op amp does its job, the input never goes beyond the typical 0.3-0.7V margin of error on input voltage ranges??? But maybe this is all flawed thinking and the design requires a dual power supply. If that's the case, I'd be tempted to see if I can figure out a cheat, maybe using an op amp channel to create a 2.5V virtual ground that signals are referenced to... not sure, I'm sleepy and may not be thinking straight on any of this power supply stuff.
     
    Last edited: Jan 30, 2018
  20. crutschow

    Expert

    Mar 14, 2008
    19,115
    5,341
    You are correct about the op amp not being able to provide enough current, so it does require a buffer.
    Also requires a plus and minus supply for the plus and minus AC waveform.
    You may be able to offset it but that can get a little problematic to do.

    Below is my take, using a transimpedance amp with buffer (LT1010) directly at the transformer output (I1) which avoid the diode drop voltage, giving 0V at the transformer output.
    The transimpedance output then goes to an ideal full-wave rectifier circuit.

    upload_2018-1-30_0-55-40.png
     
    Last edited: Jan 30, 2018
    ebeowulf17 likes this.
Loading...