SlideShare a Scribd company logo
1 of 16
Using A Raspberry Pi to Control
Scientific Instruments over LAN and
Instrument Control Consolidation Using
the Scientific Programming Environment
Matlab
Matthew Herndon
Lloyd Bumm Research Group
03/29/2014
Presentation Overview:
•Part One
Control USB interfaced scientific instruments over a Local
Area Network (LAN) using a Raspberry Pi
•Part Two
Create a single, feature-rich interface capable of
controlling many scientific instruments using simple
Matlab code.
•Acknowledgments
Part One
USB over LAN with Raspberry Pi
Controlling USB devices over LAN with a
Raspberry Pi
•It was decided that this communication would be
done using a technique called USB over IP
• This works by encapsulating USB packets
within TCP/IP packets and sending them over a
network to be interpreted by a remote client
• The Raspberry Pi had a program called
VirtualHere USB IP readily available, so I
made use of that
USB over LAN vs. direct USB: Why?
• It’s much more convenient
• Virtually no cable restrictions
USB
Device
Host
Comp.
Server
Comp.
USB
Device
Network
Host
Comp.
USB: Limited to <16
ft without repeaters
Virtually no limit on the
physical distance between
the two devices
USB over IP: The general idea
TCP/IP
Packets
TCP/IP Request
Received Data
TCP/IP Request
Received Data
Write Received Data
Read Incoming Data
ConvertIncomingDatato
TCP/IP,SendtoClient
ConvertTCP/IPpacketsfrom
clientbacktoUSBpackets
WrapdatafromvirtualUSBas
TCP/IP,sendtoserver.
ConvertTCP/IPpacketsfrom
serverbacktoUSBpackets
Write Received Data
Read Incoming Data
Effective
Bridge
Remote
Physical
USB
Device
USB IP
Server
Software
USB IP
Client
Software
Rasbian
OS
Virtual
USB
Device
Windows
OS
Client
Network
Hardware
Pi
Network
Hardware
Raspberry
Pi
Windows
PC
TCP/IP
Packets
The Raspberry Pi Setup
Part Two
Sensor Control Consolidation Using
Matlab
Goals
•Create an interface that allows
one to control a group of
instruments with ease through one
unified interface
•Make this interface handle the
initialization of all of the
instruments, a process which can
often be complicated and easy to
forget
•Make this interface easy to use,
modular, and intuitive
Seen Below: The initialization
code for the Shutter.
Problems to Overcome:
•How to organize the program so as to insure
modularity without compromising an intuitive user
experience
•How to effectively implement it within Matlab
Organization
•This problem was
solved using the
design concepts of
Object Oriented
Programming (OOP),
as seen in the
Unified Modeling
Language (UML)
diagram to the
right.
Class
Name
Class
Variable
s
Methods
Implementation
• UnifiedHandler should only be instantiated once, but
Matlab’s handling of OOP makes this difficult
• Using a Singleton class solved this problem
•Only allows one instance to be created
•Can still be referenced multiple times.
•Easy to use, easy to read
•Example code:
The Final Product
uh=UnifiedHandler(1);
uh.Shutter.open();
uh.FilterWheel.moveToPositionN(3);
% UnifiedHandler instantiation statement
% Variable that holds the instantiated UnifiedHandler object
% Function call that references one of UH’s internal objects
% Function call to a function within an internal instrument
Future efforts
•Improve basic functionality of the UnifiedHandler
class.
• Improve how certain functions in the Shutter class work,
making sure to utilize built in features of the Shutter
controller to insure maximum performance
• Better error handling, more predictable performance
•Make it easier to use client computers by compiling
a list of required software for Shutter, Filter
Wheel, etc.
My fellow group members: Michael Reynolds, Nick Kantack, Mitchell
Yothers, Jacob Higginbotham, for their help and support
More Specifically:
• Dr. Lloyd Bumm, for his assistance in all aspects of my projects
• Nick Kantack, for his work on communicating with the Shutter over USB
• Eric Holbrook, for his work on communicating with the Filter Wheel over
USB
• Mitchel Yothers, for helping me learn Matlab
• VirtualHere Pty. Ltd, for their USBIP software package
• UROP, for their generous grant
• The HERE program, for providing me with this research opportunity
Acknowledgements
Questions?

