mezurit 2 virtual instrumentation for electronics
play

Mezurit 2: Virtual instrumentation for electronics experiments Dr. - PowerPoint PPT Presentation

Mezurit 2: Virtual instrumentation for electronics experiments Dr. Brian Standley FOSDEM 2 Feb 2013 Origin of Mezurit 2 Problem #1: Acquire, scale, and record data Problem #2: Sweep a region of parameter space Problem #3: Find and


  1. Mezurit 2: Virtual instrumentation for electronics experiments Dr. Brian Standley FOSDEM 2 Feb 2013

  2. Origin of Mezurit 2 Problem #1: Acquire, scale, and record data Problem #2: Sweep a region of parameter space Problem #3: Find and trigger on rare events Common hardware: • Semiconductor parameter analyzer (expensive, inflexible) • Computer with DAQ and/or GPIB cards Common software: • Lab-specific LabVIEW/Matlab/IDL • Mezurit "1" by Marc Bockrath and David Cobden • meaSureit by Vera Sazonova Brian Standley FOSDEM 2 Feb 2013

  3. Key features Virtual channels: • Arbitrary (Python) functions of hardware ports (and GPIB) • Invertible functions can be outputs Virtual instruments: • Acquisition Data logging up to ~5 kHz – • Scope Asynchronous acquisition up to hardware – limits (~1 MHz) • Sweeps – Linear or non-linear output ramps • Triggers – Event detection with predefined responses (also ~5 kHz) Command-line terminal Continuously-updated plot and data readout Brian Standley FOSDEM 2 Feb 2013

  4. Example experiment 1000:1 divider junction box Oxford VTI computer SR830 V 100.3 k Ω b feed- SINE OUT PCI-GPIB through 109 Ω Master Addr. 8 PCI-6036e 130 Ω ADC 3 X DL1211 I (each) ADC 4 Y 10 5 V/A INPUT V 100 k Ω tg DAC 0 DAC 1 10 × chip carrier V 1 M Ω bg BGVA Brian Standley FOSDEM 2 Feb 2013

  5. Example experiment 1000:1 divider junction box Oxford VTI computer SR830 V 100.3 k Ω b feed- SINE OUT PCI-GPIB through 109 Ω Master Addr. 8 PCI-6036e 130 Ω ADC 3 X DL1211 I (each) ADC 4 Y 10 5 V/A INPUT V 100 k Ω tg DAC 0 DAC 1 10 × chip carrier V 1 M Ω bg BGVA Brian Standley FOSDEM 2 Feb 2013

  6. A BRIEF DEMO Brian Standley FOSDEM 2 Feb 2013

  7. Implementation Code (v0.91): Language files blank comment code ---------------------------------------------------------------- C 67 2456 1314 9591 C/C++ Header 37 513 747 1263 Python 3 134 40 333 (Linux) libraries: Platforms: • COMEDI • GNU/Linux • Linux-GPIB • Windows XP/7 (via MinGW) • C Python API License: GPL3 • Python interpreter • GTK+ 2 • VTE www.ugcs.caltech.edu/~mezurit2/ Brian Standley FOSDEM 2 Feb 2013

  8. Architecture Interface Terminal: Python Receive Display Plot loop: interpreter input status data Tools: Widgets Widgets systems: Sub- Refresh logic Settings Settings MCF nodes MCF nodes Operation logic RPC nodes RPC nodes Virtual chan. computation Acquisition MCF system Logging Sweep loop: Binning GPIB system loop Scanning Trigger RPC server Status Wrapper DAQ GPIB Timing Varset messaging libraries: COMEDI linux-gpib GTimer glibc NI-DAQ NI-488.2 Perf. count. mscvrt Brian Standley FOSDEM 2 Feb 2013

  9. Architecture GUI DAQ GTK events pending? RPC received? No Yes Yes No Proc. events Type == DAQ? Interface Terminal: No Yes Python Receive Display Plot loop: RPC RPC queued? Queue for GUI Exec. RPC queue No Yes interpreter input status data Exec. RPC Limit rate (~1 kHz) GPIB Limit rate (120 Hz) Scanning? No Yes { X } readout due? n Tools: DAQ Slot update due? No Yes s adc Read ADCs device Yes No Widgets Widgets Copy point Compute { X } Format msg. n systems: Sub- Refresh Refresh Acquired Acquired Moving average Send msg. point point logic GPIB dev. Settings Settings Binning event? Recv. reply Ret. buffer status Yes No GPIB Interp. reply Recorded Plot data Record point slots points MCF nodes MCF nodes Operation Buffer readout due? Limit rate (50 Hz) No Yes logic Triggers armed? RPC nodes RPC nodes Virtual chan. Refresh Yes No T == 1? computation i Yes No Exec. cmds. Acquisition MCF system Logging Sweep Scanning? loop: Binning GPIB Yes No system Sweeping? loop Transfer due? Scanning Trigger Yes No No Yes RPC server DAQ device Read samples Compute { X' p }, { x' p } Sample Store samples Set GPIB slots buffer DAQ Set DACs Status device Scan done? Wrapper Yes No DAQ GPIB Timing Varset messaging libraries: Compute {{ X } n j } COMEDI linux-gpib GTimer glibc Record points NI-DAQ NI-488.2 Perf. count. mscvrt Brian Standley FOSDEM 2 Feb 2013

  10. Configuration system Text-based config files — each line maps to an "MCF node": • String identifier • Data type • Pointer to the setting variable • Callback Config is scriptable through the "set_var" terminal function. Brian Standley FOSDEM 2 Feb 2013

  11. Configuration system GUI thread: rpc_closure(setvar_rpc, 1 'set_var') mcf_closure(setvar_mcf, 'sweep_rate', Text-based config files — Terminal: rate_var, rate_widget) 2 RPC Closures each line maps to an "MCF node": 'get_var' getvar_rpc() while (running) { 'set_var' setvar_rpc() 'save_data' savedata_rpc() • String identifier if (rpc_queued()) { 3 cmd, arg = get_msg() 4 func = rpc_lookup(cmd) • Data type rpc_call(func, arg) } • Pointer to the setting variable 5 MCF Closures } 'sweep_delta' setvar_mcf() + var = delta_var • Callback + widget = delta_widget def setvar_rpc(arg) { 6 'sweep_rate' setvar_mcf() key, value = parse(arg) + var = rate_var func = mcf_lookup(key)) + widget = rate_widget mcf_call(func, value) 'hold_time' setvar_mcf() + var = hold_var } 7 Config is scriptable through the + widget = hold_widget def setvar_mcf(var, widget, "set_var" terminal function. new_value) { DAQ thread: lock(mutex) var = new_value 8 while (running) { unlock(mutex) set_value(widget, new_value) Widgets 10 lock(mutex) } step_sweep(delta_var, rate_var, 12 hold_var) Variables unlock(mutex) 9 delta_var 0.0E+0 11 } rate_var 1.2E+0 hold_var 5.0E-2 Brian Standley FOSDEM 2 Feb 2013

  12. TODO Ongoing work: • GTK+ 3 support • Python 3 support • Realtime operation (PREEMPT_RT, if possible) • Incomplete features here and there • Bug fixes Future work: • More users • >1 developer? Brian Standley FOSDEM 2 Feb 2013

  13. Alternative frameworks Current alternatives: • LabVIEW • Matlab/Simulink • Scilab/Scicos/RTAI-Lab A simpler approach? Brian Standley FOSDEM 2 Feb 2013

  14. Alternative frameworks Current alternatives: • LabVIEW • Matlab/Simulink • Scilab/Scicos/RTAI-Lab A simpler approach? Model Control and User-supplied script User-supplied script definition display GUI (Python): (Python): Instrument libraries Widget libraries Interface library Interface library Realtime General DAQ / control engine layer (C): Drivers Brian Standley FOSDEM 2 Feb 2013

  15. Credits Helpful discussions: Prof. Marc Bockrath (UC Riverside) Prof. Henk Postma (CSU Northridge) Testing: Dr. Hang Zhang, Dr. Wenzhong Bao, Dr. Jairo Velasco Jr., Peng Wang, Tengfei Miao, Oleg Martynov THANKS! www.ugcs.caltech.edu/~mezurit2/ Brian Standley FOSDEM 2 Feb 2013

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend