Installation and Operation Manual
For contact info, please see the Sci.Electronics.Repair FAQ Email Links Page.
Copyright © 1994-2024
Reproduction of this document in whole or in part is permitted if both of the
following conditions are satisfied:
1. This notice is included in its entirety at the beginning.
µMD0 is a very inexpensive system for precision readout of displacement
(change in position), angle, straightness, and more
in metrology applications using (homodyne) interferometry
with single frequency HeNe lasers. Where the path length difference is
limited to a few cm, it may also be used with (unstabilized)
multi-longitudinal mode HeNe lasers. µMD0 may be used with devices
like linear and rotary encoders which produce Quad-Sin-Cos or Quad-A/B signals.
While targeted for
experimenters, hobbyists, and researchers, there is no reason why
µMD0 can not also be of value in science and industry.
The hardware platform is a readily available very inexpensive
microcontroller development board which communicates via
USB to a Windows PC, laptop, netbook, or tablet.
The graphics below show a rotary optical encoder which uses a pair of LEDs and
photodiodes physically offset by 90 degrees to generate Quad-Sin-Cos analog
signals which are then thresholded to yield Quad-A-B digital signals.
The specific type of sequence is called a "Gray" code (not based on color
but attibutable to someone named Frank Gray) and has the property that any
possible allowable change in value is a change in only a single bit.
This eliminates the ambiguity with sensors using the normal binary order
where two bits can change at not quite the same time.
(The animated encoder graphic seems to be all over the Web. If anyone knows
who the original copyright holder is, I will acknowledge them.)
Many other types of encoders produce similar signals. They may use
optical, mechanical, or magnetic sensing, among others.
The input to µMD0 are the digital signals which can have change rates
of up to 100 kHz ore more. There is no support for analog inputs (other
to convert them to digital form by thresholding) now and never will be.
However, there are hardware quadrature interpolators available that go in-line
with the analog signals to multiply the effective resolution by anywhere
from 2 to 1,000 or more, so they are a possible option were higher
resolution is required. Those made by Renishaw are relatively
inexpensive on eBay. There are also ICs available that perform this function.
But if you're willing to that much effect, it would probably be worth
using µMD2 instead of µMD0 since it has no practical upper limit
on the input change rate.
For use with interferometers, the only difference is that the origin of
the analog signals are from a different type of detector:
This also applies to devices like Ring Laser Gyros (RLGs) which have
similar types of detection schemes.
Where the Path Length Difference (PLD) between REF and MEAS is less than
a few cm, the HeNe laser doesn't even need to be stabilized or single
frequency:
This can be either a linearly polarized HeNe with its polarization
axis at 45 degrees (no LP required), or a random polarized HeNe oriented
so that its orthogonal polarization axes are at 0/90 degrees with the
external LP at 45 degrees. In the latter case, it may be necessary
to assure that the laser is well behaved - not a flipper; such a laser
may be noisy around the flip points.
The interferometer produces (ideally) sinusoidal analog signals in quadrature
that are thresholded to produce the Quad-A-B digital signals used by
µMD0.
The appearance of the actual waveforms as the remote reflector is moved
with the scope triggered on Channel A. The relative phase of Channel A
and Channel B would be close to plus or minus 90 degrees depending on the
direction of movement.
For homodyne, the native resolution of single-pass interferometers
is 1/8th wavelength,
usually 633/8 or ~80 nm. But depending on the optics, this may be doubled
or quadrupled without requiring interpolation. Specifically, the Linear
Interferometer (LI, shown above) and Single Beam Interferometer (SBI)
have a native resolution of ~80 nm; the Plane Mirror Interferometer (PMI) and
High Stability Plane Mirror Interferometer (HSPMI)
have a native resolution of ~40 nm,
and the High Resolution Plane Mirror Interferometer (HRPMI)
has a native resolution of ~20 nm. It is theoretically possible to convert
a PMI or HSPMI into an HRPMI with the addition of a cube corner but the
alignment could be quite hairy.
Note that µMD0 refers specifically to the combination of the
Atmega-based hardware and firmware. µMD1 and µMD2 use
much higher performance hardware (see references).
It's possible there could be
µMD3, .... µMDn in the future using
the same GUI. :)
This document provides assembly, installation, and operating instructions
for the µMD0 hardware and software. The simplest way to do this is
using a solderless breadboard or prototyping
board. The entire parts cost excluding an antique PC is well under $10.
(Probably $25 if purchased from me, which includes friendly tech support).
There is a custom SG-µMD0 PCB available which makes the resuilt
more professional. Around $35 including that. ;-) There is a link later
in this manual to "Heathkit™-type" step-by-step assembly instructions
for the PCB version.
It is assumed the reader is familiar with homodyne
interferometry. Linear and rotary encoders generate signals similar to
those from homodyne interferometers.
If not, back up and start with Sam's Laser FAQ: Interferometers for Precision Measurement in
Metrology Applications.
Mote: Throughout this document, "µMD0"
to the Atmega-based hardware. "µMD" refers to the Windows Graphical
User Interface (GUI), which is identical to that for µMD1 and µMD2.
An adjustable weighted average to smooth data may be applied to the readout
and graph. There is no interpolation.
Specifications are subject to change without absolutely any notice even
to the developers. :-)
All Rights Reserved
2. There is no charge except to cover the costs of copying.
DISCLAIMER
µMD0 is intended as in "intro level" system
for use in hobbyist, experimental, research, and other
applications where a bug in the hardware, firmware, or software, will not
have a significant impact on the future of the Universe or anything else.
While every effort has been made to avoid this possibility, µMD0 is an
on-going development effort. We will not be responsible for any consequences
of such bugs including but not limited to damage to the construction crane you
picked up on eBay for $1.98 + shipping, financial loss from ending up in
the Antarctic when the compass orientation provided by
your home-built ring laser gyro was off
by 1,536 degrees, or bruising to your pet's ego from any number
of causes directly or indirectly related to µMD0. ;-)
Acknowledgment
Thanks to Jan Beck for providing support for enhancements
and bug fixes and tolerating my silly C coding questions.
He was also instrumental in developing the initial
µMD1 firmware and GUI. And for getting me interested
in actually getting involved in that project. If anyone had told me
six months ago that I'd be writing code in C, MIPS assembly language,
and Visual Basic - and enjoying it (sort of) - I would have suggested
they were certifiably nuts. ;-) Jan maintains the master GUI source code
as well as slightly different versions of both the µMD1 and
µMD2 firmware and a development blog on these and other projects.
Introduction
Note: Links to Web pages external to this document will open in a single
separate tab or window depending on your browser's settings.
Rotary Encoder Digital Signals as a Function of
Orientation
Typical Homodyne Interferometer Setup with Stabilized Single Frequency
HeNe Laser using µMD0
Typical Homodyne Interferometer Setup with Unstabilized Multi-Longitudinal Mode HeNe Laser using µMD0
Typical Quad Decoder Signals as a Function of
Time and Displacement Direction
(Scope Triggered on Rising Edge of Channel A Signal)
Specifications
Computer and Operating System Requirements
Everything that follows assumes the use of Windows. If you're
really smart and run Linux instead, sorry. ;-) (However, the GUI
may run on Linux under something called "wine" so there may be hope.) The
µMD GUI is known to work under Win XP, Vista, 7, and 10,
and should be fine on
Win 8 as well. Microsoft Net Framework 4.0 or higher is required
to run the µMD GUI. Net 4.0 or a more recent version is probably on
your computer already but is available free from the Microsoft Web site.
Wiring Diagram and Parts Lists
Since the Nano does most of the work, the only additional parts needed are
to interface to the encoder or laser. And some very simple circuitry
will suffice to get started - or forever. If higher performance is needed,
consider using µMD2 instead along with a proper photodiode preamp.
(#24-26 solid hookup wire or male-male jumpers may be needed to connect
the photodiodes to the rest of the circuitry, not listed.)
Some typical basic circuits are shown below:
A slightly more detailed schematic may be found at µMD0 Sin-Cos Analog and RS422 Digital Interfaces. (This is the one used for the SG-µMD0 PCB.)
The LM393 is an 8 pin DIP so it, along with the Nano and other parts, will easily fit on the typical 250 column 2-1/4 x 3-1/4 inch solderless breadboard with room to spare, but a custom PCB is also available for the interface as well as one for a Quad-Sin-Cos Decoder. For a distance of up to a foot or so, simple wires will suffice at the modest speed of µMD0.
The Quad-Sin-Cos Decoder converts the optical output of the interferometer into a pair of analog electrical signals that are 90 degrees out of phase so that directional information can be generated. The followig parts list applies to the second photo, above:
Quad Decoder Parts List
Prt# Description Comments ------------------------------------------------------------------------- SB1 Solderless breadboard (SBB) 1-3/4 x 1-1/4 inch, 17 columns MP1 SBB mounting plate Attaches to optical post PCB1 Quad Decoder V1.0 PCB Custom PCB with 8-32x3/8 inch screw PD1 Silicon photodiode Sin (Channel A) of Quad-A-B detector PD2 Silicon photodiode Cos (Channel B) of Quad-A-B detector SKT1 Male-female 2 pin socket For PD1 SKT2 Male-female 2 pin socket For PD2 C1 Capacitor, 0.1 µF Bypass capacitor R0 Resistor, 1K ohms Photodiode protection AP1 Attenuator plate/BS Angled plate used as beam splitter CP1 Circular polarizer sheet Piece of CP (QWP+LP) for PD1 LP1 Linear Polarizer sheet Piece of LP or CP used as LP for PD2 STB1 4 pole screw terminal block Photodiode bias and outputs
These parts mount on the Quad Decoder PCB (which may not have an actual part number on the silkscreen). AP1 sits on the PCB and can be positioned to so the reflected beam is centered on PD2 and the intensities are close to being equal. This will probably be where the beam is near the far end of the attenuator strip and 50:50 is probably not achievable, but can be compensated for by the settings of the trim-pots R1 and R7. Once the optimal location is found AP1 can be secured with double sticky tape or a drop of Epoxy.
The Quad-A-B Differential version (RS422) is even simpler since the input is electrical. The input cables can be long and also be twisted with a single 100 ohm resistor between the two inputs for termination, but there needs to be a common ground connection somewhere. While the UA9637 is essentially a voltage comparator with built-in hysteresis, it CANNOT be used with photodiode inputs because its bias current is too high.
The resistor values for the red and green LEDs balances their brightnesses, mostly. Of course, the LEDs aren't *really* essential. ;-)
Tne value of 100K for the photodiode load resistors has been selected as suitable for the typical ~1 mW laser to result in the signal going from near 0 to around 3 V. It's not necessary to have them be adjustable since the threshold settings are adjustable. But you can if you wish (and they are trim-pots in the kits). You can of course change their value to reflect the real world situation of your laser power and losses in the Quad decoder. If the source is differential analog (typically each 1 V p-p), the signals can go directly to the comparator inputs dispensing with the load resistors and trim-pot.
It is not anticipated that later versions will differ in any major way. This is supposed to be bare bones after all. ;-)
µMD0 Parts List
Here are the very long detailed parts lists. :) The numbering refers to schematic above:
Analog version:
Prt# Description Comments ------------------------------------------------------------------------------- MPB1 Atmega 328 NANO Arduino board with pins already soldered SB1 Solderless breadboard (SBB) 3-1/4 x 2-1/4 inch, 30 columns with busses (May not be included in standard kit.) PCB1 SG-µMD0 V1.0 PCB Custom PCB U1 LM393P, 8 pin DIP Dual voltage comparator LED1 LED, red Thresholded Sin, A LED2 LED, green Thresholded Sin, B R1 Trim-pot, 100K ohms Sin (Channel A) load resistor R2 Trim-pot, 10K ohms Sin (Channel A) threshold R3 Resistor, 100K ohms Sin (Channel A) trim-pot isolation R4 Resistor, 470K ohms Sin (Channel A) hysteresis R5 Resistor, 1-3K ohms Red LED current limiting R6 Trim-pot, 100K ohms Cos (Channel B) load resistor R7 Trim-pot, 10K ohms Cos (Channel B) threshold R8 Resistor, 100K ohms Cos (Channel B) trim-pot isolation R9 Resistor, 470K ohms Cos (Channel B ) hysteresis R10 Resistor, 1-3K/20-50K ohms Green LED current limiting SKT1 Parts for 30 pin 0.6" socket For Nano (PCB version only) SKT2 8 pin 0.3" DIP socket For LM393 (PCB version only) STB1 4 pole screw terminal block Photodiode bias and inputs
RS422 version:
(The parts unique to the RS422 version may not be included in all kits.)
MPB1 Atmega 328 NANO Arduino board with pins SB1 Solderless breadboard 3-1/4 x 2-1/4 inch, 250 columns PCB1 SG-µMD0 V1.0 PCB Custom PCB U1 UA9637 or UA9639, 8 pin DIP Dual RS422 line receiver LED1 LED, red Channel A LED2 LED, green Channel B R1 Resistor, 100 ohms Channel A termination resistor R2 Resistor, 100 ohms Channel B Termination resistor R3 Resistor, 1-3K ohms Red LED current limiting R4 Resistor, 1-3K/20-50K ohms Green LED current limiting SKT1 Parts for 30 pin 0.6" socket For Nano (PCB version only) SKT2 8 pin 0.3" DIP socket For LM393 (PCB version only) STB1 6 pole screw terminal block A/B inputs, external power, and ground
Notes:
For this simple setup, a wireless breadboard with 25 columns (400 tie points) should be adequate. The Nano with soldered pins can plug in at the right side with the USB connector facing out, and the LM393 and associated components can be placed next to it. Those connections that cannot be made with component leads should use pieces of #22-#24 AWG solid wire. The solderless breadboard may not be included in kits with the SG-µMD0 PCB.
The "cables" for the photodiodes can simply be twisted pairs. Keep them short but a foot or so should be fine. If the source is something else like a commercial optical detector or signals from a self-contained laser/interferometer, a different type of termination than the load resistors may be needed.
For more information on the Quad decoder and interface, see Construction Guidelines for Basic Quadrature-Sin-Cos Decoder and Quad-A-B Interface Kits. Some of it is redundant but there are more details on the implementation and instructions on mounting the optical parts and the actual circuits and wiring.
The (non-Alpha) versions of the firmware are absolutely guaranteed to be new and improved in terms of features, capabilities, and performance. This probably means there will be some new and improved bugs as well. The Alpha versions are even more likely to have some juicy bugs. However, the µMD0 firmware is so simple that bugs would have difficulty hiding. ;-) Please contact us via the link at the top of this page should any dare to appear (or for any other legitimate reason). ;-)
Input Interrupt Arduino Pin Nano Pin -------------------------------------------- 1A 0 D2 5 1B 1 D3 6
The LED on D13 is used as the heartbeat/status indicator for homodyne depending on firmware version. Currently it blinks at between a 1 and 2 Hz rate, more or less.
There's probably little need to know the following unless something goes wrong. Only marginally relevant ones are shown here:
Pin Arduino Labeling Homodyne -------------------------------------- U1-1 TX0 TX0 U1-2 RX0 RX0 U1-3 RST RST U1-4 GND GND U1-5 D2 1A U1-6 D3 1B U1-16 D13 Stutus LED U1-17 3.3V 3.3V U1-27 5V 5V U1-28 RST RST U1-29 GND GND U1-30 VIN (5V) VIN (5V)
Most of these details are really only relevant if there is a desire to modify the firmware. For the firmware provided, only the pin assignments matter.
Here is the communications format between the firmware and GUI. This information is of little relevance if using the GUI, but will be useful if writing your own application software or for data analysis. Each of the values is sent as an ASCII string representing a signed (if needed) decimal number separated by spaces at the sampling rate. The firmware maintains a FIFO buffer so that if the USB data is delayed for some reason, no data should be lost (hopefully):
The same format is used for both homodyne and Heterodyne modes but not all fields will be filled in or relevant for homodyne.
Standard (Single Axis) Data (8 values): 0: Axis 1 Count/REF Frequency Count* = REF frequency/Sample Frequency 1: MEAS Frequency Count 1* = MEAS 1 frequency/Sample Frequency 2: Displacement 1 (in 1/2, 1/4, or 1/8 wavelength) 3: Velocity Count 1 = (Displacement 1 - Previous Displacement 1)/Sample Frequency 4: Phase 1 = Signed fractional offset between Displacement increments. The typical range is -128 to +127 (8 bit 2's complement). If Phase is not valid, then an error code is sent instead (heterodyne only): 0x200 = no counter 1st REF 0x400 = no counter 2nd REF 0x800 = no counter MEAS 1 0x1000 = no PORTB 1st REF 0x2000 = no PORTB 2nd REF 0x4000 = no PORTB MEAS 1 5: Sequence Number (Unique serial number for each sample) 6: LowSpeedCode (See below) 7: LowSpeedData (see below) The following 8 values will also be sent when Multiple Axis Mode is active: 8: Axis 2 Count/MEAS Frequency Count 2* 9: Displacement 2 10: Velocity Count 2 11: 0/Phase 2 12: Axis 3 Count/MEAS Frequency Count 3* 13: Displacement 3 14: Velocity Count 3 15: 0/Phase 3 LowSpeedCode (specifies contents of LowSpeedData): 0-99: GUI Data/Control: 0: No Data 1: Laser Power 2: Signal Strength 3: Temperature 1 (XXX.YY, °C, 0 to 70.00) 4: Temperature 2 (XXX.YY, °C, 0 to 70.00) 5: Pressure (XXX.YY mBar, 500.00 to 2000.00) 6: Humidity (XXX.Y percent, 0 to 100.0) 8: Sample Frequency (XXX.YY Hz) 10: Firmware Version (XXX.YY) 20: Homodyne Interferometer (if non-zero) Low byte: # homodyne axes Next byte: counts/cycle (4 for quadpulse) (Not all of these are currently implemented.) 100-199: Diagnostics 200-255: Reserved
* The REF and MEAS Counts are the incremental change since the last sample, NOT the total value.
The Arduino IDE will work with all versions of the firmware. It can be downloaded free from the Arduino Web site and saved to your Downloads directory any other convenient location. Then unzip the executable and run Setup. There is no actually installation, it will just unpack and copy files to the selected Arduino program directory. (Usually something like "Program Files"). Name it the version number. Currently the latest version is 1.8.13.
Plug the board into any available USB port.
Before the Atmega board can be used, a Windows device driver must be installed to enable upload of firmware and communications with the µSLC1 GUI.
There are many ways of doing this - some which may be overly complex, but what I've done for the Atmega 328 Nano 3.0 board is to go to Arduino Software and install the current version of the Arduino IDE (V1.6.9 as of May 2016). (I'm not sure if the board needs to be plugged in to a USB port during this process, but mine was. During the install process, it will ask to install the drivers. Reply "Yes" to all its requests. When the Arduino IDE is started for the first time, go to "Tools", "Board", and select "Arduino Nano". If the Nano is plugged in, its COM port should appear under "Tools", "Port". If you received the Nano from me, it will have µMD0 firmware. Go to "Tools", "Serial Monitor". The Serial Monitor windows should appear and after a few seconds start pumping out data from the board. Select a baud rate of 115200 (assuming firmware Version 2.09) to turn it into something meaningful. With no laser, the data should look something like:
0 0 0 0 0 18016 0 0 0 0 0 0 0 18017 10 124 0 0 0 0 0 18018 8 100000 0 0 0 0 0 18019 0 0 0 0 0 0 0 18020 0 0
(The 6th value is a sequence number which should be incrementing by 1. The other values are, well, you don't want to know what they are.)
More info on software, drivers, and more at Getting Started with Arduino and Genuino on Windows.
The more complex installations may be required if you bought the Nano from eBay (or me) or off the back of a truck, depending on whether it has the genuine FTDI USB communications chip. And even more complex if it doesn't have the bootloader installed. Links for driver installation may be found under References under "Arduino". Instructions for burning the bootloader may be found in the section: Burning Bootloaders into the Nano or Pro Micro. Nearly all have the bootloaded, but also nearly all require the CH340 driver.
The Arduino IDE is probably best for compiling and uploading. UECIDE can also be used and is an order of magnitude or more faster for compilation and uploading, but for the simple µMD0 sketch, it doesn't much matter. And UECIDE is more complex to set up, slower for everything else including startup and simply loading or saving files, has been buggier in the past, and doesn't appear to support the "New Bootloader", found on many Nanos. Most eBay Nanos have the Old Bootloader but Nanos from other sources like Amazon may have the New Bootloader (simply called "Bootloader" in the Arduino IDE). If from me, it could be either depending on my supplier. The only easy way to know which one is present in your Nano is to attempt to upload a sketch. The wrong one will hang or abort.
The firmware (via the links, above) is provided as a source file which probably has an extension of ".pde" or ".ino" (though the specific name doesn't matter - it's just a text file). However, the name may NOT contain any dashes "-" due to the peculiar restrictions of Java or something. Make a directory with the name of the firmware (without the extension) and put the firmware file there. For example, if the file is named umd0_FW_v123.ino, make a directory called umd0_fw_v123. and put umd0_fw_v123.ino in it. Note that case matters so the name of the directory and name of the firmware file (without the extension) must match case character-by-character exactly. Thus Interferometer.pde is not the same as interferometer.pde
(Or for testing, just go to Files->Examples->01.Basics->Blink and upload that. It's easy to make changes and then see immediately that thay are taking effect without risking the rest of the Universe.)
Windows should recognize that the COM port dropped out momentarily and reappeared. The µMD0 firmware will be spitting out sequences of numbers at the sampling rate. These may be viewed by going to: Tools->Serial Monitor. With no interferometer hardware, they will be rather boring with only the sixth value incrementing sequentially (Sequence Number) and the 7th and 8th values cycling among some obscure numbers (Low Speed Code and Low Speed Data). To Windows, the board appears as a COM port. Thus any application that processes COM port data can be used in place of the µMD GUI, should this be desired.
If the firmware crashed somehow, Windows may display a message saying something about the USB port not working. But that shouldn't happen with any firmware downloaded from here. :) And on rare occasions a cosmic ray or hardware glitch may result in the upload failing with a checksum or other error. Just try again. If the selected COM port is incorrect, cancel and retry.
Sometimes the Arduino IDE decides to change the COM port for no good reason I can fathom. Go to Tools->Port, and make sure it has selected the COM Port.
Once loaded, the firmware is retained in non-volatile memory so this only needs to be done at most once - or until a firmware update is available!
The firmware may also be compiled without uploading by using Ctrl-R. Since you haven't messed with the code, it should compile without errors. This is slightly faster for testing and doesn't use the board at all so it can be off doing whatever it pleases. :)
Important: Terminate any instances of the µMD GUI before uploading the firmware and put the board into program mode (again if necessary) AFTER doing this even if LED1 is flashing.
0 0 0 0 0 18016 0 0 0 0 0 0 0 18017 10 124 0 0 0 0 0 18018 8 100000 0 0 0 0 0 18019 0 0 0 0 0 0 0 18020 0 0 0 0 0 0 0 18021 0 0 0 0 0 0 0 18022 0 0 0 0 0 0 0 18023 0 0 0 0 0 0 0 18024 0 0 0 0 0 0 0 18025 0 0 0 0 0 0 0 18026 0 0 0 0 0 0 0 18027 0 0 0 0 0 0 0 18028 0 0 0 0 0 0 0 18029 20 1095 0 0 0 0 0 18030 0 0
If there is a display like this with the 6th number incrementing by 1, the board is probably working.
(Should you care, the 7th and 8th values are the "Low Speed Code" and
"Low Speed Data", respectively. 10,209 is the firmware version 2.09;
8,24414 is the sample rate of 244.14 s/s, and 20,1095 specifies 1 homodyne
axis and a homodyne multiplier of 4.) Refer back to the communications
format for more info.
Note: While described below, the "Velocity" and "Frequency" GUI modes will not return predictable or consistent results since the serial packet rate is not a controlled variable, but they may still be of some value. User beware. ;-)
The GUI has been stable for several years, with only a few updates mostly relating to environmental compensation. It is compatible with all versions of the firmware. The GUI for µMD0 is identical.
Changed copyright from 1994-2020 to 1994-2024. ;-)
Bug fixes: Extended range of wavelengths from 0.001 nm to 10 mm; fixed diagnostic readouts for homodyne mode, more or less.
Bug fixes: Forces number conversion to use USA format to prevent the GUI from crashing if the PC was set up in a different country. Eliminates the gross scale error in Frequency plots (but still may be off by 20 percent depending on sample rate, and more if using the ultra-low sample rate for hobbyist laser support).
Additions: Adds homodyne support for selectable number of counts/cycle defined in the firmware. Updates copyright date. ;-)
Save the µMD GUI .exe file into any convenient directory. (There's a small chance that the first time it's run, an error is produced since there is no configuration file associated with it. Simply continue and the GUI will come up. When it is closed using "Finish", valid settings will be saved so that the error should ot appear again.)
When started, the µMD GUI (henceforth simply called the "GUI") comes up in Displacement mode with graphing enabled. The only action required by the user is to select the USB COM port. Once selected, the readout and graph will begin displaying the interferometer data.
Even if there is no encoder or interferometer hardware attached to the board, it is possible to confirm that the Nano is talking to the GUI. Go to "USB Port" and select the same COM as used to upload the firmware. The graph should immediately start scrolling to the left indicating that it is accepting valid data, even if it is all 0s. With homodyne, there will be no error detection, but the fact that it started scrolling means the communications link is working.
Important:
For homodyne mode with µMD0, the default sample rate is 244.14 s/s. Attempting to change it is not recommended and no one at µMD Central is losing much sleep over the funny number.
The following is intended for homodyne systems; for specific aspects of the GUI screen displays for heterodyne systems, refer to the Micro Measurement Display 1 (µMD1) Installation and Operation Manual. The actual GUi is identical.
The data includes counts for each axis including displacement, and velocity; a unique sequence number to identify samples; as well as other low speed data such as environmental sensors and diagnostics. (More info can be found a few paragraphs above.) The GUI displays are updated at approximately 60 Hz.
All the screenshots below except for ring laser gyro use simulated data, which was more convenient for developing this manual! However, it also means you can play around and recreate these displays before building your interferometer.
The first set are the selection buttons at the top of the window. Note that except for USB Port, these require only a single click to activate:
The log file is closed and its name and path are saved upon exiting the GUI.
The values are signed long integers of the designated displacement(s) in nanometers including averaging and axis flip. (Same as the readouts.) The "*" can be used by the parser at the receiving end to detect the end of line.
To indicate that the Monitor COM port is active, a "+" will appear to the left of the "Graph Averaging On" label, flashing at the rate of the data lines being sent. Its color is subject to change without notice. :) Note that the graph does NOT need to be visible for the data to be transmitted.
Note: Once a USB port has been opened, the selection cannot be changed or closed. Code to close an open USB port is purported to do bad things and has been disabled. If an incorrect USB port was selected by accident, exit the GUI and restart. Any open USB port will be closed upon exiting.
These may all be accessed via Alt-first letter.
The next set are the buttons, checkboxes, and other widgets on the main window:
When the "Encoder" checkbox in Interferometer Configuration is checked µMD will use the constant small angle increment WTIHOUT the Trig calculation and the text will change to "Encoder Angle". This is useful with rotary encoders and ring laser gyros.
There are three options to select what data is saved:
The format is: "D: Displacement N: Sequence Number" where Displacement and Sequence Number are values in decimal. The Displacement an integer multiple of wavelength times the multiplier depending on the type of interferometer. Example:
D: 51643 N: 15345
Assuming the use of a Plane Mirror Interferometer (10706A) with a Homodyne Multiplier of 4 ("#define HomodyneMuliplier 4" in the firmware), the Displacement would be 51643 * 39.56 nm or approximately 2.043 mm.
The format in Single Axis Mode (8 values) is: "REFFrequencyCount MEASFrequencyCount Displacement VelocityCount Phase SequenceNumber LowSpeedCode LowSpeedData". Example:
1534 1532 51643 2 144 15345 0 0
The format in Mulitiple Axis Mode (16 Values) is: "REFFrequencyCount MEAS1FrequencyCount Displacement1 Velocity1Count Phase1 SequenceNumber LowSpeedCode LowSpeedData MEAS2FrequencyCount Displacement2 Velocity2Count Phase2 MEAS3FrequencyCount Displacement3 Velocity3Count Phase3".
With Homodyne mode, only Displacement1, Velocity1Count, SequenceNumber. LowSpeedCode, and LowSpeedData are valid. The others will probably be 0s.
The format regardless of mode is: "R: REFFreqeuncyCount M: MEASFrequencyCount D: Displacement V: VelocityCount P: Phase N: SequenceNumber T" where the "T" signifies that this is Test Mode data. Example:
R: 0 M: D: 51643 V: 2 P: 0 N: 15345 T
Caution: The log file can grow rapidly - especially where all the data is stored - so it's probably not the sort of thing to do for hours on end unless you have stock in a disk drive manufacturer! :)
All these formats have a fixed number of fields that are space-delimited. Thus importing the log file into programs like Excel or Matlab should be straightforward (if the size of the file doesn't break it).
When interpolation is enabled (the default), as averaging coefficient of around 900 is recommended to minimize sample-sample noise in the graph.
The Averaging coeeficient is saved upon exiting the GUI.
Suspend is useful when making adjustments to the inteferometer beam path and/or laser.
The Time Compression factor is saved upon exiting the GUI.
The format is slightly modified when Frequency mode is selected. This graphic shows the actual DFT of the triangle waveform in the one above. Note that the DFT coefficients go as 1/N rather than 1/N-squared because it's actually using the velocity data, which is a squarewave.
The horizontal scale is approximately accurate for real data. The vertical scale is somewhat arbitrary. The Main Readout shows Displacement data when in frequency mode.
There may still an error of up to 25 percent is the actual values since they depend on the sample rate being used, which varies depending on the sample rate. The uMD technical department has not gotten around to provided corrected labels, can you believe that? :)
Selecting Frequency sets Time Compression to 1 since the graph data is used for the DFT calculation. There will also be a delay in the Frequency plot accuracy depending on the DFT Frequency Range and input signal as data is accumalated.
The DFT Frequency Range is saved upon exiting the GUI.
The units for the Main Readout, as well as for the graph vertical axis (all except Frequency mode) are selected in the Interferometer Configuration window. The options are nm, µm, mm, m, in, and ft for all but angle, which has arcsec, arcmin, and degree. For velocity, "/s" is added. The same units also apply to the graph "Range" selection and vertical axis of the graph.
For encoder applications with environmental compensation OFF and "LI / Other" selected in "Interferometer Configuration", the resolution will be WL / (HomodyneMultiplier * 2).
Linear coefficienets:
These settings only affect linear measurements.
Units (as appropriate)
Known quirk: If neither the COM Port or Test Mode is active, switching among the Units buttons will only change the Units lable and/move the decimal point/precision without affecting the readings. Just thought you should know. ;-)
Parameters (as appropriate):
Miscellaneous:
The graphic below shows µMD1 being used to test a home-built ring laser gyro. It is being rotated by hand on a Lazy Susan turntable. A combination of Angular Reflector Spacing and the other resolution parameters can be used to adjust the scale factor to read correctly.
If the Temperature Auto checkbox is checked, nothing should change since the homodyne firmware doesn't send any sensor data.
Test Mode sends 34 °C.
If the Pressure Auto checkbox is checked, nothing should change since the homodyne firmware doesn't send any sensor data.
Test Mode sends 567 mm/Hg.
If the Humidity Auto checkbox is checked, nothing should change since the homodyne firmware doesn't send any sensor data.
Test Mode sends 89%.
For use with encoders, it can be set to almost anything.
For use with encoders, it should be set to Off.
Note 1: With the current GUI, the Factors for Temperature, Pressure, and Humidity will change based on the entered values However, their exact value is not guaranteed to be meningful and should only be considered for trends. This was supposed to be fixed when the environmental calculations were corrected using the NIST formulas, but the staff assigned to do the work took a couple decades off, sorry.
Note 2: With Environmental Compensation turned OFF, the vacuum wavelength is used in calculations. Therefore, Environmental Compensation should be turned ON for laser interferometers even if using standard values.
The Waveform is saved upon exiting the GUI.
The REF value is saved upon exiting the GUI.
Note that while Test Mode will operate in Angle mode, the values it sends are always linear displacements. Thus, what this really means may be too difficult for the average human brain to evaluate and may result in an overload and an unintentional brain reboot endless loop. :)
The Units selection is saved upon exiting the GUI.
Under some conditions, this may cause the current values of displacement from the SG-µMD firmware to be displayed instead of resetting the GUI readouts to 0s when the COM Port is opened, which may be a feature or a bug depending on your point of view. Never mind that diagnostics and reset should be totally unrelated to anything. Live with it or figure out how it works and then tell us. ;-)
The Diagnostic Readout state is saved upon exiting the GUI.
Use the "#define Homodyne n" or "#define Heterodyne n" line in the firmware specify how many axes will be displayed. The value for "n" may be 1 or 3. Setting it to 2 will do the same thing as 3.
All GUI functions apply to the primary axis, which defaults on startup to Axis 1. The primary axis is what the Main Readout, REF/MEAS/DIFF frequency displays, frequency analysis, averaging, and graph apply to. Clicking on the Axis 1, Axis 2, or Axis 3 labels will select it to be the primary axis and change the color of the selected axis label to identify it as the primary axis. The units of the primary axis are also used for the others. Error detection (if enabled) only applies to the primary axis. Averaging is NOT applied to the Axis 1, Axis 2, or Axis 3 readouts, even the one that is the same as the primary axis.
Note that in Multiple Axis Mode, the communications format sends somewhat more data over the USB COM port and the GUI must perform more computation. Thus this may cause problems for a wimpy pre-Jurassic PC operating on the hairy edge of what's possible. Once Multiple Axis Mode is entered using the interferometer hardware, the only way to return to Single Axis Mode is to restart both the firmware and GUI. This is because neither has any way to know whether dropouts of measurement clock signals are due to a beam path being momentarily interruprted or an axis actually being shut off (whatever that might mean).
Test Mode is also capable of exercising all three axes singly or in combination but the function generator data will be the same for all. This is controlled by the Multiple Axis Mode checkbox. When enabled, Axis 1, Axis 2, and Axis 3 checkboxes will appear below it with Axis 1 being the default on startup. Turning Multiple Axis Mode off will put the GUI back in Single Axis Mode. But this will be overidden when Test Mode is turned off if the USB port is enabled and the firmware is running with multiple axes.
Multiple Axis GUI support has been under development for a semi-infinite amount of time. Specifications and behavior are subject to numerous changes without notice. ;-) However, no major features beyond what are described above are anticipated to be implemented in the GUI.
And it really is the one for µMD1 when what you really want is this manual. :( :) Something else way down on the list of concerns for µMD Central.
If there are problems uploading firmware and/or opening the COM port in the GUI AND your Nano board has the CH340 USB chip (which includes anything I provide), especially if it has no label, it may be incompatible with the CH340 driver currently installed on your system. The typical error when uploading is:
avrdude: ser_open(): can't set com-state for "\\.\COM3" An error occurred while uploading the sketch
If already loaded, attempting to open a COM port in the µSLC1 GUI, will generate a block of errors similar to uSLC1 Errors when Opening COM Port with New CH340 and 2023 Driver and do nothing useful. So even if you have no interest in modifying the firmware, this issue may still exist.
With the Nano board plugged in, determine what version of the device driver is installed by going to the Windows Control Panel, "Device Manager", "Ports (COM & LPT). Then double click on "USB Serial CH340....". Go to "Driver". If it is a version later than 2019 (probably 2023), it may not work depending on the CH340 chip.
DO NOT UNINSTALL THE DRIVER as that may delete it entirely and make it unavailable should there be a need to get it back. Go to "Update Driver", "Browse my computer for drivers", "Let me pick from a list of available drivers". Hopefully an older version is still there. Both the 2014 and 2019 versions are known to work. Else install the 2019 version which may be found under References: CH340 Windows USB Driver Installer (2019)(Local). Even with the older driver, there may still be some flakyness in uploading. Note that a subsequent Windows Update will likely resintall the 2023 driver (or whatever the latest version is). That can be blocked. Without doing that, even just using a different USB port may result in the 2023 driver reappearing. More info and fixes at: Arduino Counterfeit Fake CH340G chips driver issues.
Even with the 2019 driver, the upload may hang. Press the Reset button on the Nano and it should then go through the normal upload sequence and terminate without errors. Go figure. :( ;-)
I will attempt to avoid Nanos using these bogus parts, but there may be no choice after a while. It is really too bad that the original Nanos are so expensive - Almost 10X the cost.