Current Transformer and Ideal Rectifier

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Since I am designing a meter (based on ATmega8) to measure the RMS current (50Hz mains power), I had a look at the application note “Atmel AVR465: Single-Phase Power/Energy Meter”.

In order to double the accuracy, I added a diode bridge between the transformer secondary and the sensor resistor (RS, Figure2-4 page 10).

In this configuration, the 4-diode bridge acts as an ideal full wave rectifier; this could be verified on a scopemeter.

Also increasing the reading scale could be done by simply decreasing the value of RS (for example, by adding another resistor in parallel).

I think if the current in the added resistor is made to be a few mA only at full scale, an MCU I/O pin could be used as a switch for it (as low-state output if on or tri-state input if off). This method will not need an external opamp and an IC for the electronic switches. But the MCU pin (used as a switch here) will be driven by the same ‘linear’ voltage of the ADC pin when it floats (configured as input with no pull-up). So I have to check what could be the drawback in this simple case. For example, I will monitor the increase of the current (Icc) drawn by the MCU (in my case, ATmega8 running at 8MHz by the internal RC oscillator) at various input levels and find out if it is acceptable or not (I will likely use 3 pins as switches to get 4 scales).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

'double the accuracy' - not likely! Diodes have a temperature coefficient. By rectifying the signal, you may have doubled your resolution, but not the accuracy.

Basically what you're suggesting is to use the port pins to switch the burden resistor to give you different current ranges. Normally you'd have the burden resistor on the transformer side for safety. You don't want to not have a burden resistor as the current transformer will output a high voltage.

I'd suggest you use an energy monitoring ic from the likes of crystal semi, Analog Devices or Microchip that have high resolution bipolar adcs and rms hardware to all the grunt work for you. These chips are quite cheap.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

'double the accuracy' - not likely! Diodes have a temperature coefficient. By rectifying the signal, you may have doubled your resolution, but not the accuracy.

 

On the circuit shown on the application note there is a need for a virtual ground (Vcc/2). In this case ADC full scale is proportional to the peak-to-peak current and not to peak current only. Doesn't doubling the resolution here lead to doubling the accuracy? (anyway, the measurement is better done).

About the 4-diode-bridge, I am sorry you didn't notice yet that it acts as an 'ideal' rectifier in this case. Could you figure out the theory behind it? And if you have a scope you can see clearly the current shape (on RS) and how it is rectified ideally even near zero level (practically speaking... since nothing is 100% perfect). Therefore the temperature coefficient has almost zero effect on the voltage developed on RS. (I hope you have a scope to get fully what I say).

 

Kartman wrote:

Basically what you're suggesting is to use the port pins to switch the burden resistor to give you different current ranges. Normally you'd have the burden resistor on the transformer side for safety. You don't want to not have a burden resistor as the current transformer will output a high voltage.

 

I am sorry again that you didn't notice that I will use 3 more resistors (to be connected in parallel) to have 4 scales. In other words, the resistor for the lowest scale is always connected at the secondary output.

 

Kartman wrote:

I'd suggest you use an energy monitoring ic from the likes of crystal semi, Analog Devices or Microchip that have high resolution bipolar adcs and rms hardware to all the grunt work for you. These chips are quite cheap.

 

Thank you for the advice.

I'm afraid I don't have the privilege that most people have. So I have to think always 'out of the box' every time I design a product due to the rather small list of the available components I can use. For example, to get a current transformer, we remove the low-voltage coil of a conventional small 'iron' transformer and replace it with 1 or 2 turns of thick wire (as its primary).

 

 

Last Edited: Sun. Mar 15, 2015 - 11:15 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

your concept is that you switch the burden resistors with port pins. A tristated port pin should not give you an appreciable load - the impedance will be high and the capacitance a few pF. Also note that the effective on resistance of the port mosfet can be many ohms.
I too have modified mains transformers as a home brew current transformer!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are right about the saturation internal resistance of a pin when configured as output.

Also I have to use 5% tolerance resistors at best. And since I prefer not to add the available trimmers (mechanical variable resistors), I usually include in my algorithms what I may call "adjusting variable". The MCU calculates, usually for once, this variable at run time (there is one for each scale in this project) then saves it in EEPROM. At run time, I activate the routine of this adjustment thru an unused pin (or by other methods, if real necessary) at a specific value of the measured current (usually at 50% of the maximum).

