10
Hacking DrDAQ for Improved Accuracy I needed to measure the discharge characteristics of 12 V leisure batteries for work. Manually taking readings every minute or so, over periods of 10 to 20 hours, is not a practical proposition; some sort of low cost automated solution was needed. Given that this was a work project, time for making the test equipment functional was strictly limited. The time taken to pick the appropriate test equipment was also strictly limited; hence there is no guarantee that the solution chosen is the cheapest or the best. It is nevertheless adequate. Having chosen DrDAQ as the acquisition system it was then required to interface DrDAQ to the battery. A leisure battery on charge could read up to about 15 V and given that DrDAQ has a maximum input range of 10 V some sort of input attenuation is needed. A DMM was used to confirm that the input resistance of DrDAQ is 1 M on all ranges. A 470 K series resistor should give a suitable scaling to the native 10 V range. The actual input of DrDAQ sees a reduced input signal by an amount of If DrDAQ reports 10 V the input must have been 14.7 V. We therefore need to scale DrDAQ readings by something like ×1.47, the exact value depending on the resistor tolerances. The 470 K resistor is best placed inside a shielded BNC box, as shown below. Leslie Green CEng MIEE 1 of 10 March 2015 R1 1M eg R2 470k input

Hacking DrDAQ for Improved Accuracy

Embed Size (px)

DESCRIPTION

DrDAQ is, amongst other things, an 8 bit data logger. In order to measure the discharge characteristics of 12V leisure batteries I needed more resolution. The addition of one resistor and the correct settings are together used to improved the accuracy by a factor of 10.

Citation preview

Hacking DrDAQ for Improved Accuracy

I needed to measure the discharge characteristics of 12V leisure batteries for work. Manually taking readings every minute or so, over periods of 10 to 20 hours, is not a practical proposition; some sort of low cost automated solution was needed.

Given that this was a work project, time for making the test equipment functional was strictly limited. The time taken to pick the appropriate test equipment was also strictly limited; hence there is no guarantee that the solution chosen is the cheapest or the best. It is nevertheless adequate.

