Exponential Transients: A Capacitor Tester

This example is the analysis section of a program that operates interface hardware and records transients. As such, it tells only part of the story of what started out as a graduate-student interfacing exercise, and ended up as a freshman demonstration. The interface hardware enables the computer to control the current through an external circuit and read the potential across it. In the example, the circuit is a 0.1 mF capacitor in parallel with a 200 kW resistor (nominal time-constant 20 ms). The interface has a 12-bit d/a converter, a 12-bit successive-approximation a/d converter, a programmable crystal oscillator, and programmable amplifiers (Harris 2400 with four input amplifiers and a sample-and-hold node) as well as digital buffer circuitry. For measurements at precise time intervals, the oscillator is connected directly to the a/d, and the digital circuitry operates on the a/d conversion complete pulse.

When a transient is requested, the operating program stores the next a/d reading, then sends the new current value to the d/a, and starts logging data (at 1ms intervals in this example). The analysis technique works best if data are recorded at fixed potential (rather than time) intervals, and this also serves to reduce the size of the data file. (Here the potential range is divided into a 32-point grid.) Even potential spacing is easy to achieve with an older computer (Atari 1040ST) where the interface sits directly on the backplane, but the layers of hardware and software in the 486 PC used here slow the sampling rate and make the spacing a bit uneven.

The interface hardware provides data which are ideally suited for fitting to a straight line by least-squares provided the non-linear transformation is applied to the 'x'-axis, not the 'y'-axis. The quartz oscillator provides precise 'x'-values that remain precise when transformed, and the successive-approximation converter provide 'y'-values with a deviation independent of 'y'. The algorithm finds the value of t that minimizes the deviation in 'y' from a linear dependence on 'exp(-t/t)'. The new dimensionless 'x'-variable starts from 1 when t = 0, and goes to 0 as t tends to infinity, so the transient proceeds from right to left along the transformed 'x'-axis.

The program accesses transient data for four capacitors of the same nominal value but different quality and size (quality and size vary more or less inversely). The first is essentially ideal, and the rms deviation of the points from the fitted line is 0.30 lsb (least-significant-bits of the a/d converter). With a successive-approximation a/d converter, all voltages less than 1 lsb above the final approximation give the same reading. If the data are distributed evenly across the lsb, a perfect exponential transient will exhibit a 'quantizing error' of one lsb divided by the square root of 12 (about 0.29 lsb). (This number is easily calculated - it is the rms value of a 1-lsb peak-to-peak triangular waveform.) The second and third capacitors are progressively less ideal, but can still use 1-lsb scale divisions in the scatter plot. The fourth capacitor is of ideal size for mounting on a crowded circuitboard, but its scatter plot requires 20-lsb scale divisions. (The plots are not really scatter plots - other than for the quantizing error, the error is systematic, i.e. the Q-V relation is not linear.)

The program loads the selected transient and plots it (in green), then fits it when asked, and plots the fitted transient (in blue) along with a scatter plot (in red) that shows the deviation from the fitted line on an expanded scale. The scatter plot uses the same "right-to-left" 'x'-axis as the fitted transient. The first point (the one at the top in both plots) is not included in the least-squares analysis because it was recorded before the transient was initiated.

Java Source   Liberty Basic Source

The Liberty Basic version of the program allows you to get hardcopy output by writing an eps file for a PostScript printer (or Ghostscript).

Back to Index