ELM Home Page


November 3, 2014

AC Load Analyzer


We use a number of electric equipments everyday. I sometimes think need to measure the power consumption of the instruments and home electric equipments, so that I decided to built an AC load analyzer to measure the load current and power consumption. However, the measurement items that only current and power is not sufficient to characterize various type of AC loads, some advanced analyzation features are added in addition to the basic measurement items.

This project, originally AC load meter, was planned some years ago but the features of design did not satisfy me and it had been suspended until this year. Recently, I re-designed it with various features from scratch and started to build the AC load analyzer. It can be saied from my experience that the degree of performance of projects get better as time consumed to research, rather than quick dirty prototyping :-)

Theory

Value of AC

Figure 1. Alternating current



Figure 2. Definition of effective value



Figure 3. Effective value of sine wave

The alternating current (AC) is the current that the direction of flow of electric charge changes periodically as showin in Figure 1. The value of AC is also expressed as like DC. However the instantaneous value of AC i varies continuously and never stay at a fixed value. So how is the value of AC determined?

As far as without proviso, the value of AC is expressed in effective value (RMS value). The effective value of AC current i is subsitution of the value of DC current I that acts the same work as the AC current does, in other words, the power dissipation at the load is equal to the AC current. The instantaneous value of power varies as the current, so that the mean value of power in analysis period is used as shown in Figure 2. The is the equivalent power of AC current, and I, square root of , is effective value of the AC current. Also the AC voltage can be thought as like this. Note that RMS is abbreviation of root-mean-square.

The sine wave is the typical wave form of AC current, e.g. AC power. The RMS value of sine wave with peak value Vp is known as Vp / √2. Figure 3 shows the equations about RMS value of sine wave to verify this. Where T is the a cycle period, ω is angular frequency and sin() is the function of the sine wave. Equation (1) expresses RMS value Irms, and equation (2) is got from the equation (1).

There are some types of AC wave forms, sine, triangle, saw, square and etc. Different shape of AC wave forms with same Ip have different RMS value each other. For example, Ip / 1 for square wave, Ip / √3 for triangle and saw wave.

Power and Power Factor

Figure 4. Pure reactive load



Figure 5. Partially reactive load



By definition in Figure 2, the power dissipation P in the AC circuit can be expressed P = VI or P = I²R as equivalent to DC circuit. However there is a point that it cannot be expressed as like DC circuit, because there is relationship of phase between current and voltage in addition to the value of current and voltage. At the pure reactive load circuit shown in Figure 4, the phase of current lags π/2 from voltage and the power only goes back and forth between power source and load. As the result, there is no power dissipation in the circuit. At the partially reactive load circuit shown in Figure 5, phase of current from voltage φ is 0 < φ < π/2. In this case, a part of power going in the circuit is dissipated at the load. The power P dissipated at the load is P = VI cos(φ), where V and I is effective value of v and i, φ is phase angle between v and i.

Therfore the power dissipation in the AC circuit cannot be determined by only the value of current and voltage. However the multiple of current and voltage VI is still impotant for AC circuit and it is called apparent power. The symbol of apparent power is S and the unit is VA. As the opposit of apparent power, the power dissipated at the load VI cos(φ) is called effective power and the unit is W. Generally when saied 'power' simply, it means the effective power.

The ratio of effective power in the apparent power, P / S = VI cos(φ) / VI = cos(φ) is called power factor. The low power factor load requires large current to supply the same power of high power factor load. It can be saied that low power factor load is uneconomical because it needs large current capacity to electric installation.

Harmonic Current

Figure 6. Non-linear load

Explanations about power factor in avobe are under assumption of wave forms of current and voltage both are sinusoidal. However the load current is not that always sinusoidal at real circuits. Non-linear load, such as rectified circuit, discharge lamp and etc., creates non-sinusoidal current like shown in Figure 6. The non-sinusoidal current contains many harmonic components and the harmonic current differ from fundamental frequency is wattless current that not serve power dissipation. Therefore non-sinusoidal current containing with much harmonic components makes worse the power factor. Additionally, distorted wave form of line voltage due to non-sinusoidal current resuluts some problems of electric installation. The harmonic current of input current is regulated by law in some countries and regions. To avoid this problem, most electronics quipments, such as TV, PC and LED light, integraate power factor correction (PFC) circuit. It achieves the good power factor as high as 99%. However cheap wall adapters without PFC seem to be bad in power factor, 60% or less.

Items to Measure

As the items to measure AC load, current, effective power, apparent power and power factor are needed at least. In addition to these four items, voltage, frequency, energy (watt-hour), harmonic current and current profile are added to the measurement items.

Hardware

Photo 1. Built circuit board


Circuit diagam

Input Signals to Capture

Two input channels, input voltage and load current, are acquired to measure required items. These channels need to be sampled simultaneously because required data is not only wave form but also phase angle between the two channels, and therfore two ADCs are needed. Fortunately, the microcontroller (NXP LPC1519) used in this project has two 12-bit ADC modules for complex signal processing, so that I thought that it will able to be achieved without external ADC. But 12-bit is not sufficient resolution for current channel because the load current varies in range from several milliamperes to 10 amperes or avobe as like idle current and heater current. To solve this issue, an external 16-bit ADC is used for current channel and an integrated 12-bit ADC is used for voltage channel.

Power Supply

