## Friday, May 29, 2015

### How to calculate the accuracy of a power measurement

Electrical power in watts is never directly measured by any instrument; it is always calculated based on voltage and current measurements. The simplest example of this is with DC (unchanging) voltage and current: power in watts is simply the product of the DC voltage and DC current:
So the accuracy of the power measurement (which is calculated from the individual voltage and current measurements) is dependent on the accuracy of the individual V and I measurements.

For example, you might use a multimeter to make V and I measurements and calculate power. The accuracy of these individual measurements is typically specified as a percent of the reading plus a percent of the range which is an offset. (Note that “accuracy” here really means “inaccuracy” since we are calculating the error associated with the measurement.)

Let’s use an example of measuring 20 Vdc and 0.5 Adc from which we calculate the power to be 10 W. We want to know the error associated with this 10 W measurement. Looking up the specs for a typical multimeter (for example, the popular Keysight 34401A), we find the following 1-year specifications:

DC voltage accuracy (100 V range): 0.0045 % of reading + 0.0006 % of range
DC current accuracy (1 A range): 0.1 % of reading + 0.01% of range

The error (±) associated with the voltage measurement (20 V) is:
So when the measurement reading is 20.0000 V, the actual voltage could be any value between 19.9985 V and 20.0015 V since there is a 1.5 mV error associated with this reading.

The error (±) associated with the current measurement (0.5 A) is:
So when the measurement reading is 0.5 A, the actual current could be any value between 0.4994 A and 0.5006 A since there is a 0.6 mA error associated with this reading.

We can now do a worst-case calculation of the error associated with the calculated power measurement which is the product of the voltage and current. The lowest possible power value is the product of the lowest V and I values: 19.9985 V x 0.4994 A = 9.98725 W. The highest possible power value is product of the highest V and I values: 20.0015 V x 0.5006 A = 10.01275 W. So the error (±) associated with the 10 W power measurement is ± 12.75 mW.

The above is the brute-force method to determine the worst-case values. It can be shown that the percent of reading part of the power measurement error can be very closely approximated by the sum of the percent of reading errors for the V and I. Likewise, it can be shown that the offset part of the power measurement error can be very closely approximated by the sum of the voltage reading times the current offset error and the current reading times the voltage offset error:
Applying this equation to the example above for the 100 V and 1 A ranges at 20 V, 0.5 A:
So for 10 W, we get:
As you can see, this is the same result as produced by the brute-force approach. Isn’t it great when math works out the way you expect?!?!

In summary, the error associated with a power measurement calculated as the product of a voltage and current measurement has two parts just like the V and I errors: a % of reading part and an offset part. The % of reading part is closely approximated by adding the % of reading parts for the V and I measurements. The offset part is closely approximated by adding two products together: the voltage reading times the current offset error and the current reading times the voltage offset error. It’s as simple as that!

### Should I use RS-232 or GPIB to communicate with my instrument?

Hi everyone,

I am writing this as I am preparing to go to the beach for a week.  My topic today will be short but hopefully useful.    We are going to talk about a subject that has been near and dear to my heart for the past 15 years, serial versus GPIB communication on our instruments.

Back in the days before LAN and USB became instrument standard interfaces, many of our products were designed with RS-232 serial ports in addition to GPIB.  RS-232 is standard on the 681xB AC Source/Analyzers, the E36xxA bench power supplies, the N330xA Electronic loads, as well as a few other products.

RS-232 is an interesting option for communication because it is free, most people have them standard on their computers, and you really only need to buy a reasonably priced cable.  The main drawbacks are the fact that you need to put it in remote mode yourself using the "SYST:REM" command, that reasonably priced cable has to be properly configured, and it is slower than GPIB.  The main drawbacks of GPIB is that it costs more and you need to purchase hardware.

I did some benchmarking this morning using my trusty 6811B AC Source/Analyzer.  I used the proper RS-232 cable and my Keysight 82357B USB to GPIB converter to connect to the 6811B.  I wrote a small program that measures the time to send a "*IDN?" command and receive a response.  The program looped 100 times and calculated the average time.  With GPIB, the average time to send and read back took about 7 ms.  With RS-232, the same send command and read back the response took about 50 ms.

So to answer my titular question, "Should I use RS-232 or GPIB to communicate with my instrument?", my answer in every instance would be to use GPIB.  I know that it is more expensive but you really get what you pay for in this instance.  GPIB is a much faster, more reliable way to communicate with your instruments.