Having chosen DrDAQ as the acquisition system it was then required to interface DrDAQ to the battery. A leisure battery on charge could read up to about 15V and given that DrDAQ has a maximum input range of (10V some sort of input attenuation is needed. A DMM was used to confirm that the input resistance of DrDAQ is 1M( on all ranges. A 470K series resistor should give a suitable scaling to the native (10V range.

The actual input of DrDAQ sees a reduced input signal by an amount of

If DrDAQ reports 10V the input must have been 14.7V. We therefore need to scale DrDAQ readings by something like 1.47, the exact value depending on the resistor tolerances.

The 470K resistor is best placed inside a shielded BNC box, as shown below.

The range from 14.7V to +14.7V is converted with 8-bit resolution in DrDAQ. The steps in the readings are therefore .

There are two basic approaches to improving the measurement resolution: either improve the resolution of the acquisition device or back off some of the DC input voltage with a stable DC reference. I chose the first method, given that I wanted a self-contained and transportable measurement device.

As it turns out the Picolog software has an over-sampling mode built into it. What this does is it takes multiple samples and averages them together. A noisy signal would have reduced noise and improved resolution. But a battery voltage is not a noisy signal, so you do not get much improvement just using the over-sampling. However, when you add a dither signal the improvement seems almost miraculous (see the results graph on page 6).

DrDAQ has a built-in waveform generator. If you set this to a 10Hz triangular waveform of 1.5V peak this can act as a suitable dither waveform. It is necessary to connect the waveform generator output to the oscilloscope input via a 10M( resistor to give a suitable signal strength.

WARNING: If you solder the 10M( resistor between the signal pins of the BNCs, as shown below, you will void (invalidate) your warranty. Also, if you are clumsy with your soldering you could melt the insulator on the BNC socket.

There are two wires on each BNC socket. If it is not obvious to you which is the signal wire and which is the ground, you probably shouldnt be soldering resistors between the pins! Connect up the circuit off-board using BNC connectors and wires instead.

The electrical circuit with the dither injection resistor (R3) is shown below

The 10M( dither injection resistor gives a little bit more attenuation of the input signal, meaning the 1.47 nominal gain factor will need to be increased to 1.517.

It is important to remember that this modification to DrDAQ is a hack. It is not supported by the manufacturer or by me. Earlier or later versions of the software and hardware are not guaranteed to support this functionality.

Picolog does not have the ability to set the waveform generator (or if it does, I didnt spot it). In order to make waveform generator active I first fired up the Picoscope software (v6.10.11.15) and set the amplitude, frequency, offset, and waveshape as required.

It turns out that shutting down the Picoscope software (currently) does not disable the waveform generator. Starting the Picolog software, v5.24.2, (currently) does not change the state of the waveform generator. If you unplug the USB connection, or turn off the host computer, you will obviously have to go through this sequence again to re-enable the waveform generator.

The Picolog software was set to real time continuous sampling, with as many samples averaged as possible, and the resultant data points being saved every 30 seconds. At 1ms per sample this averages 30,000 samples into one data point!

It is worth saying something about the scaling of the result. You could just export the raw data to a spreadsheet and do both the gain and offset scaling there. However, DrDAQ has several built-in methods of doing the scaling so it was convenient to use one of them. I didnt read about all the different methods. Time being an expensive commodity at work, I found one that worked and left it at that.

The most obvious method of scaling the data is to short the input terminals to do the zero calibration then apply a typical input signal and gain-scale the result until it agrees with another piece of test equipment, in this case a bench DVM. In my case the region of most interest is really the range from 11.00V to 12.50V. Linearity errors in DrDAQ could easily be significant now that the oversampling has increased the resolution. It is not that the oversampling has made the linearity any worse, its just that the expectation of an improved accuracy of result will be unnecessarily limited by the native non-linearity of the 8-bit converter. The rule here is to calibrate that part of the range you want to be most accurate.

Using the equation scaling feature of DrDAQ means using an equation such as

(X+0.011) * 1.517

The 0.011 term is the offset and the 1.517 term is the gain. This is the best form of the scaling equation if you are doing a zero and gain calibration. If you are calibrating a small part of the range, as in this case, it is slightly easier to use an equation such as

0.016 + (X * 1.517)

Setting the gain and offset is not especially difficult. I am spelling it out here for completeness, but feel free to skim over the next few paragraphs if you feel I am insulting your intelligence.

The first thing to do is to set the gain accurately. With a calibrator one could apply exactly 11.000V, but I dont have a calibrator, just a power supply and a bench DVM; the accuracy with which I can set the 11.000 V is limited. It is clearly advisable to leave DrDAQ on and measuring a representative voltage for 10 - 20 minutes before doing the calibration in order to ensure that it is warmed up and therefore stable.

inputreading

11.010 V11.153V

12.503 V12.643 V

(= 1.493 V(= 1.490 V

These are the actual values found. The difference-value was slightly too low so the gain factor was increased. These readings were taken using the nominal gain scaling factor of 1.517, so this was changed to . The new gain factor was applied and the offset was adjusted to make the 11V value correct. Because of noise the readings are not going to be exactly equal, just close enough. Checking a few random voltages within the working range suggested a maximum error relative to my 5-digit reference DVM of (10mV, an impressive (0.1% of reading. (Dont expect that level of accuracy to be maintained over time or ambient temperature changes though!)

The equation scaling is quite a way down the dialog box chain!

The no-dither test result below was the first discharge test on the battery. The charge state was as received from the supplier and the DrDAQ calibration was not done as carefully as the later test. The key point to notice is the definite steps in the un-dithered measurement, which correspond with the ADC quantisation levels of DrDAQ.

The dithered response shows no evidence of finite ADC resolution on this scale.

The little recovery of on-load voltage with a few minutes of switch-on is interesting. I suspect that the discharge current heated the battery up and that caused the voltage to rise. I know that the on-load battery voltage drops at low temperature because I later left one of these batteries in an environmental chamber for several hours at 0C and the cell voltage was markedly lower than on other tests at the same initial charge state and discharge current.

Here is the battery and discharge setup

The advantages of using the LD300 active load include giving a constant power load and disconnecting the load when the battery reaches a defined lower limit. This allows unattended discharge testing without killing the battery by over-discharge.

It is true that I used some expensive equipment for this testing, but it was just laying around in the lab. I had to go out and buy DrDAQ because I didnt otherwise have a simple automated measurement scheme.

Oversampling with dither is a well documented method of improving resolution. See, for example, CH 11 of ANALOG SEEKrets.

The circuit was drawn using the free circuit simulator SIMetrix Intro v 7.00e, although I tweaked the resistor and ground symbols to make them look prettier.

Leslie Green CEng MIEE3 of 7March 2015

_1488524404.unknown

_1488616262.unknown

_1488524076.unknown