## 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!

.

## Friday, April 10, 2015

### Mathematically defining test pulse 2b of ISO-7637-2 section 5.6.2 automotive test standard

There are a variety of electrical disturbance tests for conducting validation tests on automotive electronic devices defined by ISO-7637-2 and ISO-16750-2, and a variety of other comparable standards. Based on the latest revisions of these two standards ISO-7637-2 incorporates disturbances mostly with very high speed rise or fall times of nanoseconds to microseconds, while ISO-16750-2 incorporates electrical disturbances having relatively slow rise and fall times, on the order of a 1 millisecond, in comparison.

The ISO-7637-2 disturbances having fast rise and fall times are primarily a result of voltage spikes created by switching inductive devices on and off, or electrical devices creating a stream of voltage spikes while active. One exception is test pulse 2b of ISO-7637-2 section 5.6.2, which addresses the electrical disturbance created by an electrical motor, like that of a blower motor within the heating and air conditioning system. When the motor is running and then the ignition is switched off, the motor will change over from consuming power to generating a relatively slow voltage pulse back onto the electrical system, until all the energy from its spinning mass is dissipated. Test pulse 2b is depicted in Figure 1.

Figure 1: Test pulse 2b of ISO-7637 section 5.6.2

For this particular test pulse the standard recommends using an arbitrary waveform generator driving a DC power supply/amplifier with an analog control input. This is sensible given its complex shape, consisting of a step drop followed by the motor regeneration energy pulse. To simplify the set-up here, a Keysight N7951A 20V, 50A, 1KW Advance Power System power supply was chosen, as it already has arbitrary waveform generation capabilities built in, negating the need for the separate arbitrary waveform generator. The N7900A series APS is depicted in Figure 2.

Figure 2: N7900A series Advanced Power System, 1KW and 2KW models

While the step portion of test pulse 2b is easy to define and generate, how does one define the motor regeneration pulse? There are a number of possible approaches:
• A piece-wise linear model can be constructed to approximate the shape.
• Alternately, software tools are available that can generate a data file of points from a graphical image of the waveform.
• Finally, there is a mathematical expression that defines this waveform, referred to as a double exponential, which can be utilized once it is understood how to do so.

A double exponential is basically the difference of two exponential having different time constants, as shown in the expression:

UDE = UA(e-K1t – e-K2t)

Where UA is the electrical system (alternator) voltage, K1 is the slow time constant related to td, the duration of the test pulse, and K2 is the fast time constant related to tr, the rise time of the test pulse.

The trick of making use of this mathematical expression is to figure out how to relate the constants in the expression to the test pulse values shown in Figure 1. It turns out that this is relatively straight forward for this application due to the large relative difference between test pulse 2b’s rise and duration times. The time constant for the slow exponential related to the duration can be defined as:

K1 = (2.303/td) Where td is the duration time (for the 100% to 10% transition)

While the time constant for the fast exponential related to the rise time can be defined as:

K2 = (2.197/tr) Where tr is the rise time (for the 10% to 90% transition)

The important thing here is that this is valid for when td >> tr. As the ratio of the two times lessens then there is more interaction between the two exponentials, requiring some compensation be made, primarily adjusting for some loss in amplitude. The resulting exponential and double exponential waveforms are shown in Figure 3 using the double exponential expression, based on using the rise and duration times, and amplitude value given in Figure 1 for test pulse 2b.

Figure 3: Exponential and double exponential waveforms for implementing ISO 7637-2 test pulse 2b

To actually generate test pulse 2b, the arbitrary waveform generation and editing capabilities in the Keysight 14585A software were used to put together a sequence consisting of a voltage step followed by the double exponential we just mathematically defined. The 14585A is a companion software package used to set up and run the ARB, and then retrieve back, display and analyze measurements from the N7900A series Advanced Power System. The resulting test pulse waveform was run, captured and displayed in the 14585A’s scope mode, shown in Figure 4.

Figure 4: test pulse 2b of ISO 7637-2 generated and captured using 14585A software

Test pulse 2b automotive electrical disturbance in the ISO 7637-2 standard can be easily generated based on the mathematical expression for a double exponential waveform. It just a matter of understanding  the relation between the test pulse’s rise and duration times, and the double exponential waveform expression’s time constants, as we have shown here!

.