For instance, I try (while designing the hardware and software) that the end accuracy will be not more than 1%.

The conversion time of my free running ADC for this meter is about 100us (or 832 MCU cycles at 8 MHz). So during a mains half-cycle (if 50 Hz), there are about 100 samples. Also I had to take into consideration that the frequency of our mains power (or of independent AC generators) could vary from 45 to 55 Hz, besides the possible variation of the internal MCU frequency. How I did it, I will leave it for another thread ;)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Using the rectifier changes the way the measurement is done. There are both pro's and con's from this. The good thing is that the ADC only needs to measure positive voltages and thus one gains 1 Bit of resolution  and switching the shunt is simpler as it is DC Voltage. With the rectifier working in a current mode there is not much trouble with temperature effects.

 

 However there is also a downside: the burden voltage is higher by 2 Diode drops - thus errors from the current transformer increase. The ADC needs to measure a DC voltage and thus can not use an automatic zero adjustment in software. I am afraid the loss in accuracy due to ADC offset voltage is larger than the gain from 1 bit more of resolution. Switching the burden Resistor directly via a port Pin in limited, as the output impedance of the IO Port is not very temperature stable. Its more like a high TC 60 Ohms resistor. So the useful range in somewhat limited, even it more than 1 Port pin is used. So one would likely need at least an external lower resistance MOSFET for the range-switching.

 

Typical there are is a large number of samples and thus oversampling, so that resolution of the ADC is not so critical, unless the amplitude gets very small. Thus range Switching is likely the more important way to improve.  So the justification for the rectifier is more the simpler way of range switching, not the gain in ADC resolution.

 

The easier way would be choosing a xmega: they have 12 Bit ADCs and switchable Gain. There are also a view classic AVRs with internal gain.
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kleinstein wrote:

However there is also a downside: the burden voltage is higher by 2 Diode drops

 

Sorry, I couldn't get where your 2 Diode drops are. The voltage on RS (after the bridge) is, in this case, rather ideal with no diode drops. Please note, the source here is of a current supply not voltage one.

 

Kleinstein wrote:

...thus can not use an automatic zero adjustment in software

 

Even there is no diode drops, I can't see what is the use, in this application, for an automatic zero adjustment. But to compensate the initial small variation of the value of RS (and of other parameters), I have to let the MCU know, for once, the ADC reading that corresponds to a specific external level so that it can generate a correcting factor (somehow equivalent to an adjustment using an external trimmer). But to get a practical correction without losing accuracy, the algorithm is not trivial. About the temperature sensitivity of some parameters, its end effects could be minimized to a good extent by choosing optimum values.

 

Kleinstein wrote:

The easier way would be choosing a xmega: they have 12 Bit ADCs and switchable Gain. There are also a view classic AVRs with internal gain.

 

If I can order what I like (as you can), I would choose a ready-made IC for such meter... if not a complete ready-made meter ;)

I agree with you that it is nonsense re-inventing the wheel if it is not for fun. But when there are no wheels (products I need) around me, I have no choice but to find a way to re-invent them even if not perfectly done. Perhaps I am wrong, but in my opinion, having something is always better than having nothing ;)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Die voltage drop seen by the transformer is larger: there are 2 extra diodes in series and in addition the resistor would be twice as large. The larger voltage at the transformer mean a higher magnetic filed and thus more magnetizing current and thus additional errors. It depends on the current transformer how important this difference is.

 

Doing an automatic offset calibration is simple if the ADC measures AC voltage: as the transformer can not give a DC output, the average should be zero. This is relatively easy to implement - I have shown code including this before in an other thread. The ADC input of the AVR can have an DC error - that is 0 output from the ADC is not exactly at 0 V, but may be off a little (typical value for the megaxx8PA is 2 LSB). Even less that 1 LSB of offset would be more than what is gained from having 1 more bit of resolution. With the rectifier a zero offset adjustment would need 0 current state to do the adjustment. It also takes some tricks to get the value better than 0.5 LSB.

 

Calculating the RMS value from samples AC voltage is working rather good. Due to oversampling the resolution can be much better than 10 Bits (e.g. 14 Bits), even though the individual readings are from -511 to 511 only.