Total current consumption of microcontroller, analog circuit and LCDC could be reduced as low as 10 milliamperes. This enables to use a simple capacitive dropper for the auxiliary power supply. This type of power supply has risk of electrical shock because the load circuit is not isolated from AC input, so that the circuit board must be enclosed into a plastic case to avoid unintentional touch of live conductor. Using non-isolated circuit would need to pay special attention to the safety but on the other hand there is an advantage. The current sensing circuit needs not to be isolated from the AC line and it can eliminate large parts such as isolation transformer, so that I chose a shunt register to detect the load current. Anyway current transformer (CT) is not suitable for precision measuring due to its phase error and linearity error. As the result, the AC load analyzer could be built very small in size.

Display

A 128 by 128 dots TFT-LCD module (ZY-FGD1442701V1) is used for the display. The full-graphic color display enables to show many information superior to character LCDs. The power consumption of the LCDC itself is relatively low but the LED back light consumes a significant power as large as the other circuit. The back light circuit is separated from LCDC, so that it can be connected at power supply serially to reduce supply current to the circuit and it can can use a small dropper capacitor.

L/N Checker

This function checks polarity (line / neutral) of AC input. When it attached to AC socket in opposit direction and touched the earth electrode, LED will light to indicate the circuit grand is on the line side of AC input. Note that the input polarity does not affect functionality of measurement.

Software

Sampling and Re-sampling

Figure 7. Re-sampling

Two input signals, current and voltage, are acquired in sampling frequency of 16 ksps. This is done in a 16 kHz square wave generated with SCT. The rising edge of square wave is used to trigger external ADC and internal ADC. It also generates interrupt at falling edge to read the conversion results.

Number of samples per a cycle varies as input frequency. If it is fixed to a number, following processes, especially harmonics analysis, will be easy. In this project, acquired samples are re-sampled in 128 samples per cycle and store it into a wave form buffer. Most processes are done with the re-sampled data. Raw sampling data is used for only frequency and W-H measurement that need to be processed continuously.

Display mode

The AC load analyze has four display modes in measurment items. The display mode is chenged by MODE button in order of General, Wave form, Harmonics and Current profile. The display is updated in real-time and can also be paused by HOLD button. UP/DOWN buttons have different function by display mode.

Gneneral

Current, effective power, apparent power, power factor and voltage are calcurated with a cycle of re-sampled wave form. To filter out the noise component, the wave form is stored to the buffer in 8-cycle averaging, so that the values are updated in interval of several times per a second. Also consumed energy (W-H), frequency and elapse time are displayed in addition to those items. The frequency is measured in reciprocal method from number of samples of 64 cycles. The frequency resolution becomes 2.44 mHz at 50 Hz input frequency.

Wave form

Captured wave form is displayed on the display. The vertical scale is adjusted to fit peak of wave form in the window. The peak values are displayed on the left-bottom of the scope.

Harmonics

A DFT process is applied to the captured current wave form and display the values of harmonic components. A cycle of wave form is fitted to 128 (2ⁿ) samples by re-sampling process, so that the DFT can be done without windowing. This enables to analyze it without gain error and losing frequency resolution. The 40 frequency components, 0th(DC) to 39th, out of 64 are used as valid data but only 18 items can be displayed on the screen. To show hidden items, UP/DOWN buttons are used to scroll the table. Note that the harmonics analysis in this project is a little differ from the method that specified in IEC61000-4-7 (200 ms (10/12 cycles) of DFT window).

Current profile

Current current data is displayed in horizontal rolling graph. The data captured every cycles is displayed in span of 2 seconds at 50Hz input frequency. The vertical scale can be changed in range of 0.1A to 20A by UP/DOWN button. If the current value exceeds the display range, the graph is shwon in red bars to indicate over range input. The peak value from start of current profile mode is displayed under the graph window. It is displayed red if an overflow at acquisition path was occured. The peak value and overflow status is cleared at restart from pause mode.

Calibration

Because of non-isolated circuit, it must be powered by a separated power supply while flash programming and calibration process. It can also be powered by a 9V battery connected to TP6 and GND. When set P0_13 low and apply power, it will enter calibration mode.

  1. Voltage offset: Tie AC inputs and press DOWN button.
  2. Voltage gain: Apply DC 30.0V to AC input and press DOWN button.
  3. Current offset: Press DOWN button.
  4. Current gain: Set DC 2.00A to R5 and press DOWN button.

The calibrated data is stored into the EEPROM.

Results

Switch mode power supply (SMPS) without PFC. The input current has high ratio of peak to average due to charge current to the input capacitor at peak of input voltage. The wave form like impulse contains much odd harmonic current and it results a poor power factor. BTW, I found that the input frequency is not correct. It varies about ±0.05Hz in period of several minutes. Of course it seems to be correct for electric clocks in the span of a day.

Phase controlled light dimmer. It controls the power of the lamp or heater by controlling ratio of on-time at each half cycles. It is used for various electric equipments but the power factor is not good at low output power.

Temperature controlled soldering iron from Hakko and Goot. To my surprise, these soldering itons do not use half of cycle. Asymmetric wave form contains much even harmonics includs 0th (DC) component. Current profile shows the inrush current at cold start.

Idle current of wall adapters. 40W wall adapter from Fujitsu (left) and 24W wall adapter from Akizuki (right). Cheap wall adapter tends to be inferior to expensive one in efficiency and idle current.

SMPS with PFC. Power factor is drastically improved by PFC controller.


Resources

Sign