Mirrorcle Software Suite User guides for

Mirrorcle Software Suite
User guides for:
MirrorcleDraw – Windows executable software
MirrorcleLinearRaster – Windows executable software
MTIDevice–Test – Windows executable software
MTIDevice–C++ Software Development Kit
MTIDevice–LabView Software Development Kit
MTIDevice–Matlab Software Development Kit
Version and Date:
Ver. 9.4, March 3rd, 2014
Authors:
Abhishek Kasturi
Kenneth Castelino, Ph.D.
Veljko Milanovic, Ph.D.
Andrew Miner, Ph.D.
Mirrorcle Technologies, Inc., Richmond, CA
[email protected]
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
1
System Requirements & Installation: NI DAQ based USB MEMS Controller
(USB-NI)
Software Requirements (depending on the version of the hardware:)
1) Windows XP and Windows 7 are the preferred operating systems.
2) NI-DAQmx drivers 9.x or later must be installed – the DAQmx drivers are provided
along with the DAQ card or can be downloaded from the NI website.
Hardware / Software Setup
1. NI-DAQmx Drivers
Install the DAQmx drivers that come along with the card. Restart the computer if the driver
installation requires it. Once the driver installation is finished, verify that the card is present
by opening the Measurement & Automation Explorer (MAX) from the National Instruments
program group in the Windows Start menu. Sometimes the item in the program group
appears only as “Measurement & Automation.” Open the device list under My
System/Devices and Interfaces/NI-DAQmx Devices, and check that your DAQ card is listed
under „DAQmx devices‟.
2. Mirrorcle Software Suite-NI
Install the Mirrorcle Software Suite (msi) file from the MirrorcleDraw CD on your Windows
PC. This will automatically extract all of the files into default directories already predetermined in the setup file. The install will create a sub folder within MirrorcleTech based
on specific hardware and software versions. In general we recommend that you allow the
executable extractor to place the files in the pre-determined (default) directories. This will
automatically create the files in:
C:\\MirrorcleTech\
Program Operation:
An executable file is provided for output via the USB MEMS Controller: MirrorcleDraw-NI.exe
In addition to the windows executable MirrorcleDraw, two other executable files are included
with the CD: MTIDevice-Test-NI.exe and MirrorcleLinearRaster-NI.exe.
MTIDevice-Test-NI.exe runs a very simple example of C code that was created using the
included MTIDevice-C++ Software Development Kit (described in this document.) The source
files for this example are all included in the MTIDevice-Cpp directory and should allow a
programming-skilled user to quickly develop new applications that use the MirrorcleTech
devices.
MirrorcleLinearRaster-NI.exe is a simple user interface (UI) for preparing and running raster
scans with uniformly spaced lines and with uniform scanning velocity. The user chooses number
of lines, pixels per line, line duration, point-to-point or uniform-velocity motion, and other
parameters and runs single or continuous raster scans with the MEMS mirror. Lines can have
any, user-controlled angle. The application controls MEMS mirror x-axis and y-axis, and also
provides synchronized digital output to a laser driver or other user peripherals.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
2
System Requirements & Installation: MTI USB MEMS Controller (USB-SL)
Software Requirements (depending on the version of the hardware:)
Windows XP and Windows 7 are the preferred operating systems.
Hardware / Software Setup
Mirrorcle Software Suite-SL
Install the Mirrorcle Software Suite (msi) file from the MirrorcleDraw CD on your Windows PC.
This will automatically extract all of the files into default directories already pre-determined in
the setup file. The install will create a sub folder within MirrorcleTech based on specific
hardware and software versions. In general we recommend that you allow the executable
extractor to place the files in the pre-determined (default) directories. This will automatically
create the files in:
C:\MirrorcleTech\
Program Operation:
An executable file is provided for output via the USB MEMS Controller: MirrorcleDraw-SL.exe
In addition to the windows executable MirrorcleDraw, two other executable files are included
with the CD: MTIDevice-Test-SL.exe and MirrorcleLinearRaster-SL.exe.
MTIDevice-Test-SL.exe runs a very simple example of C code that was created using the
included MTIDevice-C++ Software Development Kit (described in this document.) The source
files for this example are all included in the MTIDevice-Cpp directory and should allow a
programming-skilled user to quickly develop new applications that use the MirrorcleTech
devices.
MirrorcleLinearRaster-SL.exe is a simple user interface (UI) for preparing and running raster
scans with uniformly spaced lines and with uniform scanning velocity. The user chooses number
of lines, pixels per line, line duration, point-to-point or uniform-velocity motion, and other
parameters and runs single or continuous raster scans with the MEMS mirror. Lines can have
any, user-controlled angle. The application controls MEMS mirror x-axis and y-axis, and also
provides synchronized digital output to a laser driver or other user peripherals.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
3
Mirrorcle Software Suite
Introduction
The Mirrorcle Software Suite enables the user to perform Mirrorcle Technologies MEMS device
verification, implement application demonstrations and it features software development
capabilities. There are multiple Windows-based executables which give you access and control
of all of the mirrors' various modes of operation - point-to-point beam steering, line-by-line
uniform velocity rastering, vector graphics at various refresh rates, bitmap image laser displaying
or laser marking, one-axis-resonating, and Lissajous patterns. The main executable
"MirrorcleDraw" provides a graphical user interface with all of the above-mentioned modes and
options. The program further allows users to study a device's step response, resonant frequency
of each axis, response with the use of various types of filters, device look up tables, etc. There
are several examples of laser display capabilities based on vector graphics drawings, laser
display of text with various fonts, and animations. Features also include the capability to load
waveforms (import data from a text file) to direct the MEMS mirror to user-controlled positions,
as well as the capability to load standard, ILDA-specification vector files. Another executable,
"MirrorcleLinearRaster" is focused on user-controlled raster scan patterns with uniform scan
velocity and linear line spacing or point-to-point type of rasters etc. It is designed to be a helpful
tool in the development of biomedical imaging, 3D scanning, and similar applications. There are
also source codes and examples in the SDKs in C++, Matlab, and LabView. The Development
Kit includes 6 hours of software support, which is most often used to develop customer-specific
examples of scans, etc.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
4
Settings Files:
Windows-executable version of the software for USB MEMS Controller interface includes an
ASCII text settings file which is located in the same “exe” directory as the executables. File
name is:
Mtidevice.ini
These files contain important settings that are required by the programs to run properly. The
settings are purposely placed into these ini files so that they can be responsibly modified by an
advanced user of the kit. The values that are entered into the settings will directly affect the
voltages that are applied to the device and can therefore easily damage a device if improperly
entered. Please make sure that you enter proper values and verify the system operation
(oscilloscope, volt-meter) before operating devices. There are six settings available in the
mtidevice.ini file, but only the first two settings can be modified by the user:
VmaxDevice
HwFilterBw
(float) This is the value of voltage which will be maximum allowed voltage during
software operation. It is recommended to keep this value at the maximum voltage for a
specific device to minimize risk of exceeding that voltage during operation. Default is
125. Maximum possible value is 140V, limited by hardware design.
Warning: The maximum voltage value should be less than or equal to the maximum
allowed voltage published with the specific device‟s datasheet. Values higher than
maximum allowed for a specific device can cause erroneous behavior or device damage.
(int) This value is the bandwidth for the hardware filters on board USB MEMS Controller
Card. The value should be set according to the recommended filter setting on the
datasheet of each individual MEMS device. This ensures device safety when using the
MTISerialDevice-Test.exe where the user cannot set the filter settings. MirrorcleDraw
starts up with the default BW setting inside the settings text file, and can be changed as
needed by the user.
Warning: The filter cut-off frequency should not significantly exceed the recommended
filter published with the specific device‟s datasheet. Values significantly higher than the
recommended filter value can cause ringing, larger angle overshoot, and device damage.
WARNING: Any other settings should only be modified after consulting MirrorcleTech support.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
5
MirrorcleDraw (Windows executable)
Introduction
MirrorcleDraw is a comprehensive software for the use in controlling two axes (tip and tilt) of a
MEMS mirror in a laser-beam steering system so as to deflect the laser beam in a desired angle
or direction. Because Mirrorcle Technologies MEMS mirrors offer the ability to deflect optical
beams in point to point (quasi-static) mode, vector mode, resonant, and various mixed modes,
therefore the MirrorcleDraw software offers a wide variety of ways to generate and condition
command voltages for those devices. The role of the extensive graphical user interface is to
allow the user to control a lot of parameters in generating desired commands and therefore
desired beam deflection, as well as in generating synchronous laser driving output or digital
commands to external systems.
For laser beams that are terminated on a flat screen or a wall, this system will create “drawings”
which can be static or animated. The general operation of the program is to take inputs from a
user in terms of the desired pattern that the laser beam is supposed to follow, the refresh rate
which determines the speed at which the laser will trace (and repeat) that pattern and other
optional inputs. The program then computes the necessary sequences of voltage commands
(waveforms) for each axis to achieve that result and sends them to the user‟s desired output port
of the computer. In addition it sends a third waveform of digital numbers (byte per sample)
which is for commanding a laser or camera or other devices user may want to synchronize to the
movement of the MEMS mirror. The targeted device will then output two analog voltage
waveforms as well as a digital stream synchronized to the voltage waveforms, representing the
user‟s desired sequence of positions and corresponding laser brightness or on/off commands.
Read the Installation and Setup section of this manual to determine if all requirements of the
program and overall system are met properly. For a more technical discussion on the operating
principles and applications of MEMS mirrors, please visit the Mirrorcle Technologies website.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
6
Global Controls:
1) Max Voltage: The slider bar limits the maximum voltage sent to the device. This is a
parameter that scales all created analog waveforms. Warning: The maximum voltage value
should be less than or equal to the maximum allowed voltage published with the specific
device‟s datasheet. Values higher than maximum allowed for a specific device can cause
erroneous behavior or device damage.
2) Sample Rate: For the USB MEMS Controllers, the maximum rate is 50000 samples per
second (“sps”). The program automatically sets default sampling rates in various modes, but the
user can alter that rate in the range of 1000 to 50000 sps. Higher sampling rates are useful with
data that has a lot of high frequency content (e.g. Vector Graphics mode with imported ILDA
files function, or Vector Graphics mode with Scan Patterns function of Image type), but require
more computation time and USB communication time. Therefore in simple waveforms (e.g.
Signal Generator mode) it is useful to use smaller sps settings.
3) Refresh Rate: This slider sets the effective refresh rate of the drawing. This is the number of
times that the complete drawing or waveform in that mode will be repeated each 1s of time. For
a given sampling rate (sps), as the refresh rate is increased, the number of points per frame drops
resulting in greater loss of spatial information in the drawing depending on its complexity. Very
high refresh rates therefore require higher sps settings and higher filter bandwidth which is of
course appropriate only for faster MEMS mirror devices.
4) Retrace Path: The user can choose to either retrace a path or go directly from the last point to
the first. Retracing results cannot handle complex forms but is smoother.
5) Filter Settings: USB MEMS Controller hardware includes on-board filters for each analog
output channel. The filter cut-off frequency is controlled by the cutoff frequency, entered in the
“Cutoff” setting. Minimum allowable value is 100Hz and maximum value is 10,000Hz.
Warning: The filter cut-off frequency should not significantly exceed the recommended filter
published with the specific device‟s datasheet.
Values significantly higher than the
recommended filter value can cause ringing, larger angle overshoot, and device damage.
The waveforms generated in the software are generally not filtered before being downloaded to
the USB MEMS Controller hardware when the filter type setting is “Hardware”. However, a
software-filtered copy of the waveforms is generated in the software only for the purposes of
displaying to the user the likely filtered analog output. NOTE: The displayed waveform in
MirrorcleDraw is an approximation of a digital filter done by the software, whereas the actual
USB MEMS Controller output is from the onboard analog Bessel filters. The filtered waveform
is displayed as a red curve and is changed to reflect any changes in inputs or filter settings.
Another option for the user is to use the various software filters available in the MirrorcleDraw
executable. The user must first set the “Hardware” filters to the maximum, 10000Hz, so that
hardware Bessel filters will not affect the software filtered waveforms. After setting the
“Hardware” filters, the user can click on the dropdown menu under Filter Type and select one of
the following software filters: Bessel, Butterworth, Chebyshev, Elliptic and Legendre. Once the
filter type is selected, the user can set the cut-off frequency and the poles for the low-pass filter.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
7
6) Enable Amp: This switch toggles the HV Amp on/off using a digital line – toggling it ON turn
on the amplifier‟s high voltage supply, which biases the MEMS device and enables driving at
full angles. The toggle should be off whenever any hardware changes or tests are being
performed, and especially prior to removing a MEMS device from the circuit or socket or
placing another MEMS device into the socket.
7) X–Offset / Y–Offset: These numbers are to offset the scan from the center. When a user
imports a sample or keypoints file, the offset numbers can be used to position the imported
waveform at any desired location within the field of view of the device‟s maximum angle.
8) Export: The export button exports the waveform displayed in the MirrorcleDraw GUI to a
notepad file with a list of X, Y samples and laser modulation into a samples file (.smp) and a
keypoints file (.kmp). The exported samples file or keypoints file can be imported using the
example shown in MTIDevice-Test.exe or can be plotted in Matlab, etc. The files are exported
into the “exe” installation sub-folder and the name includes a random generated number to
prevent overwriting of exported files. Note that in some cases the installed folders may be write
protected by default after installation, and may prevent the use of “export” features of the
software. If necessary, the user may alter the installation path to outside of Program Files
folders.
MirrorcleDraw GUI
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
8
Program Modes
The program has a number of different modes which can be selected using the drop-down list at
the top left corner of the GUI.
Sketching Mode:
There are two separate sketching programs in this mode:
1) Freehand: You can draw a shape by clicking the left mouse button and dragging to trace out
the curve. Releasing the mouse button terminates the curve segment. The user can draw
multiple disconnected curve segments in this fashion and the blanking information is
automatically computed. Right clicking closes the sketch by connecting the first and last
points. To clear the sketch, press the reset button. The pattern is displayed on the screen by
the mirror and the stream can be stopped or restarted using the start/stop button.
2) Polyline: This mode can be used to draw polygons that are open or closed. Clicking with the
left mouse button adds points to the existing polygon. Keeping the left mouse button pressed
and moving the mouse can be used to dynamically place the new point. Releasing the left
button confirms the addition of the point. In order to close a polygon, click the right mouse
button, which joins the first and last points. It is also possible to modify the existing polygon.
Click the left mouse button on the point you want to move and drag the mouse to move the
point to its new location. Right clicking in the vicinity of the point will delete the point.
Deleting the first/last points of a closed polygon results in opening of the polygon.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
9
3) Projection Xfm: This mode is currently under development and is not enabled.
4) Coordinates : This mode displays the coordinates (X,Y) of the location the MEMS device is
pointing at (e.g. 50, 50 for center). The coordinate system starts with the lower left corner
being 0,0, and increases to the upper right corner of 100, 100. Clicking with the left mouse
button in the drawing area updates the coordinates to the new location. Keeping the left
mouse button pressed and moving the mouse can be used to dynamically update the
coordinates.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
10
Vector Graphics Mode:
This mode demonstrates different types of mathematical curves, animations and some sample
vector text. Clicking the mouse anywhere in the drawing area moves the center of the generated
object to that location. This applies to all sub-modes and is useful for translating objects.
1) Waveforms: This function is used to draw simple waveforms such as sine, triangle and
square. The user can choose the number of cycles displayed and the amplitude of the
waveform. For the sawtooth and square waveforms, the duty cycle can also be adjusted. A
useful exercise in this mode is to check the step response of the device and the effect of
various filter parameters. In order to do this, select the square waveform with a single cycle
and choose between the Butterworth, Bessel, and Inverse Square filters and check out the
response of the device. Finally, there is also a spiral option, which traces out a right-angled
spiral with variable number of loops and is useful for checking the fidelity of the filters in
tracing sharp corners. These figures can be rotated by choosing the rotate option in the
animation menu at the bottom. The animation time slider can be used to fix the total time for
one cycle of the animation. Normally an animation time of 1-2 sec gives visually pleasing
results. Increasing the animation time slows the rotations but takes longer to compute. Once
the animation frames are computed, the program loops the animation infinitely.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
11
2) Spirographs: These patterns are formed by tracing the paths of points on a circle as it
revolves around another circle. Depending on the relative radii of the circles and the position
of the point, different curves are obtained. The program allows the user to choose between
epitrochoids, hypotrochoids, epicycloids, and hypocycloids. The user can specify the
parameters A, B, C that determine the shape of the curves and the size of the drawing. In this
mode it is possible to have two main types of animations: in the first case, the entire curve is
rotated at the rate specified by the animation time slider. The second animation option allows
the user to cycle through different values of A, B, or C giving rise to a sequence of curves.
The program calculates sweeps the chosen parameter (A/B/C) from the current setting
through 6 values. Another curve is the rose family, which generates a set of roses with npetals. The curve family can be generated by varying two parameters A & B. For B=1, a rose
with n=A petals is obtained for odd A and 2A petals for even A. Changing B gives rise to
more intricate and complicated patterns. The user can also obtain rotating animations by
choosing the rotate animation option. Some sample screenshots and suggested parameter
values are shown below.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
12
3) Lissajous: Lissajous patterns are generated by using a set of basis waveforms (sinusoidal /
sawtooth) on the X and Y axes and are commonly seen on oscilloscopes. Changing the
relative frequencies on either axis gives rise to a whole array of patterns. In addition to the
frequency, it is also possible to change the phase and amplitude of the signal on either axis. A
more complicated set of patterns is obtained by allowing modulation of the waveform on
either or both axes. The user can select amplitude or frequency modulation for each axis and
also the type of waveform used for modulation. The modulation index, which is a measure of
the strength of frequency modulation, can be chosen by the user. As the modulation index is
increased, the curve starts to get more complicated and deviates from its non modulated
version. The user can choose to animate rotation of the entire curve as in previous modes or
animate the X-Y phase lag. The phase lag animation sweeps the phase through 360 o,
resulting in an appearance of rotation of the curve about its long axis. Similarly, the
modulation phase, which is the phase angle between the base and modulation signals can be
swept to generate another type of animation. Finally, the modulation ratio can also be swept
in order to see the effect of increasing modulation strengths on the base signal.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
13
4) Import File (ILDA Keypoint or ILDA Sample): The International Laser Display
Association (ILDA) has a standard file format for laser graphics that is used in many laser
show design software. The ILD file format is a binary format and can contain multiple
frames that are part of an animation sequence. A number of sample ILDA files are included
with the program. To load a new ILDA file, press the import file button and choose the file
from the file dialog box. Under File Type, the user can select ILDA Keypoint or ILDA
Sample depending on the type of ILDA file being imported. ILDA Sample is recommended
if the ILDA file being imported needs to be matched to a specific sample rate. The program
parses the file to extract all the frame information and displays the total number of frames.
The user can display a single static frame by using the frame number slider control.
Alternatively, it is possible to run all the frames as part of an animation by setting the
animation type to Slideshow. As in previous modes, it is possible to create a rotation
animation of a single frame by choosing the Rotate mode as the animation type. The
animation time determines the time to display all the frames. If the time is too short, each
frame will have few points resulting in loss of detail or smoothing applied by the filters. The
other factor in displaying animations is the refresh rate. Too high refresh rates again decrease
the number of points available per frame leading to loss of details. Hence it is important to
keep a sufficiently large animation time and low enough refresh rate for best results. Finally,
each frame can be rotated in 3D by choosing the camera theta (angle with +X axis) and phi
(angle from XY plane). This can lead to cool effects in viewing frames containing 3D
objects. A good starting file is cangoose.ild. Load the file and select Slideshow animation
and set animation time to 2 sec. To make the bird fly faster, decrease animation time to 1s,
0.25 sec in steps.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
14
Import File (User Sample): Another option is to import XYM sample data-points in a text file
with extension .smp. This option is selected as User Sample under the File Type menu. Each
line in the file represents a sample to be sent in sequence to the DACs, and will be output at the
DACs at the “Sample Rate (sps)” set in the GUI. Therefore the refresh rate setting will not affect
the output in this mode as the list of samples is read directly to the DACs in an infinite loop with
no post-processing, interpolation, or filtering. The hardware filters are still applied after the DAC
outputs, before the high voltage amplifier. A sample file, raster_vertical.smp is included in the
exe directory of the software installation. Valid sample files must have three space-delimited
columns and each valid line must terminate with an EOL (“\n”) character. The .smp file can also
have the sample rate as the first line of the file (e.g. 50000), and this number is read during the
User Sample Import File function. This is optional, and if there is no sample rate number on the
first line, then the function uses the default value in the SPS box in the GUI.
The first column represents sample values for the X-axis, the 2nd column for the Y-axis. All
coordinates should be normalized to -1 to +1 and are imported as floating point numbers. Inside
the program the normalized data for X and Y is scaled with the Max Voltage setting in the GUI.
The third, or the “M” column is unsigned 8-bit digital data from 0 to 255 which appears on the
systems digital output port synchronously with MEMS voltages in the first two columns. These
are often used for triggering various accessories or instruments in sync with MEMS mirror
movement, e.g. lasers, timers, cameras, etc. As an example, in this mode of use where the
numbers are used as triggers, if a user wishes to trigger a camera which is connected on line 3 of
the port, the M number will be 8. Or if two devices are to be triggered, connected to lines 5 and
1, M number will be 33.
In the mode where the system is used with an analog-modulation laser driver, the values 0 to 255
will represent laser brightness and therefore small values and zero will practically turn the laser
off during those specific samples, while high values will render bright pixels for their respective
samples. The numbers in the third column may be written as floating point or integers but the
system will interpret them as unsigned integers and only force values to the range of 0 to 255.
0.51231
0.51163
0.51035
0.50975
0.85026
0.85054
0.85114
0.85144
255.00000
200.00000
0.00000
0.00000
An example list of a few sample points
WARNING: A list of samples must be carefully designed in order to give desired MEMS mirror
movement results and avoid device damage. Samples are read line by line and sent to the output
DAC without interpolation and processing and therefore it is the task of the designer of the list to
ensure that it is well-formed. If there are any significant steps (position changes) from sample to
sample, they will result in large oscillations of the MEMS device and possibly damage.
Therefore, smooth transitions (e.g. by spline function or software filtering) should be used. The
end of the list should bring the device back to the same or very near the same co-ordinates as
those at the beginning of the list since the output system will repeatedly refresh and read the list
from the beginning to end. Therefore a step function must be avoided from the last to first
sample. The proper forming of such sample files is best demonstrated in the software
development examples (SDK folders), both in C++ and in Matlab, where several steps are
utilized to ensure smooth transitions: returning the trajectory onto itself (ideally at device origin
at each beginning and end,) trapezoidal interpolation between desired locations and finally
additional smoothening by software filtering.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
15
Import File (User Keypoint): The third option is to import a list of XYM keypoints in a text
file, with the extension .kpt. This option is selected as User Keypoint under the File Type menu.
Each line in this file represents a keypoint, and is processed with the sps settings in the GUI,
interpolated and filtered before being outputted to the DACs. A Keypoints file can be applied
with different refresh rate settings. Valid sample files must have three space-delimited columns
and each valid line must terminate with an EOL (“\n”) character. An example of the keypoints
file, openbox.kpt is included in the exe directory of the software installation. The first column
represents values for the X-axis, the 2nd column for the Y-axis. All coordinates should be
normalized to -1 to +1 for 4-Quadrant devices. Inside the program the normalized data for X and
Y is scaled with the Max Voltage setting in the GUI. The third column is unsigned 8-bit digital
data from 0 to 255 which appears on the systems digital output port synchronously with MEMS
voltages in the first two columns. In the mode where the system is used with a laser driver, the
values 0 to 255 will represent laser brightness and therefore small values and zero will
practically turn the laser off during those specific samples, while high values will render bright
pixels for their respective samples. The numbers in the third column may be written as floating
point or integers but the system will interpret them as unsigned integers and only force values to
the range of 0 to 255. Because this import file option is for vector keypoints and not actual
samples, the user does not have complete control of the output samples on X, Y, or the M
channel. The Mirrorcledraw software will appropriately interpolate from one keypoint to the
next to optimize mirror movement, and will copy the same M number to all samples between
two keypoints.
0.25
0.25
0.75
0.75
0.25
0.75
0.75
0.25
255
255
255
255
The example of the keypoints file, openbox.kpt
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
16
5) Text: This mode allows the user to enter a text string and uses either a vector or TrueType
font in order to display the text. We use the Hershey font set, which contains a list of 22
English fonts and a variety of Oriental characters for vector text and standard TrueType
fonts. There is also a character display mode which can be used to display mathematical
symbols, ASCII characters, Kanji characters and various other symbols defined in the
Hershey database. The user can select the character ID for the particular type of font and the
program displays the font. If the text string is too long, it is possible to scroll the text across.
In order to scroll the text string, check the Marquee checkbox. Note that it can take a long
time to compute the marquee waveform.
It is also possible to display TrueType fonts. The TTF Font button can be used to select any
TTF font currently installed on your computer. The user can also choose whether characters
will be Bold, Italics and the Encoding system used (Western European, Cyrillic, Central
European etc.). This mode utilizes Windows GDI functions in order to get vectorized a string
or character in any system font and displays the vectorized text. Currently, the program does
not support Unicode text but it is possible to input various non-ascii symbols for Oriental and
other fonts by using „Alt-xxxx‟ where xxxx is the Unicode ID for the particular character in
the chosen font (e.g. Choose the MS Mincho Font and Japanese Encoding in the TTF Font
dialog and enter Alt-0211 in the text to display a certain Hiragana character – try out
different codes or use the Windows Character Map utility to find the code for a particular
character).
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
17
6) Scan Patterns: This mode allows the user to generate different scan patterns: Raster, Spiral,
Lissajous and Image. The Raster scan pattern creates a line at a steady rate along the
horizontal axis, and is repeated as the line scan is moved along the vertical axis. The user can
control the amplitude, the number of lines for this scan and, the angle of the raster scan. The
Spiral scan creates a spiral pattern starting at the center, spiraling outwards and returns back
to the center by retracing its path. The user can control the amplitude and the number of
loops in the spiral. Lissajous pattern allows the user to create various Lissajous patterns by
controlling the frequencies of X and Y axis, and amplitude of the pattern. Image scan lets the
user import an image (.jpg) file and display it either as a black and white, or a Grayscale
image. The displayed resolution of the image is adjusted by the number of lines used in the
raster scan to create the image.
7) Clock: This mode creates a vector graphic drawing of the current time in 24 hour format,
updated every second. There are two display modes: a digital clock with HH:MM:SS format,
and an analog clock with the hour, minute and seconds hand. With a fast refresh rate (e.g.
>15 Hz) and a fast MEMS mirror this results in a projected vector display of current PC time.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
18
Function Generator:
This mode uses the USB MEMS Controller as an analog output to directly send synthesized
waveforms to the mirror. Unlike in the curve plotter mode, there is no modulation scheme used
to transmit the signal to the mirror. Hence this mode must be used carefully since it is possible to
excite the resonant frequencies of the device and damage it.
1) Waveforms: This mode can be used to send a set of signal waveforms on either or both
channels. The user can choose between DC, sinusoidal, sawtooth, or noise waveforms. The
DC mode allows the user to input any voltage level to either axis. For the sinusoidal and
sawtooth waveforms, the user can choose the frequency and this can be used to find the
resonant frequency of the device. This is simply done by choosing sine waves of different
frequencies and observing the mirrors deflection peak at the resonant frequency, which
should be visibly obvious. It is safest to keep the voltage level low since the devices have
high Q and can be damaged by exciting them resonantly with excess voltage. The resonant
frequency can then be used to refine the system parameters used to calculate the Inverse
Square filter. Q values from 10-100 are reasonable. Another point to note is that the actual
resonant frequency is twice the value on the slider since the mirror responds to the square of
the voltage waveform. The noise waveform is useful for checking if the devices are
functional and can occasionally be used to revive devices that may be stuck or crashed.
2) Lissajous: This is similar to the function in the curve plotter mode but there is no modulation
used in this case. The user can directly choose the base and modulation frequencies on both
axes and the types of waveforms desired. Here, it is relatively simple to obtain animations by
offsetting one of the X/Y frequencies by 1-2 Hz (e.g. 201/200 Hz). Another interesting set of
animations is obtained near resonance. Make both X, Y base frequencies near resonance so
that a large mirror amplitude is obtained. Now change the modulation frequencies to greater
than 30-35 Hz so that persistence of vision gives rise to an intricate set of animations.
Changing the modulation frequency to a non-integer number slows the animation and also
gives more aesthetic patterns. It is possible to get a virtually limitless set of patterns using the
four sets of frequency parameters.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
19
MirrorcleLinearRaster (Executable)
Introduction
MirrorcleLinearRaster is an executable software with a simple user interface (UI) for preparing
and running raster scans with uniformly spaced lines and with uniform scanning velocity. User
chooses number of lines, pixels per line, line duration, point-to-point or uniform-velocity motion,
and other parameters and runs single or continuous raster scans with the MEMS mirror. Lines
can have any user-controlled angle, i.e. horizontal, vertical, or any in-between angle rasters are
possible. Program controls MEMS mirror X- and Y-axis, and also provides synchronized digital
output to laser driver or other user peripherals.
Global Settings
1: Set number of lines (2-1000): Allows the user to set the total number of lines for the scan.
Note: if the number of lines * number of pixels exceeds a maximum available number of points
for the system, the system will notify and reject the settings.
2: Set number of pixels along the line (2-1000): Allows the user to set the number of pixels per
line.
Note: if the number of lines * number of pixels exceeds a maximum available number of points
for the system, the system will notify and reject the settings.
3: Set angle of lines (0-360, 0 = vertical): Allows the user to rotate the raster scan clockwise, at
any desired angle. It is an integer input and therefore the angle can be rotated in increments of 1.
4: Set duration of one line: Allows the user to set the time duration of one line during the raster
scan. The time applies only to the „active scan“ portion of the line, after the initial acceleration
from the edge of the scan field, and before the decelleration at the other edge of the scan field.
The input is in seconds, and the input accepts floating point numbers.
5: Allow bi-directional writing on fast axis: This option toggles between bi-directional writing
being on (1) and off (0). The default value is on (1).
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
20
6: Set the filter cut-off frequency (Hz): The filter cut-off frequency is controlled by this setting.
USB MEMS Controller hardware includes on-board filters for each analog output channel.
Minimum allowable value is 50Hz and maximum value is 5000Hz. Warning: The filter cut-off
frequency should not significantly exceed the recommended filter published with the specific
device‟s datasheet. Values significantly higher than the recommended filter value can cause
ringing, larger angle overshoot, and device damage.
7: Start continous running: Pressing 7 brings up all available devices for the raster scan to be
downloaded to. After the user selects which target to use, the software downloads and begins the
raster scan after any of hte global settings have been changed. After the scan has started, pressing
any key will stop and allow the user to return to the main menu.
8: Start a single raster: Pressing 8 brings up all available devices for the raster scan to be
downloaded to. After the user selects which target to use, the software downloads and will
execute a single raster scan. After the scan has finished, pressing any key will stop and allow the
user to return to the main menu.
x: Set the X axis amplitude (0-1): This is a parameter that scales the created X axis analog
waveform between a value of 0.00 and 1.00. The input value is a floating point number.
Warning: The maximum voltage value should be less than or equal to the maximum allowed
voltage published with the specific device‟s datasheet. Values higher than maximum allowed for
a specific device can cause erroneous behavior or device damage.
y: Set the Y axis amplitude (0-1): This is a parameter that scales the created Y axis analog
waveform between a value of 0.00 and 1.00. The input value is a floating point number.
Warning: The maximum voltage value should be less than or equal to the maximum allowed
voltage published with the specific device‟s datasheet. Values higher than maximum allowed for
a specific device can cause erroneous behavior or device damage.
t: Toggle between linear raster (0) and point to point raster (1): This parameter allows the user to
switch between a linear raster scan and point to point raster scan. The linear raster scan has the
MEMS mirror scan the individual lines with constant velocity, with acceleration and deceleration
at the turn around portions. The point to point raster scan drives the MEMS mirror to each pixel
in a line, decelerating to each pixel point, and accelerating after each pixel point in a line.
e: Toggle to allow export of waveform to file (1) or no export (0): This parameters allows the
user to set to have the linear raster scan waveform with the current settings be exported into a
textfile when enabled. The text file contains a list of X and Y sample points, and modulation
data.
+, -: Control delay of pulses (+ Increase, - Decrease): This parameter rotates the synchronized
digital outputs to adjust for delay. The software is already calibrated to adjust for the delay from
the hardware, low pass Bessel filters, but this feature allows the user to adjust the delay to
synchronize with other peripherals, such as lasers, cameras, etc.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
21
Software Development Kit (SDK) – C++
This is effectively the Software Development Kit (SDK) of Mirrorcle Serial Software Suite that
allows users to develop their own applications using C++ DLLs: This interface provides a library
with wrapper classes for the entire process starting with content generation, content conditioning
and manipulation (filtering, scaling, interpolation, etc.), content downloading to a selected target
device, and control of that target device including control of its integrated hardware filters.
An example Visual C++ project is provided to illustrate the use of the library classes.
MirrorcleTech‟s API includes a class focused on data generation and signal conditioning,
MTIDataGenerator, with the corresponding header, library, and DLL files:
MTIDataGeneratorAPI.h, MTIDataGenerator.lib, and MTIDataGenerator.dll
Further, the API includes a class focused on interfacing with the target. For users with the MTI
USB MEMS Controller, the interfacing class is MTIDeviceSerial, with the corresponding
header, library, and DLL files: MTIDeviceAPI.h, MTIDeviceSerial.lib, and MTIDeviceSerial.dll
For users with a NI-DAQ USB MEMS Controller, the interfacing class is MTIDeviceNidaq,
with the corresponding header, library and DLL files: MTIDeviceAPI.h, MTIDeviceNidaq.lib
and MTIDeviceNidaq.dll
For users with Visual Studio C++ 2010 version or newer, there is an example code which utilizes
the provided libraries and functions. This example allows the user to output 2 analog channels
and digital channels (laser modulation) to the USB MEMS Controller-based development kit.
Users can easily modify the C++ code and rebuild new executables. Note that when a new exe
file is built by Visual Studio, it will be created in the “Debug” directory, and should be moved
into the “exe” directory with all other Mirrorcle executables because the necessary dlls are there
as well.
MTIDevice-Test.cpp example:
This example C++ program demonstrates to the user five possible and different ways of
actuating MirrorcleTech devices. When you execute the pre-compiled version of this program
within the exe directory, you will be asked to run one of those three modes, i.e. “Point-to-Point”
mode, “Scanning” mode, or “Import File” mode.
Scanning mode example:
This example C++ program is designed to send a stream of co-ordinates to the micromirror
device via USB MEMS Controller output ports. It demonstrates the use of functions such as
SendDataStream() to communicate to an analog/digital output port of the computer and
eventually to the MirrorcleTech device. The user will be first prompted which USB MEMS
Controller he or she uses, and which maximum voltage to scale the pattern of co-ordinates
through. The .cpp file is fairly self-explanatory and commented to provide easier use and
modification to user‟s desired application. For example, the user may choose to output the
stream with infinite repetition, for example to create a repeating raster patter, or he or she may
choose to output the stream in a single or multiple-cycle burst. This is done with the last “loop”
parameter of the SendDataStream() function. It should be noted that in addition to creating X
and Y arrays of data to send to the port, the user must also create a B array of laser blanking data
or digital triggering data, depending on the application. This blanking data is streamed to the
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
22
laser driver, available on all USB MEMS Controller. This allows the digital output stream to
coincide (correlate) with the X and Y analog voltage streams.
Point-to-point example:
The point-to-point demonstrates one way to simplify the open-loop control of devices in an
application where the user will need to point the laser beam to different sequential points and
would like to have a smooth and fast transition between those points. The user selects the step
time for each point-to-point movement. The example will ask the user to input a set of
normalized co-ordinates to send the device to. Values from 0 to 1 on each axis are valid unless
you have a bi-directional device in which case values from -1 to 1 are valid inputs. When a new
set of co-ordinates is entered, the program sends a step to the USB MEMS Controller which will
send the device from Xold, Yold to Xnew, Ynew as follows:
OutputX = Xold + (Xnew-Xold) * Step1ms
OutputY = Yold + (Ynew-Yold) * Step1ms,
where e.g. step1ms is an array of 100 points representing the 1ms filtered step.
If a user enters co-ordinates outside of -1 to 1 limit, program quits.
In the current version the laser blanking M channel is given zeros during the step such that the
laser which is modulated with this channel will be turned off in the transition region between the
new and old co-ordinates. The laser is then turned on at the very last point of the transition by
assigning M[last point]=1. The user should modify this as desired.
Import Sample File example:
This example imports XYM sample data-points in a text file raster_vertical.smp. Each line in
the file represents a sample to be sent in sequence to the DACs, and will be output at the DACs
at the “Sample Rate (sps)” set in the cpp file. The hardware filters are still applied after the DAC
outputs, before the high voltage amplifier. Valid sample files must have three space-delimited
columns and each valid line must terminate with an EOL (“\n”) character. The .smp file can also
have the sample rate as the first line of the file (e.g. 50000), and this number is read during the
User Sample Import File function. This is optional, and if there is no sample rate number on the
first line, then the function uses the default sps value.
The first column represents sample values for the X-axis, the 2nd column for the Y-axis. All
coordinates should be normalized to -1 to +1 and are imported as floating point numbers. Inside
the program the normalized data for X and Y is scaled with the Max Voltage setting. The third,
or the “M” column is unsigned 8-bit digital data from 0 to 255 which appears on the systems
digital output port synchronously with MEMS voltages in the first two columns. These are often
used for triggering various accessories or instruments in sync with MEMS mirror movement, e.g.
lasers, timers, cameras, etc. As an example, in this mode of use where the numbers are used as
triggers, if a user wishes to trigger a camera which is connected on line 3 of the port, the M
number will be 8. Or if two devices are to be triggered, connected to lines 5 and 1, M number
will be 33.
In the mode where the system is used with an analog-modulation laser driver, the values 0 to 255
will represent laser brightness and therefore small values and zero will practically turn the laser
off during those specific samples, while high values will render bright pixels for their respective
samples. The numbers in the third column may be written as floating point or integers but the
system will interpret them as unsigned integers and only force values to the range of 0 to 255.
0.51231
0.51163
0.51035
0.50975
0.85026
0.85054
0.85114
0.85144
255.00000
200.00000
0.00000
0.00000
An example list of a few sample points
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
23
WARNING: A list of samples must be carefully designed in order to give desired MEMS mirror
movement results and avoid device damage. Samples are read line by line and sent to the output
DAC without interpolation and processing and therefore it is the task of the designer of the list to
ensure that it is well-formed. If there are any significant steps (position changes) from sample to
sample, they will result in large oscillations of the MEMS device and possibly damage.
Therefore, smooth transitions (e.g. by spline function or software filtering) should be used. The
end of the list should bring the device back to the same or very near the same co-ordinates as
those at the beginning of the list since the output system will repeatedly refresh and read the list
from the beginning to end. Therefore a step function must be avoided from the last to first
sample. The proper forming of such sample files is best demonstrated in the software
development examples (SDK folders), both in C++ and in Matlab, where several steps are
utilized to ensure smooth transitions: returning the trajectory onto itself (ideally at device origin
at each beginning and end,) trapezoidal interpolation between desired locations and finally
additional smoothening by software filtering.
Import Keypoint File example:
This example imports a list of XYM keypoints in the text file, text.kpt. Each line in this file
represents a keypoint, and is processed with the sps setting, interpolated and filtered before being
outputted to the DACs. A Keypoints file can be applied with different refresh rate settings. Valid
sample files must have three space-delimited columns and each valid line must terminate with an
EOL (“\n”) character. The first column represents values for the X-axis, the 2nd column for the
Y-axis. All coordinates should be normalized to -1 to +1 for 4-Quadrant devices. Inside the
program the normalized data for X and Y is scaled with the Max Voltage setting. The third
column is unsigned 8-bit digital data from 0 to 255 which appears on the systems digital output
port synchronously with MEMS voltages in the first two columns. In the mode where the system
is used with a laser driver, the values 0 to 255 will represent laser brightness and therefore small
values and zero will practically turn the laser off during those specific samples, while high values
will render bright pixels for their respective samples. The numbers in the third column may be
written as floating point or integers but the system will interpret them as unsigned integers and
only force values to the range of 0 to 255. Because this import file option is for vector keypoints
and not actual samples, the user does not have complete control of the output samples on X, Y,
or the M channel. The software API will appropriately interpolate from one keypoint to the next
to optimize mirror movement, and will copy the same M number to all samples between two
keypoints.
0.25
0.25
0.75
0.75
0.25
0.75
0.75
0.25
255
255
255
255
Slow Raster Example:
The slow raster example shows how to prepare a raster scan. The user is able to define the
number of lines, sample rate, and the refresh rate of each line. Using the user defined inputs, the
program creates the straight segments with uniform velocity and number of points, the curved
segments for the scan to turn around, and modulating the laser to be on during the straight
segments and off during the curved segments. The example also shows the proper way to start
and end each scan by allowing the device to return to the origin before starting the new scan to
prevent large steps and resonance during the return portion.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
24
Follow Arrow Keys Example:
The arrow keys example allows the user to manipulate a laser beam being reflected off the
MEMS device. Each key press adjusts the DC voltage on each axis and directs the beam to the
requested position in DC steps. The commands to the MEMS device are filtered to avoid
overshoot and ringing. The effect is that after each button press, the position is quickly and
smoothly updated and displayed on screen.
Software Requirements:
The provided dynamic link libraries (DLLs) in Mirrorcle SDK are general Windows32 DLLs
that can be used in a variety of development environments.
In order to run the provided examples developed in Visual Studio C++, Microsoft Visual Studio
.NET 2010 should be installed.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
25
MTIDevice SDK – Matlab
MTIDevice Matlab-based Software Development Kit. Similar to Cpp SDK version, this is a
Matlab-based software development kit (SDK) allowing the user the fastest and easiest route to
development of micromirror applications.
Matlab-based MTIDevice SDK with Matlab functions for quick development of analog output
applications. User can use the existing functions inside the MTIDevice class to identify an
analog output device such as a USB MEMS Controller, to create excitation signals and to send
them to the output device. The user has to prescribe the excitation signals sample by sample, by
forming vectors for the x axis and the y axis.
For additional information type
help MTIDeviceHELP
Also once an object in the class is created user can see all of the object properties and methods
available. For example,
device = MTIDevice
creates the object and shows the properties to the user. Clicking on the methods link below will
show available functions as well.
Following examples detail the use of these functions:
MTIDevice_Box.m
MTIDevice_Import_And_Run.m
MTIDevice_Example.m
Software Requirements:
Matlab-based MTIDevice functions require Matlab R2012 or later with the Data Acquisition
Toolbox 3.2 or later.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
26
MTIDevice SDK – LabView
LabView-based Software Development Kit. Similar to MTIDevice Cpp version, this is a
LabView-based software development kit (SDK) allowing the user the fastest and easiest route
to development of micromirror applications. There are several example vi-s provided here to
demonstrate driving of devices through waveform-based signal generation, array-based signal
generation, and file importing.
Software Requirements:
LabView-based examples require LabView 2011 or later.
© Mirrorcle Technologies, Inc., 2012-2014. All rights reserved.
27