PC data aquisition/plotting software for standard DAQ

For PC type software that runs under some PC opsys.

PC data aquisition/plotting software for standard DAQ

Postby Doug Coulter » Tue Feb 28, 2012 10:42 am

I've just finished up rev 1.0 of the PC sofware for the standard DAQ, based on the same PCB as our standard counter, just with different code in it. This adds 4 channels of A/D to the system, with the rather slow sample rate of 1/sec/channel. Still very useful, as that's about the right speed for monitoring your fusor high voltage, current, and pressure (what I had in mind for my own uses). While written for linux, it's in perl and is actually cross-platform if you install perl and the required libraries on windows - it's a task (chore?), but it is possible without changing the code itself - and it uses the same windows driver for the USB as the standard counter.

This uses the GTK window/widget system for the GUI. In the perl code, I've incorporated the XML from the glade GUI designer right inside, but I'm also providing the glade file in case you want to change something. The perl code allows you to either load it from inside the program itself, or this file - see the code for how to do either.

This version skips the 10 second moving averages (I'll add those back in standard-DAQ-plot) for the counter inputs, and adds the 4 a/d channels to the raw data stream coming from the PIC USB device. It's really better to do any math in the PC, where there are more cycles and ram available, just as a philosophy - the pic is loafing in this application too. But you never know what we'll add down the road.

For this one, I added scaling for the counters and the a/d channels, so it can come out with CPS, CPM, something arbitrary (you can type in a number), and the a/d can come out in raw counts, or in volts (assuming your USB is 5.0v, which surprisingly all mine are - I checked a few machines around here).

I think I've fixed a sync issue that sometimes caused a line from the previous run to show up as the first data line in a restart. I've just generally cleaned up the PC code quite a bit here, partly for you, and partly for me - it's now easier to build off of for the next go around.

I used an interesting trick in the PIC software. This particular PIC has a 10 bit a/d - kinda on the low side. But since it can do conversions really fast ( ~100khz) and is actually more noise than accuracy limited, I decided to take 64 samples per channel per output and sum them, giving a 16 bit output. Now, it's not that good - it's not really 16 bit accurate, but it is a lot better than 10 bits, probably around 12 bits worth. Any noise present (there is always some) acts as what signal processing guys would call a "dither" source to smooth the results around the a/d transition thresholds, which internally are pretty accurate in the pic (which is why the more expensive ones now offer 12 bits!).

Here's the code itself. I'll get some screen shots of the thing in action to add here. The plots are mainly to help you be sure you're getting good data, so in this there is no provision to apply custom scale factors to the a/d (other than raw or some number that applies to all channels to get volts). The coming DAQ plot program will allow scale factors so things like HV volts and milliamps, and pressure in some standard units (I use millibars here) and so on will be allowed. And what I'm really hoping to get to is multidimensional plots so that you can plot say, neutron counts versus pressure and voltage in 3-d, or even use color to get 4d, so if you run your fusor for awhile, you can fill in the parameter space in a super-duper scatter plot - and find all the sweet spots in operation, even if you miss them as you go by in real time. This also can create the usual human readable text log file, which the plotter code will use, but which can also be analyzed manually, or stuffed into an SQL database for later work.

Here's the goodies:

stdDaq.zip
PC software for data aquisition
(11.52 KiB) Downloaded 266 times
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: PC data aquisition/plotting software for standard DAQ

Postby Doug Coulter » Tue Feb 28, 2012 11:43 am

And here is the promised screenshot, kind of small as it was taken on a small screen, duh.
sdaq.png
On the small screen of my dev server


As you can see, I'm turning one of the a/d inputs up and down with a pot across the supply, the others are hard wired to various references, and I touched a floating cmos counter input a couple times to pick up the power frequency. More impressive if I had a CCFL on nearby, but I've replaced most of those now with LEDs that don't make the big signal at khz. I allow you to type in scaling factors for counters and a/d, and the defaults are conversion to cpm for counters and volts for a/d.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA

Re: PC data aquisition/plotting software for standard DAQ

Postby Doug Coulter » Wed Feb 29, 2012 12:41 pm

Just to communicate where I want to wind up here - here's a 4-d plot...which would nicely cover say, volts, ma, pressure, and neutrons out of a fusor. This is a kind of dumb example, and a scatter plot (rather than smoothed contours) is more like what I have in mind - along with the possibility of combining more data from multiple runs and so on, but this is kind of what I'm seeing in my head while working on this.
heatmap.png
4-d plot


This took only a few lines fed to gnuplot to generate, since it's just plotting some numeric functions it can calculate itself.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.
User avatar
Doug Coulter
 
Posts: 3515
Joined: Wed Jul 14, 2010 7:05 pm
Location: Floyd county, VA, USA


Return to PC

Who is online

Users browsing this forum: No registered users and 1 guest

cron