More Related Content

Viewers also liked

Internal Communication Solution
Internal Communication SolutionInternal Communication Solution
Internal Communication SolutionAlexander Maletin
 
Internal Communication Solution
Internal Communication SolutionInternal Communication Solution
Internal Communication SolutionAlexander Maletin
 
DeskAlerts 8 presentation
DeskAlerts 8 presentationDeskAlerts 8 presentation
DeskAlerts 8 presentationInna Yudina
 
Deskalerts Internal Communication Solution
Deskalerts Internal Communication SolutionDeskalerts Internal Communication Solution
Deskalerts Internal Communication SolutionAlexander Maletin
 

Viewers also liked (6)

Mass notifications
Mass notificationsMass notifications
Mass notifications
 
Internal Communication Solution
Internal Communication SolutionInternal Communication Solution
Internal Communication Solution
 
Internal Communication Solution
Internal Communication SolutionInternal Communication Solution
Internal Communication Solution
 
DeskAlerts 8 presentation
DeskAlerts 8 presentationDeskAlerts 8 presentation
DeskAlerts 8 presentation
 
DA8_presentation
DA8_presentationDA8_presentation
DA8_presentation
 
Deskalerts Internal Communication Solution
Deskalerts Internal Communication SolutionDeskalerts Internal Communication Solution
Deskalerts Internal Communication Solution
 

Similar to Communicating with Scientific (Current)

SOA with PHP and Symfony
SOA with PHP and SymfonySOA with PHP and Symfony
SOA with PHP and SymfonyMichalSchroeder
 
Panther Sniffer for DQMH®.pptx
Panther Sniffer for DQMH®.pptxPanther Sniffer for DQMH®.pptx
Panther Sniffer for DQMH®.pptxEnriqueNo2
 
HiPEAC 2019 Tutorial - Maestro RTOS
HiPEAC 2019 Tutorial - Maestro RTOSHiPEAC 2019 Tutorial - Maestro RTOS
HiPEAC 2019 Tutorial - Maestro RTOSTulipp. Eu
 
Overcoming software development challenges by using an integrated software fr...
Overcoming software development challenges by using an integrated software fr...Overcoming software development challenges by using an integrated software fr...
Overcoming software development challenges by using an integrated software fr...Design World
 
.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologiesprakashk453625
 
object oriented programming examples
object oriented programming examplesobject oriented programming examples
object oriented programming examplesAbdii Rashid
 
Object Oriented Programming I
Object Oriented Programming IObject Oriented Programming I
Object Oriented Programming Iraven_rainagi
 
Docker:- Application Delivery Platform Towards Edge Computing
Docker:- Application Delivery Platform Towards Edge ComputingDocker:- Application Delivery Platform Towards Edge Computing
Docker:- Application Delivery Platform Towards Edge ComputingBukhary Ikhwan Ismail
 
Education using FIRE
Education using FIRE Education using FIRE
Education using FIRE FORGE project
 
Ml goes fruitful
Ml goes fruitfulMl goes fruitful
Ml goes fruitfulPreeti Negi
 
Open MPI SC'15 State of the Union BOF
Open MPI SC'15 State of the Union BOFOpen MPI SC'15 State of the Union BOF
Open MPI SC'15 State of the Union BOFJeff Squyres
 
Testing your applications with mbunit
Testing your applications with mbunitTesting your applications with mbunit
Testing your applications with mbunitBen Hall
 
Application Delivery Platform Towards Edge Computing - Bukhary Ikhwan
Application Delivery Platform Towards Edge Computing - Bukhary IkhwanApplication Delivery Platform Towards Edge Computing - Bukhary Ikhwan
Application Delivery Platform Towards Edge Computing - Bukhary IkhwanOpenNebula Project
 
