Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

This area is for discussions involving any fusion related radiation metrology issues. Neutrons are the key signature of fusion, but other radiations are of interest to the amateur fusioneer as well.
Harald_Consul
Posts: 94
Joined: Sat Oct 20, 2018 6:01 am
Real name: Harald Consul

Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Harald_Consul »

If you are evolving from a nature science, you are already familiar with it. Performing interesting experiments (like nuclear fusion) usually require a lot of trial runs. Thus, monitoring scientific experiments in shifts (including the weekends) has been - and still is - one of the major hobbies of nature scientists.

However, integrated lab measuring and controlling can bring some automatization into the lab. It works like this, that the sensors of the experiment are connected to a measurement and control port, that brings conection to the monitoring software on the computer. Usually a parameter set is defined, within which the experiment is in good and healthy condition. As far the experiment remains within the parameter set, integrated lab measuring and controlling allows experiments to be performed automatically without personal monitoring. Otherwise the automatic run of the experiment gets aborted.

A famous software for integrated lab measuring and controlling is Labview. Another more semi-professional one is Labjack.

What are your experiences with integrated lab measuring and controlling?
Which software do you use?
How do you manage the problem, that the drivers of the measurement and control port usually are only provided for Windows and do not get updated to new Windows versions, any more?
Jerry Biehler
Posts: 975
Joined: Tue Nov 24, 2009 3:08 am
Real name:
Location: Beaverton, OR

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Jerry Biehler »

I used labview to control my vacuum system that I have been building for ebeam deposition. I needed to talk to things like my VAT valve which is controlled through RS-232 so it was really the simplest way. I used something similar to a labjack to handle the analog outputs from the pressure sensors I used. Labjack is more of a series of hardware solutions for I/O than software.

Labview has a rather steep learning curve. There is a lot of help out there though and there are lots of examples and demos that you can build off of. Sometimes it is just easier to do simple stuff with an arduino, but if you want a nice HMI like I did that eliminates the arduino right away.

And Labview for home use is only $50. Sure it is only windows but I hate linux so I am quite ok with that. As long as you are running 32 bit windows you can still use most old drivers, it is when you get into 64bit windows when drivers have to be signed which is just annoying. But most of the companies making this hardware have drivers. Just make sure before you buy a piece of hardware you can get drivers for it.

The control I built:
https://hackaday.io/project/190-vacuum- ... view-wheee
User avatar
Richard Hull
Moderator
Posts: 14991
Joined: Fri Jun 15, 2001 9:44 am
Real name: Richard Hull

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Richard Hull »

What can I say.... As an old friend once said to me looking over some of my projects..........."nice stuff!" Actually, the best stuff.

Richard Hull
Progress may have been a good thing once, but it just went on too long. - Yogi Berra
Fusion is the energy of the future....and it always will be
The more complex the idea put forward by the poor amateur, the more likely it will never see embodiment
Harald_Consul
Posts: 94
Joined: Sat Oct 20, 2018 6:01 am
Real name: Harald Consul

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Harald_Consul »

So you "hacked" the vacuum sensor to integrate the bare sensor signal into your lab? That's exactly what I am thinking about. Mainly because high quality lab meters with PC data connection are unbelievable expensive.

But if one uses MS Windows as operating system for it, the whole valuable integrated lab will be a Windows zombie machine in 10 years. Without any support and highly unsafe to connect to the internet.
User avatar
Richard Hull
Moderator
Posts: 14991
Joined: Fri Jun 15, 2001 9:44 am
Real name: Richard Hull

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Richard Hull »

All of this stuff is ephemeral and time stamped. Ancient instrumentation and lash-ups not tied to software, operating systems and the originator is still viable albeit limited by any modern standards. The latest and greatest in the computer age is forever doomed to a rapid disintegration, due to lost, outdated and incompatible new software that will not run on any but the old operating system.

I was once hot on assembly language on the 6800, 8000 and 6502 processors. Basic, Pascal, Forth, Fortran etc., not so much any more.

As I became proficient in one assembler, or interpreted higher language I was chided for still working in that old chips assembler and not this "new thing". I just grew tired of it all and now, since retirement, only fiddled with the C variant of the Arduino IDE. It is enough for me to do all I want in my remaining years.

