Seismic Octave Seismic Octave Programming for Programming for
Analog/Digital Analog/Digital ConvertersConverters
Michael W. SiekmanMichael W. SiekmanElectrical and Computer Electrical and Computer EngineeringEngineeringSenior Capstone Design Project Senior Capstone Design Project 20072007Advisor: James HedrickAdvisor: James Hedrick
The ProjectThe Project
Investigate Investigate analog/digital data analog/digital data acquisition (A/D acquisition (A/D DAQ) in the open DAQ) in the open source software source software environmentenvironment
Acquire and display Acquire and display analog inputanalog input
Implement as a Implement as a simple seismographsimple seismograph
Block DiagramBlock Diagram
Computer and Software
Seismic Activity(Input)
Display (Output)
SeismometerSignal
ConditioningA/D Converter
(PCI)
A/D Drivers
Octave Function
The SetupThe Setup
Analog to Digital Analog to Digital Conversion (A/D)Conversion (A/D) ManipulationManipulation DisplayDisplay Necessary in Necessary in
everyday everyday engineering life!engineering life!
Used extensively in Used extensively in PCsPCs
Variety of on-board Variety of on-board card optionscard options
The ProblemThe Problem
MATLAB MATLAB Numerical Numerical
Computing and Computing and ProgrammingProgramming
Powerful Powerful Engineering and Engineering and A/D processing toolA/D processing tool
$$$$$$
The SolutionThe Solution
GNU OctaveGNU Octave Open Source (GNU Open Source (GNU
Project)Project) Uses Linux OS Uses Linux OS
(FC5)(FC5) Same method, Same method,
different packagedifferent package Shell, DIYShell, DIY GNU Supporters GNU Supporters
around the worldaround the world
The PlanThe Plan A/D ConverterA/D Converter
Measurement Measurement Computing PCI-Computing PCI-DAS6035DAS6035
PCI card with Input PCI card with Input BoardBoard
16-bit resolution16-bit resolution Sampling rate of Sampling rate of
200kS/s (200kHz)200kS/s (200kHz) Selectable input Selectable input
voltage range of +/- voltage range of +/- 10V, 5V, 500mV, or 10V, 5V, 500mV, or 50mV50mV
The PlanThe Plan
SeismometerSeismometer PMD Scientific PMD Scientific
PMD103mPMD103m Receives seismic activityReceives seismic activity Output voltage represents Output voltage represents
forceforce Output connected to A/D Output connected to A/D
converterconverter Signal ConditioningSignal Conditioning
Between voltage output Between voltage output to A/D input boardto A/D input board
Terminal boardTerminal board
The PlanThe Plan
Output Output SpecificationsSpecifications 3D output (X,Y,Z)3D output (X,Y,Z) Output voltage swingOutput voltage swing
+/- 10V Single Ended+/- 10V Single Ended +/- 20V differential+/- 20V differential
+/- 5V is typical+/- 5V is typical
Bandwidth range is Bandwidth range is 0.033 – 50 Hz0.033 – 50 Hz
Sampling rate of A/D Sampling rate of A/D allows this w/o aliasingallows this w/o aliasing
Require 9-13V Power Require 9-13V Power
The PlanThe Plan
Seismometer to A/D BoardSeismometer to A/D Board Output of seismometer will not reach Output of seismometer will not reach
+/- 10V swing+/- 10V swing FFss = 2F = 2Fmaxmax
FFss > 2 (50Hz) > 2 (50Hz) FFss > 100 Hz > 100 Hz
16-bit resolution is more than enough16-bit resolution is more than enough 12V power source for Seismometer12V power source for Seismometer
The PlanThe Plan Comedi (Comedi (COCOntrol and ntrol and
MEMEasurement asurement IInterface)nterface) DAQ drivers for LinuxDAQ drivers for Linux Needed to modify in Needed to modify in
order to compile order to compile correctlycorrectly
Previous work in FC3Previous work in FC3 Fedora Core 5Fedora Core 5
Redhat Project variantRedhat Project variant Custom kernel filesCustom kernel files WorkaroundsWorkarounds
The PlanThe Plan Within Octave:Within Octave:
Programming similar to Programming similar to MATLABMATLAB
Develop functions or Develop functions or programsprograms
Interface with A/D Interface with A/D driversdrivers
Done outside of OctaveDone outside of Octave Receive A/D signalReceive A/D signal
Receive 100 samples Receive 100 samples from signalfrom signal
Process A/D signalProcess A/D signal Read voltagesRead voltages
DisplayDisplay Seismometer data plots Seismometer data plots
as seismographas seismograph
The ImplementationThe Implementation
System System ComponentsComponents Hardware Hardware
SeismometerSeismometer Terminal BoardTerminal Board Input BoardInput Board A/D ConverterA/D Converter
SoftwareSoftware A/D Converter A/D Converter
DriversDrivers DAQ Program DAQ Program Octave ProgramOctave Program
The ImplementationThe Implementation HardwareHardware
Layout of seismometer Layout of seismometer outputoutput
Connect to terminal Connect to terminal board including powerboard including power
+/- X value into input +/- X value into input boardboard
A/D ConverterA/D Converter 200 kHz sampling rate 200 kHz sampling rate
covers seismometer covers seismometer bandwidth (50 Hz max), bandwidth (50 Hz max), using 1 kHzusing 1 kHz
+/- 10V selected in +/- 10V selected in differential modedifferential mode
The ImplementationThe Implementation SoftwareSoftware
Linux preparationLinux preparation Problems with kernel source and headers being Problems with kernel source and headers being
correctcorrect Comedi InstallationComedi Installation
Compiled and installed Comedi drivers/libraryCompiled and installed Comedi drivers/library Modification of Comedi configuration and driversModification of Comedi configuration and drivers Insertion/configuration of driver (cb_pcidas64) into Insertion/configuration of driver (cb_pcidas64) into
kernelkernel DAQ programDAQ program
printdataprintdata Written in C with C and Comedi librariesWritten in C with C and Comedi libraries Accesses driver, retrieves a signal and samples it (100 Accesses driver, retrieves a signal and samples it (100
samples), and prints voltages to screensamples), and prints voltages to screen
The ImplementationThe Implementation
Software (cont)Software (cont) Octave program Octave program getwave.mgetwave.m
Accesses Accesses printdataprintdata outputoutput
Data is then Data is then formattedformatted
DisplayedDisplayed Replicates a static Replicates a static
sample of sample of seismographseismograph
The ResultsThe Results ResultsResults
Kernel was configured properly for ComediKernel was configured properly for Comedi Comedi application and libraries successfully Comedi application and libraries successfully
installed to be compatible with FC5installed to be compatible with FC5 A/D converter driver successfully inserted as A/D converter driver successfully inserted as
module into kernelmodule into kernel Testing drivers and Testing drivers and printdataprintdata DAQ program DAQ program
C battery input reads properly as DC at around 1.5vC battery input reads properly as DC at around 1.5v Function generator input reads as proper wave Function generator input reads as proper wave
(tested at both arbitrary sine and square wave)(tested at both arbitrary sine and square wave) printdataprintdata receives a signal from the receives a signal from the
seismometer and prints it properlyseismometer and prints it properly
The ResultsThe Results
Testing Octave program Testing Octave program getwave.mgetwave.m Properly receives data from Properly receives data from printdataprintdata
and displays its output data correctlyand displays its output data correctly 1.5V C battery shows as DC signal at @ 1.5v1.5V C battery shows as DC signal at @ 1.5v Function generator can show proper sine Function generator can show proper sine
wave and square wavewave and square wave Seismometer input is displayedSeismometer input is displayed
The ResultsThe Results
Still to be doneStill to be done Extend period over which 100 samples are taken, Extend period over which 100 samples are taken,
lower the sampling ratelower the sampling rate Need to verify that seismic action is being Need to verify that seismic action is being
properly read by DAQ software and Octaveproperly read by DAQ software and Octave Try dynamically linking Try dynamically linking printdataprintdata program to program to
OctaveOctave Requires translating to C++ and inclusion of Octave Requires translating to C++ and inclusion of Octave
library codelibrary code System can support DLSystem can support DL
User’s ManualUser’s Manual So others don’t have to go through the things that I didSo others don’t have to go through the things that I did
The FutureThe Future
Future work that can be done:Future work that can be done: Read all planes of seismometer outputRead all planes of seismometer output Dynamically linking DAQ program to Dynamically linking DAQ program to
OctaveOctave Creating a continuous stream of seismic Creating a continuous stream of seismic
data from the A/D board and displaying data from the A/D board and displaying it as a real time seismograph it as a real time seismograph Use Comedi functions to provide streaming Use Comedi functions to provide streaming
analog inputanalog input
The PayoffThe Payoff
Multiple Multiple applicationsapplications
Modular functions Modular functions and programsand programs
Access to powerful Access to powerful A/D tools without A/D tools without the heavy pricethe heavy price
Acknowledgments:Acknowledgments:
James HedrickJames Hedrick
Lance SpallholzLance Spallholz
Emad AndarawisEmad Andarawis
Everyone on the Comedi Mailing ListEveryone on the Comedi Mailing List
Thanks!Thanks!
Questions?Questions?