Reproducibility in artificial intelligence
Reproducibility in artificial intelligenceReproducibility in artificial intelligence
Reproducibility in artificial intelligenceCarlos Toxtli
 
Rate limits and Performance
Rate limits and PerformanceRate limits and Performance
Rate limits and Performancesupergigas
 
Developing a database server: software engineer's view
Developing a database server: software engineer's viewDeveloping a database server: software engineer's view
Developing a database server: software engineer's viewLaurynas Biveinis
 
Python monorepos what, why and how (shared)
Python monorepos  what, why and how (shared)Python monorepos  what, why and how (shared)
Python monorepos what, why and how (shared)benjyw
 
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Adam Dunkels
 

Similar to Communicating with Scientific (Current) (20)

SOA with PHP and Symfony
SOA with PHP and SymfonySOA with PHP and Symfony
SOA with PHP and Symfony
 
Panther Sniffer for DQMH®.pptx
Panther Sniffer for DQMH®.pptxPanther Sniffer for DQMH®.pptx
Panther Sniffer for DQMH®.pptx
 
HiPEAC 2019 Tutorial - Maestro RTOS
HiPEAC 2019 Tutorial - Maestro RTOSHiPEAC 2019 Tutorial - Maestro RTOS
HiPEAC 2019 Tutorial - Maestro RTOS
 
Overcoming software development challenges by using an integrated software fr...
Overcoming software development challenges by using an integrated software fr...Overcoming software development challenges by using an integrated software fr...
Overcoming software development challenges by using an integrated software fr...
 
.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologies
 
object oriented programming examples
object oriented programming examplesobject oriented programming examples
object oriented programming examples
 
Object Oriented Programming I
Object Oriented Programming IObject Oriented Programming I
Object Oriented Programming I
 
Docker:- Application Delivery Platform Towards Edge Computing
Docker:- Application Delivery Platform Towards Edge ComputingDocker:- Application Delivery Platform Towards Edge Computing
Docker:- Application Delivery Platform Towards Edge Computing
 
Education using FIRE
Education using FIRE Education using FIRE
Education using FIRE
 
Mini Project- USB Temperature Logging
Mini Project- USB Temperature LoggingMini Project- USB Temperature Logging
Mini Project- USB Temperature Logging
 
Ml goes fruitful
Ml goes fruitfulMl goes fruitful
Ml goes fruitful
 
First Steps to DevOps
First Steps to DevOpsFirst Steps to DevOps
First Steps to DevOps
 
Open MPI SC'15 State of the Union BOF
Open MPI SC'15 State of the Union BOFOpen MPI SC'15 State of the Union BOF
Open MPI SC'15 State of the Union BOF
 
Testing your applications with mbunit
Testing your applications with mbunitTesting your applications with mbunit
Testing your applications with mbunit
 
Application Delivery Platform Towards Edge Computing - Bukhary Ikhwan
Application Delivery Platform Towards Edge Computing - Bukhary IkhwanApplication Delivery Platform Towards Edge Computing - Bukhary Ikhwan
Application Delivery Platform Towards Edge Computing - Bukhary Ikhwan
 
Reproducibility in artificial intelligence
Reproducibility in artificial intelligenceReproducibility in artificial intelligence
Reproducibility in artificial intelligence
 
Rate limits and Performance
Rate limits and PerformanceRate limits and Performance
Rate limits and Performance
 
Developing a database server: software engineer's view
Developing a database server: software engineer's viewDeveloping a database server: software engineer's view
Developing a database server: software engineer's view
 
Python monorepos what, why and how (shared)
Python monorepos  what, why and how (shared)Python monorepos  what, why and how (shared)
Python monorepos what, why and how (shared)
 
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
 

