PC-Based Power Meter Measures DC-DC Converter Characteristics

April 25, 2023
It should be obvious to anyone who has tried measuring (with limited test equipment) the input and output characteristics of a dc-dc converter that a

It should be obvious to anyone who has tried measuring (with limited test equipment) the input and output characteristics of a dc-dc converter that a power meter would be a useful tool. To satisfy this need, the proposed design must allow designers to perform load measurements on the device under test without connecting an endless spaghetti of test leads. The photo shows the completed power meter display on a personal computer (PC) monitor.

In designing the power meter system, we first established its specs. For boost, buck, and linear implementations, we chose a 30V measurement range for input and output. Most quality dc-dc converters operate at 100 kHz or higher, so the frequency response should be higher than 100 kHz. However, a slower response is also acceptable because the switching waveforms are reasonably repetitive.

For most applications measurements to within 0.1% (10 bits) are adequate — even though 14 bits are available. Once digitized, you can upload the results via an RS-232 interface and displayed on a PC screen, with an update rate of once per second (like most multimeters). Once data arrives at the RS-232 port, the power of the PC can be unleashed upon it. Fig. 1 shows the circuit that is based on a 14-bit simultaneous-sampling ADC (MAX125).

Analog Front End

At the front end of the meter, a precision resistive divider allows accurate voltage measurements up to 30V. The divider is an ORNA10-1 from Vishay, a trimmed resistor network with two 1kΩ and two 10kΩ values. The ratiometric accuracy of these four resistors is 0.05%, which provides a precision fraction (1/11) of the applied voltage. The MAX125 ADC's fault-protected input has a range of ±5V, which allows a degree of safety under fault conditions and plenty of headroom for input and output voltage measurements.

A MAX471 precision current amplifier (Fig. 2) measures the input and output currents. This device measures the voltage across an internal 30mΩ resistor and delivers an output current whose amplitude equals 500μA per ampere of high-side current. Thus, the value of an external resistor scales the output voltage, and it achieves suitable resolution with 4.7kΩ.

Wide input capability and fault-protection circuitry give the MAX125 a low input impedance, so the four readings are buffered before entering the ADC. Unity-gain buffer stages are taken from the MAX4254 quad precision op amp, whose input offset voltages (70μV) are lower than the system resolution.

Buffered MAX125 inputs overcome their low input impedance, but driving an ADC from low impedance is always good practice — even when the converter has a high input impedance. The buffer provides the necessary drive for charging the sample/hold capacitor in an acceptable time. To see how low the source impedance has to be, consider a simple RC time constant calculation. The input capacitor charges according to:

Where:
Vcap=Voltage on the input capacitor
C=Sampling capacitor
R=Source resistance
Vin=Voltage applied to the RC circuit
The difference in voltage between Vin and Vcap is:

Thus, given the value of the sample and hold capacitor (normally 10 pF to 30 pF), the charging time of the capacitor, and the error voltage that can be tolerated (½ LSB), you can calculate the maximum allowable signal-source resistance that will charge the capacitor in a given time.

The input buffer can also filter unwanted signals. Because the ADC is a sampling system, its output has spectral symmetry centered about half the sampling frequency. Thus, you can't distinguish signals greater than half the sampling frequency from signals less than half the sampling frequency. With a 10 kHz sampling frequency, for example, the ADC is not able to distinguish between a 4 kHz and a 6 kHz input, because both are symmetrical about half the sampling frequency (5 kHz). You can find details of this “aliasing” effect and the theorem that describes it (Nyquist's theorem) in many papers and books.

An “anti-aliasing filter” removes these unwanted frequencies. The effect of aliasing can be subtle if you consider the frequency spectrum of any signal not purely sinusoidal. By definition, a non-sinewave has harmonics, and these higher harmonics translate downward to cause errors at the lower frequencies. Again, unless the input signal frequency range is definitely known, a combination buffer and anti-aliasing filter is always good design practice.

The system requires minimal filtering because it takes only spot readings. For higher sampling frequencies, a simple low-pass filter using components C1, C2, C3, and C4 provides signal rolloff ahead of the ADC input. These components also average the readings taken by the ADC, and effectively remove ripple from the input and output power measurements.

Digitization

