Poor precision and accuracy in 2203

Post general discussions on using our drivers to write your own software here
Post Reply
psiolent
User
User
Posts: 4
Joined: Wed Oct 29, 2008 10:16 pm

Poor precision and accuracy in 2203

Post by psiolent »

I am writing an application to monitor battery charge and discharge. The problem is that I am seeing very poor precision and accuracy from the data obtained from the scope. A battery in charge or discharge cycle should produce a fairly smooth curve, but I am not seeing that.

The program currently takes a sample every 2 seconds. The sample is an average (calculated by my program) of 8064 samples obtained from the scope with no oversampling and with a timebase of 12 (sampling interval of about a tenth of a millisecond). I've also tried this with many other timebase/oversample combinations with similar results.

Attached is our log file with the samples taken at 2 second intervals. This can easily be imported into a spreadsheet for analysis. Also attached is a gif showing two graphs generated in excel, the bottom graph showing the actual data and the top graph showing a 40 second (20 sample) running average.

The discharge cycle proceeds until about sample 3200 (6400 seconds) at which point the discharge apparatus is disconnected resulting in an expected spike in voltage. The remainder of the time would be the battery slowly coming up to resting voltage.

At least, that's what one would expect to see in a fairly smooth curve for a battery discharge/rest cycle. Instead the data comes out like a stock market graph. We see small scale variation of up to 200mV, and even when we graph our 40 second running average (of samples that are already averages) we see about the same level of variation. I've also plotted a 5-minute running average (not attached) and seen the same kind of random stock-market like pattern.

What is going on here? Is something wrong with our scope? Why are we seeing data that appears fractal in nature rather than something resembling a smooth curve as would be expected when monitoring a battery?
Attachments
bttylog.txt
(241.56 KiB) Downloaded 608 times
bttyplot.gif
(21.24 KiB) Downloaded 75 times

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

Hello psiolent

From your images, it looks like quantisation error. What voltage range are you using ans what is the voltage range of the signal that you are measuring?

Regards

Robin

psiolent
User
User
Posts: 4
Joined: Wed Oct 29, 2008 10:16 pm

Post by psiolent »

Hi Robin! Thanks for responding.

The battery I was testing with is a 12V, so I am using the +-20V range. I am using a 10X probe so actual values I am getting from the scope are around 1.1-1.2V. Perhaps should I change the range to +-2V since I am having to multiply values in my program anyways? I will try this and report my results. Meanwhile if you need any other info from me or want me to try anything else I am at your command.

Thanks!

Aja

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

You should set your range to +/- 2 V or use a x1 probe.

Also, you might want to try turning resolution enhancement on.

Let me know how you get on.

Robin

psiolent
User
User
Posts: 4
Joined: Wed Oct 29, 2008 10:16 pm

Post by psiolent »

I'm trying it with +-2V right now and it looks much better. I appear to be getting data in about a 10mV range now instead of 200mV, which is adequate for our purposes. I'll log some data for a few hours and see what it looks like and post that.

Is resolution enhancement the same thing as oversampling? I'd tried using oversampling before with no real improvement, but I should try it again.

Also, is oversampling different than just a simple average? For example if I take my 8,064 samples and average them myself is that a different value from what I get by turning on oversampling?

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

I forgot you're not using PicoScope 6. Resolution enhancement is an option in PicoScope 6 and, like oversampling, is effectively a moving average.

If you use an oversampling factor of 2, for example, 2 samples will be acquired and averaged for every one sample read from the scope. So, it is a moving average with a window size of 2.

Post Reply