Thanks for reading.  Let us know if you have any questions.

## Friday, May 22, 2015

### New performance options for the N6900A Advance Power System gives greater versatility for your test needs

Our N6900 and N7900 series Advanced Power System (APS) DC power supplies are some of our most sophisticated products, setting new levels of performance and capabilities on many fronts. They come in 1kW and 2kW power levels as shown in Figure 1 and can be grouped together to provide much greater power levels as needed.

Figure 1: N6900 and N7900 Advanced Power System 1kW and 2kW models

Most noteworthy is that these can be turned into full two-quadrant DC sources by connecting up the optional 1kW N7909A Power Dissipator (2 needed for 2kW units) providing 100% power sinking capability. This makes APS an excellent solution for battery, battery management and many alternative energy applications, where both sourcing and sinking power are needed.
• The N6900 series DC power supplies are designed for ATE applications where high test throughput and high performance is critical.
• The N7900 series dynamic DC power supplies are designed for ATE applications where high speed dynamic sourcing and measurement is needed, in additions to high performance.

A lot more about these products is covered in another post on our General Purpose Electronic Test Equipment (GEPTE) blog when they were first announced. This is a great resource for learning more about APS and can be accessed from the following link: “New Advanced Power System: Designed to Overcome Your Toughest Test Challenges”

If you are a regular visitor to the “Watt’s Up?” blog no doubt you have seen we have shared a lot about how to do things with the N6900 series and N7900 series APS to address a number of difficult test challenges. A lot of times it would have otherwise required additional equipment or custom hardware to accomplish these tasks. While many of these examples are suitable for the N6900 and N7900, a good number of times examples make use of the additional capabilities only available in the N7900 series.

In certain test situations the N6900 series APS would be a great solution and lower cost than the N7900 series, if only it also had a certain additional capability. To this end Keysight has recently announced four new performance options for the N6900 series APS to address a specific test need you may have, as follows:
1. Accuracy Package (option 301): Adds a second seamless measurement range for current
2. Measurement Enhancements (Option 302): Adds external data logging and voltage and current digitizers with programmable sample rates
3. Source and Speed Enhancements (Option 303): Adds constant dwell arbitrary waveforms and output list capability, and faster up and down programming speed
4. Disconnect and Polarity-Reversal Relays (Option 760 and 761): Provides galvanic isolation and allows output voltage to be switched between positive and negative values

Additional details about the N6900 series APS and the four new performance options are available from the recent press release, available at the following link: “Keysight Technologies adds Versatile Performance Options to Industry’s Fastest Power Supplies”

With these new options you now have a spectrum of choices in the Advanced Power System product family to better address any test challenges you may be faced with!

## Wednesday, May 20, 2015

### Updates to USB provide higher power and faster charging

For those who regularly visit our blog here are already aware I do a fair amount of work with regard to test methodologies for optimizing battery life on mobile wireless devices. One directly related topic I have been actively investigating these past few months is the battery charging aspects for these devices. Recharging the battery on these devices takes a considerable amount of time; typically a couple of hours or longer, and it’s only been getting worse. However, there has been a lot of work, activity, and even new product developments that are making dramatic improvements in recharging your devices’ batteries in less time!

The USB port has become the universal connection for providing charging power for mobile devices. When initially available a USB port could provide up to 500 mA for general power for peripheral devices. It was recognized that this was also a convenient source for charging portable devices but that more current was needed. The USB BC (battery charging) standard was established which formalized charging initially for up to 1.5 amps at 5 volts.

This higher charging current and power was alright for mobile devices of a couple of generations ago, but today’s smart phones, tablets, and phablets are using much larger and higher capacity batteries. The end result is, because USB is 5 volts its power thus limited to 7.5W, that it can take several hours to recharge a device’s battery.  This can be very inconvenient if your battery goes dead during the day!

Simply increasing the USB current is not a total answer as this has limitations. First, the micro USB connectors on mobile devices are rated for no more than about 1.8 to 2 amps. To help on this front there is the new USB Type-C cable and connector specification released last year. The new type-C micro connectors are able to handle up to 3 amps and the standard connectors able to handle up to 5 amps. Higher current alone is not quite enough. Also issued last year was the new USB Power Delivery 2.0 specification. This specifies a system capable of providing up to 20 volts and 5 amps. This is more than order of magnitude improvement in power over the existing USB power. Long charging times due to power limitations will become a thing of the past.