The MAX125 is a self-contained, simultaneous-sampling, successive-approximation data-acquisition system with on-chip RAM. It samples two sets of four signals using 2×4 sample/hold amplifiers, which are then digitized sequentially by a single ADC block. The results are stored in RAM and read out sequentially on the parallel data bus under processor control.

Included in the MAX125 is a voltage reference you can override by an external system reference. It also exhibits good INL (the maximum deviation of real from theoretical ADC output), good DNL (the deviation of real from theoretical ADC step magnitude) and monotonicity to 13 bits (an output code that increases or remains unchanged in response to an increasing analog input). To enable efficient use of the microprocessor, the MAX125 provides a push-pull interrupt output indicating conversion completion.

An internal buffer allows use of an internal or external reference. For the analog input, the reference input should be driven from a low-impedance source. This applies especially for ADCs that employ a successive-approximation register (SAR), because the reference voltage feeds directly into the DAC's R-2R ladder. As the DAC's input code changes, the input impedance of the reference input also changes, thereby modulating the reference voltage. Fortunately, the internal buffer eliminates this concern.

For this design, the internal reference is overridden by an external, precision, low-dropout, low-drift 2.5V voltage reference (MAX873A). Although its use (vs. the internal reference) provided no noticeable change in results, the MAX873A offers better initial accuracy and drift.

Gaining an idea of the drift specification (in ppm/°C) needed for any digitization system is straightforward. First, define the system's operating temperature range. For this application, assume a normal lab temperature range of 30°C. Next, decide on the maximum voltage drift that can be tolerated (normally ½ to 1 LSB) over the temperature range, and hence the drift in V/°C. To normalize this drift value to ppm/°C, divide by the reference voltage and multiply by 106. The result is normally about 2ppm/°C for a 14-bit system, 10ppm/°C for a 12-bit system, and 30ppm/°C for a 10-bit system. These figures change according to the allowable temperature span and total reference drift.

An Atmel AVR processor (AT90S4414) drives the MAX125, with both clocked at 10 MHz derived from an oscillator module. The assembly language program has a single instruction toggling each data line to reflect MAX125 timing. For easier understanding, the program is divided into subroutines, and most lines are commented for the same purpose.1

At startup or power-on-reset, the MAX125 uses bidirectional data pins D3-D0. Setting these pins to 0011 and strobing WR low sets the ADC's mode of operation to receive inputs from all four channels of MUX A. Once established, the microprocessor ports can receive data inputs from the ADC.

Pulsing CONVST causes the processor to wait for an interrupt signal from the MAX125. It then reads out the conversion of channel 1 and sends the result (via the MAX3100 UART and the MAX202E) to the PC's RS-232 port. Each conversion includes 16 bits of data, so each result requires two RS-232 write cycles. Because the ADC stores the conversions from channels 2-4, the time taken to transmit the RS-232 data can be leisurely. After sending the data from channel 1, the process repeats for channels 2-4.

We noted noise pickup on unused data pins of the microprocessor bus (a 16-bit-wide bus with only 14 data lines). If these unused pins are configured as inputs, the noise faithfully masquerades as intermittent data. However, a simple software AND function filters out the induced noise. As an alternative, you can configure the unused ports as outputs.

The above code works perfectly, but establishing correct circuit performance can be difficult. The interrupt pulse from the μC comes and goes so fast (in 1μs) that only a storage oscilloscope can detect it. If a suitable oscilloscope is not available, you can insert a delay routine immediately after the CONVST line has been set HIGH to enable a more leisurely viewing of the interrupt signal.

PC Interface

The key component interfacing the microprocessor to the PC is the addressed UART (MAX3100). It takes input from the microprocessor via its 4-wire SPI (Serial Peripheral Interface)/Microwire2 bus, and converts this data to the format used by most RS-232 compatible devices. An industry-standard, micropower 2TX/2RX transceiver (MAX202E) implements the level translation.

This UART, which has hardware/software shutdown modes and comes in a tiny QSOP package, is ideally suited for low-power portable appliances. For hazardous environments, its interface also allows infrared (IrDA) communication by attachment of suitable optical devices.

A software-based SPI routine is implemented for exporting the code to microprocessors lacking a built-in SPI bus. The code shows that this is a trivial task, and comments guide the uninitiated through the clock cycles of the SPI bus. If you use a dedicated SPI port, it's worth noting that the MAX3100's serial clock line (SCLK) must start in the LOW state when CS is asserted. If this requirement presents a problem, you should cycle the SCLK line before entering the SPI routine.

