Wavelet based detection and location of faults in 400kv, 50km Underground Po...
Salamanca_Research_Paper
1. User Modulated Function Generator for Projecting a Pattern via a
Biaxial Wide-field Fast-scanning Mirror
Carlos Salamanca
Department of Electrical and Computer Engineering, Texas A&M University,
College Station, TX 77843
ABSTRACT
The device shown and used in this research is a wide-field fast-scanning optical-resolution
photoacoustics microscopy (OR-PAM), water-immersible microelectromechanical systems (MEMS)
scanning mirror. The scanning mirror oscillates between an angle to deflect photoacoustic waves to create
images. The focus of this study is primarily on the laser beam’s intensity. To test the scanning mirror, a
laser pattern must be simulated. The goal is to create a user defined waveform that will synchronize with
the scanning mirror's oscillation to create a desired pattern. More specifically, it is to create patterns
resembling the Arabic numerical characters: 0, 1, 2... To change the projected pattern the beam’s intensity
function needs to be altered. The arbitrary waveform generator (AWG) provided for this study is an
Agilent 33210A. The AWG can generate a square wave, which is the best waveform to use in this
scenario. It is the best waveform to simulate digital data and to make programming the logic simpler. By
changing the duty cycle of square wave, the pulse-width can be modulated to fit the pattern desired. As
a result of this research a MATLAB application (compatible with an Agilent 33210A) has been created
to generate a user-defined function.
Keywords: MEMS scanning mirror, arbitrary waveform generator, pulse-width modulation
1. Introduction
In the field of laser scanning, scanning mirrors are used for the deflection of visible or invisible beams
of laser [1]. This technology is most commonly found in laser printers. Laser deflection can also be found
in 3D object scanners and laser rangefinders. Although these devices use electromagnetic waves (light),
some scanning mirrors can be used with photoacoustics. They are highly desired for ultrasound and
microscopic imaging [2].
The scanning mirror can scan about two axes. The scanning mirror is based on electromagnetic actuators
that consist of planar coils and permanent magnets [3].
Figure 1. Prototype of an immersible scanning mirror [2]
The device shown and used in this research is a wide-field fast-scanning optical-resolution
2. photoacoustics microscopy (OR-PAM), water-immersible microelectromechanical systems (MEMS)
scanning mirror. The scanning mirror oscillates between an angle to deflect light to create images at the
anatomical, chemical, functional, and metabolic level [4].
Figure 2. Laser-scanning mirror system [2]
The focus of this study is primarily on the laser beam’s intensity. To test the scanning mirror, a laser
pattern must be simulated. The goal is to create a user defined waveform that will synchronize with the
scanning mirror's oscillation to create a desired pattern.
2. Methodology
2.1 Defining the Problem
To simplify the problem further and generalize the solution, the goal is to create patterns resembling the
Arabic numerical characters: 0, 1, 2... and so on. Assuming, that a beam of light is constant, the resulting
pattern would be a “zig-zag” (triangle wave) pattern.
Figure 3. Two-dimensional oscillating pattern results in a zig-zag
Changing the frequency of the light source to half would result in the following pattern.
3. Figure 4. Changing the frequency of the light source changes the pattern.
2.2 Approach
The arbitrary waveform generator (AWG) provided for this study is an Agilent 33210A. The AWG can
generate a variety of waveforms. The waveforms are important because the change in amplitude of the
wave correlates to the change in intensity of the light source.
Figure 5. Agilent 33210AArbitrary Waveform Generator [5]
Figure 6. Common waveforms generated by AWGs.
-By Omegatron/CC BY-SA 3.0
The square waveform is the best waveform to use in this scenario. It is the best waveform to simulate
4. digital data. This is important because it makes programming the logic simpler. The interest lies when
the intensity of the light source is at max (1) or when it is off (0). Therefore, using the square waveform
allows the program to just focus on modulating the frequency, or the pulse-width, of the waveform. This
can be likened to when digital data is encoded into Morse code [6]. In Morse code, there are two widths
in the ON-state: short and long. The program would need to allow the user to change the widths at will.
In a sine wave, the width is defined as the wave length, but in a square wave it can be manipulated by
changing the duty cycle of the wave. The duty cycle is the percentage of one period in which the signal
is in the ON-state [7].
Figure 7. The top signal has a 75% duty cycle and the lower signal has a 25% duty cycle
Changing the pulse-widths on a square wave changes the frequency of the light source thus changing the
pattern that results from the scanning mirror. To determine the desired pulse-widths, the desired pattern
needs to be determined. The question is posed: how will the numeric characters appear based on the
oscillation of the scanning mirror?
Figure 8. Sketch of numeric character on projected area
In figure 8, the black path shows how the beam would travel if it were in the ON-state the entire path.
The red portions are when the beam should be on the ON-state to get the desired character. Because, the
scanning mirror pivots about, two axes, it will have two periods: Tx and Ty. According to the projection
shown in figure 8, the mirror oscillates in the x-direction twelve times for every one oscillation in the y-
direction.
5. Figure 9. Prediction of what the signal should look like
Figure 10. On the second half of the y-oscillation, the pattern is reversed
The horizontal axis corresponds to the period of the oscillation in the x-direction. The vertical axis
corresponds to the amplitude of the signal, 1 (ON) or 0 (OFF). The variable ta is the longer widths and
the tb is the shorter widths. This signal in figure 9 only applies while the scanning mirror is in the first
half of its oscillation in the y-direction. The signal in figure 10 is for the second half.
3. Programming
3.1 Agilent Waveform Editor
Figure 11. Agilent Waveform Editor
6. The AWG that is provided comes with software where a user can define a custom waveform. The problem
with this setup is completely dependent on the user’s input. There would be no way to synchronize the
defined function with the scanning mirror’s oscillation.
3.2 LabVIEW
National Instruments (NI) LabVIEW offers more flexibility with its data acquisition and signal
processing libraries [8]. To get an idea of what a user-defined function would look like, a VI (LabVIEW
code) was taken from the community support on the NI website [9].
Figure 12. This is the block diagram, or the actual programming “code”
Figure 13. This is the user interface, or the inputs and outputs of the program
The VI actually creates one pulse at a time, and then it is stored. When the new pulse is created, the string
of pulses then overwrites what is currently showing on the waveform graph. Although, this program
allows a user to create a defined-square function, it is still clumsy and difficult to use and modify.
3.3 MATLAB
After, some research it was determined that m-file (MATLAB scripts) can be used in LabVIEW. This is
important because MATLAB is better for handling signal generation and LabVIEW is better suited for
7. signal processing [9].
Figure 14. User-Defined Square Wave Generator
The MATLAB script that produced figure 14 allows the user to modulate the width of the pulses
independently from each other. This is what allows varying pulse widths. The script also allows the user
to define the time locations of each pulse. In practicality, the time locations would be synchronized with
the oscillations of the scanning mirror.
3.4 Hybrid Application
To make the time locations of the pulses dependent on time stamps, it would be best to integrate the
MATLAB script into a LabVIEW vi.
Figure 15. Front Panel of Hybrid Application
The front panel shown in figure 15 is the LabVIEW interface for the MATLAB script. The panel allows
a user to control the cycles, period, sample rate, pulse widths, and pulse locations without modifying
the m-script. Although this application gives full control to the user, it does not have any compatibility
8. with the Agilent AWG.
4. Testing and Results
4.1 Agilent Drivers
National Instruments has a program that allows a user to connect to an external instrument via a network
or tether connection. The feature is called NI VISA [10]. NI VISA allows LabVIEW to recognize the
AWG as an instrument capable of receiving and sending data. Agilent also provides LabVIEW libraries
to be able to configure waveform settings.
To test the Agilent drivers, I ran a sample program in the Agilent library to verify that LabVIEW can
communicate with the Agilent AWG. Agilent also comes with its own VISA called Agilent IO. Agilent
IO allowed for universal communication regardless of software.
4.2 Hybrid Application
After the hybrid application was completed, it was tested using NI VISA. The AWG was connected to a
PC with the hybrid application via USB connection. The AWG was then connected to an oscilloscope to
verify the output signal.
Because of LabVIEW’s GUI (graphical user interface), the application allowed the function to be
manipulated. Unfortunately, the AWG was having difficulties reading the inputted function from the
hybrid application.
4.3 Final MATLAB Application
Agilent provided guidance on how to directly integrate the AWG with MATLAB [11]. Through this
finding, the entire LabVIEW aspect of the application was removed. To verify the publication, a sample
waveform was programmed and executed. Because LabVIEW was removed, NI VISA became
ineffective for instrument communication. Finding the recommended MATLAB drivers also became
difficult.
MathWorks provided documentation on communicating with an Agilent instrument using the Agilent IO
VISApackaged with the AWG. With the Agilent VISA, the sample waveform was executed successfully.
After editing the communications part of the m-script, the application was executed and produced figure
16.
Figure 16. Oscilloscope displaying the output of the AWG
9. 5. Conclusions
From the tests conducted, the conclusions has been drawn that a user modulated function can be
generated. Through the application created, the pulse locations can be synchronized with that of
oscillation of the scanning mirror. The program also allows the user to control the amount of varying
pulse widths, the magnitude of the widths, the output voltage, and the individual time locations of each
pulse.
6. Proposed Future Work
Agraphical user interface is not necessary, but is highly recommended to efficiently control the properties
of a function. More importantly, it is necessary to modify the code to be able to synchronize the function
with the oscillation frequency of the scanning mirror. Once the code is modified, the function generator
needs to be tested with the scanning mirror system to determine the necessary function to produce a
desired pattern.
7. Acknowledgments
This research was supported by the National Science Foundation Research Experience for
Undergraduates (REU) program on Interdisciplinary Research on Mechatronics, Robotics, and
Automated System Design (NSF grant no. 1263293). Any opinions, findings, and conclusions or
recommendations expressed in this material are those of the author(s) and do not necessarily reflect the
views of the National Science Foundation. Many thanks go to Dr. Jun Zou for opening the opportunity
to perform research under his supervision and to Song Xu for his direct mentorship throughout the
project.
REFERENCES
[1] G. F. Marshall, “Handbook of Optical and Laser Scanning”, Marcel Dekker, Inc., 2004
[2] C. Huang, J. Yao, L. Wang, and J. Zou, “A water-immersible 2-axis scanning mirror microsystem for
ultrasound and photoacoustic microscopic imaging applications”, Microsyst Technol, 2012
[3] Y. Zhang, G. Ding, X. Sun, and B. Cai, “Design and fabrication of a bistable electromagnetic
microactuator”, Journal of Shanghai University (English Edition), 2006
[4] J. Yao, C. Huang, L. Wang, J. Yang, L, Gao, K. Maslov, J. Zou, and L. Wang, “Wide-field Fast-
scanning Photoacoustic Microscopy Enhanced by a Water-Immersible MEMS Scanning Mirror”
[5] Agilent Technologies, “Agilent 33210A 10 MHz Function/Arbitrary Waveform Generator Data
Sheet”, 2012
[6] D. B. Rutledge, “The Electronics of Radio”, Cambridge University Press, p. 310
[7] J.F. Cox and L. Chartrand, “Nonsinusoidal oscillators”, Fundementals of Linear Electronics:
Integrated and Discrete, 2001
[8] M. Wahlberg, K. Petersen, and I. Eskesen, “Acquiring and Analyzing the Bioacoustic Communication
of Marine Mammals Using NI LabVIEW and USB Data Acquisition”, sine.ni.com
[9] National Instruments, “Working with m-file Scripts in NI LabVIEW for Text-based Signal
Processing, Analysis and Math.”,
ftp://ftp.ni.com/pub/devzone/LV_Online_Eval/daq_ic/mathscript_getting_started.pdf
10. [10] Agilent Technologies, “Tips on using Agilent GPIB Solutions in National Instrument’s LabVIEW
Environment.”, 2009
http://cp.literature.agilent.com/litweb/pdf/5990-3731EN.pdf
[11] Agilent Technologies, “Using MATLAB® in Conjunction with an Arbitrary Waveform Generator
to Create Complex Repetitive Waveforms”, 2009
http://cp.literature.agilent.com/litweb/pdf/5990-3465EN.pdf
[12] MathWorks, “Creating and Downloading an Arbitrary Waveform to a Function Generator”,
http://www.mathworks.com/help/instrument/examples/creating-and-downloading-an-arbitrary-
waveform-to-a-function-generator.html#zmw57dd0e470