The new USB power delivery voltages and currents are a discrete set of levels as shown in table 1. As can be seen the levels depend on the profile/port designation.

Table 1: USB power delivery 2.0 voltage and current levels

The cables and connectors of course need to be able to handle the given level of current and power.  In review of the standard a lot of work and effort has gone into providing this new capability while maintaining compatibility with the past as well. Thus for a new mobile device to take advantage of these higher power levels, it must be capable of negotiating with the charging power port to furnish it. At the same time, if an earlier generation mobile device is connected, it will only be able to get the default USB 5 volt level.

I’m looking forward to seeing this new USB power delivery put into wide-spread use in various innovative new products. Expect to see more about this topic in future posts from me here!

## Thursday, April 30, 2015

### When is a number not a number?

All of our power supplies measure their own output voltage and output current. These measured values are available to you from the front panel and over the bus. They may be displayed as an average value or a digitized waveform. Some products have different measurement ranges you can set that affect the accuracy of the measurement and the noise floor of the measurement. Of course, there is a maximum value that each measurement range is capable of measuring. So what happens to the reading if the actual output voltage or current exceeds the maximum value of the measurement range? What does the front panel show and what value do you get if you read it back over the bus?

Below is an example where I set the current measurement range to the 1 mA range on a Keysight N6781A Source/Measure Unit. I then forced more than 1 mA to flow out of the output. As you can see, the front panel indicates “Overload”. If you perform a current measurement and read the result back to your PC, you will get 9.91E37. This is a value defined in the SCPI (Standard Commands for Programmable Instruments) standard to mean “not a number” (NAN). Since Keysight products follow the SCPI standard, we return this number when a range is overloaded. This numeric value for NAN was chosen so that it can be represented as a 32-bit floating point number and is larger than anything expected to occur while using instrumentation. In addition to an overload condition on an instrument, NAN can also be used as the result when, for example, you divide zero by zero or subtract infinity from infinity.
This predefined number is also used when waveform data exceeds the maximum rating of a particular range. The screenshot below on the left shows data that does not overload the range. But when the range is changed and part of the waveform exceeds the maximum rating of the range, that part of the waveform data shows up on the screen in red and when returned to a PC, the value is the NAN value of 9.91E37.

Two other unique numbers defined by the SCPI standard are used to represent positive infinity and negative infinity. For positive infinity (INF), 9.9E37 is used. For negative infinity (NINF), -9.9E37 is used. These values can be used to mean “maximum” for a setting. For example, our output voltage slew rate setting has a range of values to which it can be set. If you want to ensure the output voltage will change as quickly as possible, you want to set this to the maximum slew rate possible. Instead of looking up the specification for the maximum setting, you can use the appropriate SCPI command to set the slew rate to 9.9E37 and it will go to the maximum possible slew rate.

So when is a number not a number? When it is equal to 9.91E37!

### Let's See the Watchdog TImer in Action

Hi everybody!

It is the end of the month and time for my monthly blog post.

Quite some time ago, my buddy Gary mentioned our watchdog timer protection in a post.  Here is what he had to say:

The watchdog timer is a unique feature on some Agilent power supplies, such as the N6700 series. This feature looks for any interface bus activity (LAN, GPIB, or USB) and if no bus activity is detected by the power supply for a time that you set, the power supply output shuts down. This feature was inspired by one of our customers testing new chip designs. The engineer was running long-term reliability testing including heating and cooling of the chips. These tests would run for weeks or even months. A computer program was used to control the N6700 power supplies that were responsible for heating and cooling the chips. If the program hung up, it was possible to burn up the chips. So the engineer expressed an interest in having the power supply shut down its own outputs if no commands were received by the power supply for a length of time indicating that the program has stopped working properly. The watchdog timer allows you to set delay times from 1 to 3600 seconds.

Since Gary wrote that post, we have released the N6900 and N7900 APS units that also include this useful feature.  What I wanted to do was show how to set it up, how to use it,and how to clear it so that everything is a bit more clear.   All of my programming examples in this post will be done using my APS with the VISA-COM IO Library in Visual Basic.

The setup is pretty easy:

APS.WriteString("OUTP:PROT:WDOG:DEL 5")
APS.WriteString("OUTP:PROT:WDOG ON")