You must consider the time required for RS-232 data to transmit. At 9600 baud, it takes more than one millisecond to transmit eight bits of data together with the start and stop bits. This is obvious in hindsight, but it can leave the designer wondering why data is not reaching the PC correctly. A simple 10 ms delay inserted in the code allows data transmission and processing at the PC end. Note also that the RS-232 spec does not detail the signal protocol (start and stop bits, etc.); just the voltage levels, slew rate, and connector details. The MAX3100 and MAX202E, however, handle all the standards for making data compliant with RS-232, and in a protocol expected by the PC.

Windows Interface

The Windows program was written in Visual Basic Version 6. It takes readings from the RS-232 port using the MSComm function, configured to accept text, and converts this data to ASCII. It also translates each 16-bit data block back to the voltage and current measurements obtained from analog-sensing circuitry that precedes the ADC input. From these results, the input power, output power, and efficiency are calculated and displayed on the PC screen, rounded to three decimal places. The system can also “freeze” the results for logging.

Measured efficiency figures were not consistent, due to the ripple on the current and voltage waveforms. To reduce the current-ripple readings, we bypassed the 4.7kΩ resistors with 10 nF capacitors, but the resistive-divider networks measuring voltage were left unbypassed. Thus, the measured ripple (20mV on the input and 100mV on the output) accounted for ±3% variation in efficiency measurements.

As results are read into the PC, missing data produces incorrect readings on the PC screen. The time intervals between arriving packets of data were measured. If any interval exceeded 0.5 sec, the PC counter was reset in anticipation of the first character in the subsequent data packet.

Results

Testing the power meter involved use of an evaluation kit for the MAX1705 (Fig 3.), boost dc-dc converter configured in PWM mode as the device under test (DUT). We applied loads to the MAX1705 evaluation kit, and took results by freezing the MAX125 PC program and reading values from the screen. We confirmed the results using the (now obsolete) digital multimeter, and compared the data with the expected efficiency given by graphs in the datasheet. The table, on page 50, tabulates the results.

Calibration, Tweaks

The analog board layout must be impeccable for the best circuit performance. All power rails to the analog ICs should be thick, and decoupled to ground with capacitors physically close to the devices: at least 1 μF (tantalum) in parallel with 100 nF (ceramic). A good ground plane should be included — especially around the MAX471, because high-frequency, high-amplitude currents occupy that territory. The 4.7kΩ resistors on the MAX471 should be precision types with low inductance, because any tolerance on these components affects the results. All analog p. c. board tracks should be as short as possible and far away from digital lines. The MAX125 reference amplifier should be decoupled at input and output, close to the IC. Ideally, the board should incorporate separate analog and digital ground planes, connected at a single point.

The 10 MHz clock appears in unexpected places, so if this signal is to be routed across the p. c. board it should be remote from analog inputs — especially the resistor networks — and with a ground track in between. To further minimize noise radiation, this signal can be filtered to remove clock harmonics and reconstituted using a simple digital gate placed close to the processor and ADC. A ‘74HC00 works well for this purpose.

To obtain absolute dc accuracy, the MAX873A reference offers excellent drift specifications, for example, but its initial accuracy (±1.5mV) gives a ±10LSB error in 14-bit systems. You can trim this error by connecting a trim pot between the Output Trim pin and ground. It is advisable to switch the reference voltage across the input and output resistive dividers, and read the input signal to the ADC. From this reading, you can determine errors in the resistive divider chain and implement a software offset.

To accurately calibrate the current-sense amplifiers, you must take ADC readings while applying a current source to the input and output, thus obtaining the error in the current amplifier and output resistor. This current source should be set at the minimum expected current reading, because the MAX471 dominant error at low currents is due to input offset voltage contributed by the internal op amps.

This system was built up in a series of circuit blocks, and each block was tested individually. This design procedure eliminated a lot of the tension associated with initial power-up of the system. The results taken correspond to those illustrated in the MAX1705 datasheet.

References

  1. A full listing of the assembly-language code and the Visual Basic program modules are available in a ZIP file from the author at: [email protected].

  2. SPI is a registered trademark of Motorola Inc. Microwire is a registered trademark of National Semiconductor Inc.

  3. http://www.maxim-ic.com

For more information on this article, CIRCLE 334 on Reader Service Card

Sponsored Recommendations

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!