Communicating with Scientific (Current)

  • 1. Using A Raspberry Pi to Control Scientific Instruments over LAN and Instrument Control Consolidation Using the Scientific Programming Environment Matlab Matthew Herndon Lloyd Bumm Research Group 03/29/2014
  • 2. Presentation Overview: •Part One Control USB interfaced scientific instruments over a Local Area Network (LAN) using a Raspberry Pi •Part Two Create a single, feature-rich interface capable of controlling many scientific instruments using simple Matlab code. •Acknowledgments
  • 3. Part One USB over LAN with Raspberry Pi
  • 4. Controlling USB devices over LAN with a Raspberry Pi •It was decided that this communication would be done using a technique called USB over IP • This works by encapsulating USB packets within TCP/IP packets and sending them over a network to be interpreted by a remote client • The Raspberry Pi had a program called VirtualHere USB IP readily available, so I made use of that
  • 5. USB over LAN vs. direct USB: Why? • It’s much more convenient • Virtually no cable restrictions USB Device Host Comp. Server Comp. USB Device Network Host Comp. USB: Limited to <16 ft without repeaters Virtually no limit on the physical distance between the two devices
  • 6. USB over IP: The general idea TCP/IP Packets TCP/IP Request Received Data TCP/IP Request Received Data Write Received Data Read Incoming Data ConvertIncomingDatato TCP/IP,SendtoClient ConvertTCP/IPpacketsfrom clientbacktoUSBpackets WrapdatafromvirtualUSBas TCP/IP,sendtoserver. ConvertTCP/IPpacketsfrom serverbacktoUSBpackets Write Received Data Read Incoming Data Effective Bridge Remote Physical USB Device USB IP Server Software USB IP Client Software Rasbian OS Virtual USB Device Windows OS Client Network Hardware Pi Network Hardware Raspberry Pi Windows PC TCP/IP Packets
  • 8. Part Two Sensor Control Consolidation Using Matlab
  • 9. Goals •Create an interface that allows one to control a group of instruments with ease through one unified interface •Make this interface handle the initialization of all of the instruments, a process which can often be complicated and easy to forget •Make this interface easy to use, modular, and intuitive Seen Below: The initialization code for the Shutter.
  • 10. Problems to Overcome: •How to organize the program so as to insure modularity without compromising an intuitive user experience •How to effectively implement it within Matlab
  • 11. Organization •This problem was solved using the design concepts of Object Oriented Programming (OOP), as seen in the Unified Modeling Language (UML) diagram to the right. Class Name Class Variable s Methods
  • 12. Implementation • UnifiedHandler should only be instantiated once, but Matlab’s handling of OOP makes this difficult • Using a Singleton class solved this problem •Only allows one instance to be created •Can still be referenced multiple times.
  • 13. •Easy to use, easy to read •Example code: The Final Product uh=UnifiedHandler(1); uh.Shutter.open(); uh.FilterWheel.moveToPositionN(3); % UnifiedHandler instantiation statement % Variable that holds the instantiated UnifiedHandler object % Function call that references one of UH’s internal objects % Function call to a function within an internal instrument
  • 14. Future efforts •Improve basic functionality of the UnifiedHandler class. • Improve how certain functions in the Shutter class work, making sure to utilize built in features of the Shutter controller to insure maximum performance • Better error handling, more predictable performance •Make it easier to use client computers by compiling a list of required software for Shutter, Filter Wheel, etc.
  • 15. My fellow group members: Michael Reynolds, Nick Kantack, Mitchell Yothers, Jacob Higginbotham, for their help and support More Specifically: • Dr. Lloyd Bumm, for his assistance in all aspects of my projects • Nick Kantack, for his work on communicating with the Shutter over USB • Eric Holbrook, for his work on communicating with the Filter Wheel over USB • Mitchel Yothers, for helping me learn Matlab • VirtualHere Pty. Ltd, for their USBIP software package • UROP, for their generous grant • The HERE program, for providing me with this research opportunity Acknowledgements