This sets the watchdog delay to 5 seconds and enables it.  This means that if there is no IO activity (ie your computer hangs up) for 5 seconds, then the unit will go into protect and shut the output down.

Lets say that I have a program that performs a measurement around every second for a minute.  Here is the program:

APS.WriteString("OUTP:PROT:WDOG:DEL 2")
APS.WriteString("OUTP:PROT:WDOG ON")

For i = 0 To 59
APS.WriteString("MEAS:VOLT?")
Next

APS.WriteString("STAT:QUES:COND?")

The watchdog delay is set for 2 second so while I run in the loop taking my measurements everything is working great.  After the 3 second wait at the end though, the 2 second watchdog timer comes into effect and the unit goes into the protect state and disables the output.  The response to the questionsable status query is 2048 which corresponds to bit 11 of the register which is defined as "Output is disabled by a watchdog timer protection".  This is the expected result.

My reccomendation to clear the watchdog timer would be to first disable the watchdog timer and then clear the protect.  You can then re-start the watchdog timer when you are ready.

APS.WriteString("OUTP:PROT:WDOG OFF")
APS.WriteString("OUTP:PROT:CLE")

The watchdog timer is a pretty cool feature that can perform a pretty useful task.  I hope that this blog post explains what it is and how to use it a bit more.

## Tuesday, April 28, 2015

### Optimizing a Power Supply’s Output Response Speed for Applications Demanding Higher Performance

Most basic performance power supplies are intended for just providing DC power and maintain a stable output for a wide range of load conditions. They often have lower output bandwidth to achieve this, with the following consequences:
• Internally this means the feedback loop gain rolls off to zero at a lower frequency, providing relatively greater phase margin. Greater phase margin allows the power supply to remain stable for a wider range of loads, especially larger capacitive loads, when operating as a voltage source.
• Externally this means the output moves slower; both when programming the output to a new voltage setting as well as when recovering from a step change in output load current.

While this is reasonably suited for fairly static DC powering requirements, greater dynamic output performance is often desirable for a number of more demanding applications, such as:
• High throughput testing where the power supply’s output needs to change values quickly
• Fast-slewing pulsed current loads where the transient voltage drop needs to be minimized
• Applications where the power supply is used to generate power ARB waveforms

A number of things need to be done to a power supply so that it will have faster, higher performance output response speed. Primarily however, this is done by increasing its bandwidth, which means increasing its loop gain and pushing the loop gain crossover out to a higher frequency. The consequence of this the power supply’s stability can be more influenced by the load, especially larger capacitive loads.

To better accommodate a wide range of different loads many of our higher performance power supplies feature a programmable bandwidth or programmable output compensation controls. This allows the output to be set for higher output response speed for a given load, while maintaining stable operation at the same time. As one example our N7900A series Advanced Power System (APS) has a programmable output bandwidth control that can be set to Low, for maximum stability, or set to High1, for much greater output voltage response speed. This can be seen in the graph in Figure 1, taken from the APS user’s guide.

Figure 1: N7900A APS small signal resistive loading output voltage response

Low setting provides maximum stability and so it accommodates a wider range of capacitive loading. High 1 setting in comparison is stable for a smaller range of capacitive loading, but allowing greater response bandwidth. This can be seen in table 1 below, for the recommended capacitive loading for the N7900A APS, again taken from the APS user’s guide.

Table 1: N7900A APS recommended maximum capacitive loading

While a maximum capacitive value is shown for each of the different APS models for each of the two settings, this is not altogether as rigid and fixed as it may appear. What is not so obvious is this is based on the load remaining capacitive over a frequency range roughly comparable to the power supply’s response bandwidth or beyond. Because of this the capacitor’s ESR (equivalent series resistance) is an important factor. Beyond the corner frequency determined by the capacitor’s capacitance and ESR, the capacitor looks resistive. If this frequency is considerably lower than the power supply’s response bandwidth, then it has little to no effect on the power supply’s stability. This is the reason why the power supply is able to charge and discharge a super capacitor, even though its value is far greater than the capacitance limit given, and not run into stability problems, for example.

One last consideration for more demanding applications needing fast dynamic output changes, either when changing values or generating ARBs is the current needed for charging and discharging capacitive loads.  Capacitors increasingly become “short-circuits” to higher AC frequencies, requiring the power supply to be able to drive or sink very large currents in order to remain effective as a dynamic voltage source!

.