I often wonder if I was a victim of the "real" computer revolution 1973-1990. Things moved at such a rapid pace, companies came into existence and went out so fast along with micro-processors and early languages, that it left one with a swimming head trying to keep up. I remember as late as 1990 when if you were not Novell certified, you were lost in system level work.

Running any complex non-computerized system today is considered a backwater. IOT is creeping into every appliance, and on and on it goes, where it stops, nobody knows.

I'll let the youth and gifted of today have it all to themselves. I fear that if something nasty happens, with all the entanglement of systems and conveniences taken for granted by modern people there will be no one single person who can know it all well enough to put a broken humpty-dumpty back together again.

For a fusor system, it seems like an Arduino-mega coupled with a bit of electrically controlled valves and instruments could be worked out by a dedicated "Arduinoist".

Richard Hull
Progress may have been a good thing once, but it just went on too long. - Yogi Berra
Fusion is the energy of the future....and it always will be
The more complex the idea put forward by the poor amateur, the more likely it will never see embodiment
Harald_Consul
Posts: 94
Joined: Sat Oct 20, 2018 6:01 am
Real name: Harald Consul

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Harald_Consul »

You are right Richard.

On the other hand, however, integrated lab measuring on a computer also offers some advantages:
  • Exact time synchronization of different measurements.
  • Producing an integrated data set with all measured variables, that can be analyzed by a statistics software, that allows very sophisticated analysis and thus may uncover hidden information.
  • Exact recalculation of the true single events of a complex multiple event history. E.g. in an energy spectrum analysis these energy "channels" of classical "multi channel" analyzer do not measure exactly, when two or more different events happen in the same measurement time frame.
  • ...
Chris Mullins
Posts: 67
Joined: Sun Feb 19, 2017 11:32 am
Real name: Chris Mullins
Location: Shenandoah Valley, VA
Contact:

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Chris Mullins »

MegunoLink (https://www.megunolink.com/) is something I plan to try when adding computer control to my setup. I haven't used it before, but it looks promising. I've never been a fan of LabView - too high level for my tastes.
Michael Bretti
Posts: 175
Joined: Tue Aug 01, 2017 12:58 pm
Real name: Michael Bretti

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Michael Bretti »

I have also been exploring MegunoLink with an Arduino Mega controller for my system as well. So far I am quite happy with it, and customer support has been great. I'm only about maybe 1/3 done with my code, but it has made creating a user control interface with monitoring and data collection very easy, despite the fact that I am very weak in coding. While the program does have its limitations and may not be for every application, I definitely plan on using it for any future applications that require system control, monitoring, and interlocking. I will say that it does seem like it has the potential to create quite powerful control loops without significant effort.

If anyone else is planning on using MegunoLink, I will be releasing both of my Arduino code and MegunoLink code for reference when its complete. However, even though it is not complete, I would still be happy to share my Arduino and Megunolink files as an example of implementation. You can see some screen shots of the current screens at the bottom of the page in the link: http://appliedionsystems.com/high-vacuu ... -pictures/. I have it set up so there are multiple tabs that simultaneously run that I can switch between. So a start-screen, manual mode, auto mode, cooling system data, vacuum system data, etc.

The code consists of both soft and hard interlock monitoring, cooling system data plotting and acquisition, and plotting/acquisition for the roughing and high vacuum gauges. At the bottom of each screen are interlock alarms that change color based on the state of the interlock. Manual mode is mostly set up and ready to go, which allows me to individually control the pumps, chiller, and fans for the cooling system, as well as the roughing and diffusion pump power (with sequential interlocking to prevent something like the diffusion pump from being turned on without cooling or roughing.) Auto mode is not implemented yet, but will eventually include a fully automated sequence to start up the cooling and vacuum systems from off and automatically bring the entire system up to full vacuum from atmosphere.

A general description of the system can be found here as well: http://appliedionsystems.com/portfolio/ ... ol-system/. I haven't been able to work on it in quite a while, focusing on just getting my vacuum system running and accelerator designed, but I will be revisiting it once the vacuum system is done and I complete my initial beam tests.
Harald_Consul
Posts: 94
Joined: Sat Oct 20, 2018 6:01 am
Real name: Harald Consul

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Harald_Consul »

The MegunoLink seems to be a nice insider tip. However I doubt, ATMega Controller can do high frequency sensing like a PC oscilloscope.

Last week at cleaning up my old lab stuff I have refound my old USB-PC-oscilloscope. 70MHZ and with Labview driver. Really no bad equipment. However, as it is already round about 10 years old, I cannot do anything with those old ***.inf and ***.sys drivers any more. I even cannot identify on the manufacturer's driver CD, for which Windows version those drivers have been built (2000, XP, Vista, 8.1, 32bit, 64bit)? This Windows driver obsolescence is really annoying!!

Has anyone managed to run an old an Windows in a virtual machine image and to assign 1 or 2 USB ports to the image (and performed measuring on it) ?
Michael Bretti
Posts: 175
Joined: Tue Aug 01, 2017 12:58 pm
Real name: Michael Bretti

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Michael Bretti »

Harold,

Yes, you are correct about MegunoLink and Arduino not being able to do high frequency sampling like a scope. For my system, I am only using it for very slow changing monitoring and interlocking of the infrastructure. So like temperature sensors, flow sensors, and vacuum sensors, as well as power to the chiller, fans, pumps, etc. My interlock and monitoring program is set for 1Hz acquisition, which is more than enough for my interlocking purposes. For any fast data stuff, like fast signals, pulses, nuclear instrumentation, etc, I would use a regular scope or proper instrumentation hardware.
Last edited by Michael Bretti on Tue Jan 15, 2019 2:33 pm, edited 1 time in total.
Harald_Consul
Posts: 94
Joined: Sat Oct 20, 2018 6:01 am
Real name: Harald Consul

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Harald_Consul »

Yes, but you won't be able to assemble the (high-frequency) data from different instruments correctly by time, then (even if they would allow a data export on USB stick or SD card).
Michael Bretti
Posts: 175
Joined: Tue Aug 01, 2017 12:58 pm
Real name: Michael Bretti

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Michael Bretti »

My control and acquisition system is only for infrastructure currently, not integrating different high-precision timed instruments. For my systems (both the accelerator and propulsion chamber), chances are I will be going the very old-school route and be using an older multi-channel decent-bandwidth oscilloscope for certain timed stuff and taking photographs of the screen (I recently acquired a working Tektronics 2465 4-channel 300MHz scope for free that I will be using for my system) for the time being. This will work for what I need to accomplish (due to my own cost restraints and experimental requirements) however your system and requirements will certainly be different. However, I can say that at least for controlling your vacuum system and monitoring the vacuum, MegunoLink can be convenient for quickly building a user interface. If using multiple fast-timed instruments, depending on the instrument, they can be synchronized through various analog input and output triggers as needed (if they include such IO). You do not necessarily need to use a sophisticated control software for this, though there are advantages to this.
Last edited by Michael Bretti on Tue Jan 15, 2019 11:05 pm, edited 2 times in total.
Chris Mullins
Posts: 67
Joined: Sun Feb 19, 2017 11:32 am
Real name: Chris Mullins
Location: Shenandoah Valley, VA
Contact:

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Chris Mullins »

For high speed data acquisition, I'll use a Siglent scope permanently dedicated to my system. Two channels at up to 1Gsamp/sec, 14Msample storage is pretty good for under $400, and can always be put back in service as a standalone scope. I can't stream high speed data to the PC continuously, but I have all the trigger mechanisms supported by the scope to capture what I need at whatever timebase I want.

I tend avoid Windows instrument drivers whenever possible. I've found it's better to use an instrument's RS-232/Ethernet/GPIB/RS-485/USB virtual comm port, and send SCPI commands directly to it with its own native command set. That avoids any finicky Windows or Labview driver issues, is OS-agnostic, and makes it easier to work with a range of tools like Python, MATLAB, BASIC, or even right on a command line by hand. That's how I'll be interfacing my venerable Keithley 617 electrometer alongside my shiny new Siglent scope with MegunoLink. The MegunoLink interface to each device will be through their standard SCPI command sets, not some high level Labview driver.
Michael Bretti
Posts: 175
Joined: Tue Aug 01, 2017 12:58 pm
Real name: Michael Bretti

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Michael Bretti »

Chris brings up a very good point. Something like MegunoLink could be used to interface with your high speed acquisition modules and synchronize everything. You wouldn't use the software or arduino by itself for the high speed acquisition part directly. I know that the software can in theory support unlimited serial devices. So it will act as the control system, where all of the peripherals are interfaced to it. Similar with how something like EPICS is used for accelerators.

Eventually I would like to have my software synchronize timing (like firing pulsed thrusters or the accelerator and synchronizing aquisition to it through various scope and instrumentation triggers) and do plan on adding control pages for the two systems, but cost prohibits me for running all of the necessary cabling for now (my system needs to be remote and at a distance since the accelerator would be far too dangerous to be directly near.) So I'm going with less automated, more direct alternatives now to just get stuff running.

Chris, sounds like you are working on a pretty sweet setup, looking forward to seeing more how it progresses! If you do go the MegunoLink route, I'd also definitely be interested in seeing your implementation for it.
User avatar
Richard Hull
Moderator
Posts: 14991
Joined: Fri Jun 15, 2001 9:44 am
Real name: Richard Hull

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Richard Hull »

I view the Arduino as strictly a micro-controller. Odd how that is what such items are called and labeled in the real world. When I say controller I am talking more or less industrial level measurement and control. ie. sensing a voltage, pressure, temperature and rather immediately working a mechanical contrivance, pump, valve, moment arm, warning klaxon, relay, solenoid, motor, etc.

I have tested the response time on a 5 line coded interrupt service routine on the stock 16mhz, Arduino Uno, Pro-mini and Nano which are virtually all identical and interchangeable by their control functionality. I found the average response input to the interrupt line to an output signal from the performance of the interrupt service routine to vary between 10-30 usec under most situations. The Arduino is used where milliseconds matter in a process under control.

This is far faster than needed for virtually all "real world" control applications, but totally untenable for tight multi-measurement, time ordered situations. The o'scope is needed... or.... special, ultra-fast, dedicated hardware/software devices specific to the application.

If you don't like riding around on O,scoping efforts in your application where it is far too hands-on, be prepared to pull out a fat, well endowed wallet and see it go on a rapid monetary diet plan. This is when 1 microsecond is considered an eternity. You are obviously not controlling anything in the real world sub-microsecond other than perhaps a laser pulse or pockels cell, you are just taking data for dabbling with later, at your leisure in ponderous human time frames.

Definitely apples and Ferraris

Richard Hull
Progress may have been a good thing once, but it just went on too long. - Yogi Berra
Fusion is the energy of the future....and it always will be
The more complex the idea put forward by the poor amateur, the more likely it will never see embodiment
Jerry Biehler
Posts: 975
Joined: Tue Nov 24, 2009 3:08 am
Real name:
Location: Beaverton, OR

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Jerry Biehler »

No, I didn't hack the sensors, they come with analog out as standard, in the manual they tell you how to decode the voltage signal to get useful information. I just apply the math in labview and I get my pressure reading out.

I have a 2465 too, good scope. If it is the original 2465 they have an issue with the cooling fan you need to watch out for. If it stops running you can fry the U800 chip which is basically unobtanium at this point. Mine was dead when I got it and I found a rebuilt one from a company on the internet. They are a custom buehler brushless motor and tough to replace without a lot of mods. The B and C versions of the scope went to a traditional muffin fan for cooling.

Kinda meh on the Megunolink. Like I mentioned before you can get the real full version of LabView for $50 for home use and it is way more capable than that and about the same price. There is even a LabView interface for it from NI: http://www.ni.com/gate/gb/GB_EVALTLKTLVARDIO/US Have not tried it so I dont know anything about it thought.

I would say the arduino is more of a devkit than anything else since it has the support circuitry needed to program it and get it to talk to the outside world. Just has a fancy boot loader on it to talk to the arduino IDE. I personally use Teensys instead of arduinos, they are compatible software wise but offer some micro controllers that are much more powerful.
Harald_Consul
Posts: 94
Joined: Sat Oct 20, 2018 6:01 am
Real name: Harald Consul

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Harald_Consul »

Thank you all for those good contributions to the topic.

Maybe some overviewing this field could do a short summarizing synopsis with the strengths and weaknesses of each measuring approach to provide guidance for the others?
Harald_Consul
Posts: 94
Joined: Sat Oct 20, 2018 6:01 am
Real name: Harald Consul

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Harald_Consul »

Ok, I got you. Once I want a summarizing synopsis, I have to do it.

But these points are stil open (to do this):
  • High frequency sensing with Atmel controller chip (Arduino)
  • Time synchronisation of different (high frequency) meters
Maybe a trigger signal e.g. from a pulse generator can be used for time synchronisation?
User avatar
Richard Hull
Moderator
Posts: 14991
Joined: Fri Jun 15, 2001 9:44 am
Real name: Richard Hull

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Richard Hull »

Regarding HF sensing for synchronization for the Atmel IC. If you go native and don't use the IDE in the Arduino, I have no idea. I use the Int0 on the Arduino and am able to count and record up to about 24,000 pulse per minute with a simple three line interupt service routine one of thus lines demands a 300us delay every time it is run.

I guess we need to know what you might figure is high frequency.

A test might involve the one line code in the service routine ( count++;) and see how close it comes to the frequency on the int pin. I would be stunned if it did an accurate count beyond 20khz

Richard Hull
Progress may have been a good thing once, but it just went on too long. - Yogi Berra
Fusion is the energy of the future....and it always will be
The more complex the idea put forward by the poor amateur, the more likely it will never see embodiment
Harald_Consul
Posts: 94
Joined: Sat Oct 20, 2018 6:01 am
Real name: Harald Consul

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Harald_Consul »

Update. Currently these points are still open:
  • High frequency (> 3 MHZ) sensing with Atmel controller chip (Arduino)
  • Time synchronisation of different (high frequency) meters
  • Running (old) USB-drivers on (old) Windows in a virtual machine to reenable old measuring equipment (typically the Windows drivers of the equipment do not work on the second next Windows version any more)
John Myers
Posts: 68
Joined: Tue Mar 07, 2017 7:13 pm
Real name:
Location: SoCal

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by John Myers »

The Arduino code base is meant to be user friendly not necessarily quick and efficient. So even though an Atmel AVR chip can handle 'sensing' frequency's above 3Mhz the Arduino library and the skill of the programmer will limit the actually max frequency that can be counted accurately.

Micro-controllers like AVR's are terrible at accurate in-sync measurements. At higher frequency a CPLD/FPGA is a better option (or buying a module).

Trying to use old USB drivers in a VM seems like a very hit-and-miss idea to me. When I used VirtualBox even newer common USB devices would give me trouble trying to get them to work.
Rex Allers
Posts: 570
Joined: Sun Dec 30, 2012 3:39 am
Real name:
Location: San Jose CA

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Rex Allers »

John Myers said,
Micro-controllers like AVR's are terrible at accurate in-sync measurements.

I don't have much experience beyond simple stuff with AVR chips. What are you getting at? The timing of measurements is hard to keep consistent or maybe there are accuracy issues with ADC?

Can you be more specific about why FPGA is better on some issues?
(Not surprised that specific hardware configuration would be, just not sure exactly what aspects would be improved.)
Rex Allers
Harald_Consul
Posts: 94
Joined: Sat Oct 20, 2018 6:01 am
Real name: Harald Consul

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by Harald_Consul »

USB is a standardized interface. Thus, a generic USB driver can be used for any USB controller (instead of an individual one), right?

Aren't new USB controllers (USB 3.0, 3.1) downward compatible to USB 2.0, so that also USB 2.0 drivers might be used on them?
John Myers
Posts: 68
Joined: Tue Mar 07, 2017 7:13 pm
Real name:
Location: SoCal

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by John Myers »

Rex,

It's being able to consistently sync multiple discrete IO and interrupt signals that older micro-controllers like AVR can't do well. More modern MCU's like Xmega's do have special modules built in to address these issues. Most ADC's in MCU aren't designed for high speed, their just meant for basic voltage readings.

CPLD/FPGA's are just gate-logic so they don't have the multitasking issues like latency and interrupts that an MCU has.
John Futter
Posts: 1848
Joined: Wed Apr 21, 2004 10:29 pm
Real name: John Futter
Contact:

Re: Integrated Lab Measuring and Controlling (Labview, Labjack, ...)

Post by John Futter »

I personally would never use labview for any real time application
for a start it sits atop a non real time operating system.
Getting reliable data in real time keeps many experts very busy
one very good example is http://www.coultersmithing.com/forums/v ... f=13&t=640

One place real time data is important is in the automotive industry, engine control, self drive etc and these applications use
an RTOS "Real time Operating System" such as QNX a real time unix
What they do is not possible with windows or whatever Linux flavour
let alone along with a resource hungry application like labview that wants 110% of a processors resources
Post Reply

Return to “Neutrons, Radiation, and Detection (& FAQs)”