P
Phil Hobbs
Guest
On 2020-01-15 13:43, George Herold wrote:
Not at all, if you have the computrons available. The issues are mostly
that the frequency domain will show up all sorts of analogue issues that
don't bug you at all when your signal isn't swamped by wideband noise.
For instance, some ADCs can't swing their internal nodes fast enough to
avoid pattern-dependent errors, and a lot of amplifiers get driven nuts
by the charge pulse that comes out the ADC input during sampling. The
effects look subtle until you torture-test them.
My usual approach is to use analogue lock-ins, with something like a
74HC4017 or firmware to produce non-overlapping gate signals for the
0/pi phases. The non-overlap is pretty generous to allow the op amps to
settle completely between sample periods. That never causes any
problems IME.
Cheers
Phil Hobbs
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510
http://electrooptical.net
http://hobbs-eo.com
On Wednesday, January 15, 2020 at 7:29:08 AM UTC-5, Phil Hobbs wrote:
On 2020-01-15 03:17, RBlack wrote:
On Tue, 14 Jan 2020 12:35:56 -0500, Phil Hobbs
pcdhSpamMeSenseless@electrooptical.net> said:
[snip]
Client work almost always succeeds, and the occasional failures are
mostly due to the customer's prevarication, such as taking my
proof-of-concept system, giving it to a CE outfit, and then pulling me
back in to attempt to fix the CE's mess--of course at the last minute,
when they've almost run out of money. That's happened a couple of
times, so I try very hard to discourage it. (The two were the
transcutaneous blood glucose/alcohol system and the blood-spot detector
^^^^^^^^^^^^^^ ^^^^^ ^^^^^^^
Bummer, sorry to hear about that. (I have a personal interest in seeing
this type of device working and on the market). Did anyone else pick up
the project, or did it just die?
for hens' eggs.)
Yeah, that was a sad one, for sure. It remains vivid in my memory, so
at the risk of boring people, here's the tale.
The founder called me out of the blue at 3 PM on Christmas Eve, 2012.
He turned out to be a charming fellow with a lot of drive and not a lot
of education, who was practically supernatural at raising money. He
wanted me to build him an instrument, because that's what I do.
He'd patented the general principle, which avoided the individual
physiological variations that usually bedevil those sorts of measurements.
The idea was to use a hand cradle with a virtual pivot (*) holding a
fibre bundle against the web of the first and second fingers. There are
two arteries very close to the surface there, so you get to measure
fresh blood instead of tissue fluid, and no one has hair, fat, or
callouses there, so the physiology is very cooperative. He had some
promising data that he took himself using a Perkin-Elmer FTIR and his
hand cradle. (He somehow talked some guys at USC into giving him lab
space and some help doing that--he was entirely self-taught, which has
its strengths and weaknesses.)
The project was an unusual one for me, in that I didn't have my arms
around the whole measurement--I built the gizmo, but the founder had his
USC statistics friends use their AI nous to build the model and extract
the blood solute data. Thus I don't actually know how that was done.
(It wasn't something simple like spectral differencing, anyway.)
I did a photon budget, which is my term for a detailed feasibility
calculation emphasizing stability and SNR. That's super important
because without calculating how good the measurement _could_ be, you
never really know how you're doing. A photon budget prevents you from
wasting time on recreational impossibilities on the one hand, or turning
a silk purse back into a sow's ear on the other. In this case it looked
pretty good, using a tungsten source, a custom-designed split bundle of
about 20 fibres (TX + RX), a conventional Czerny-Turner monochromator, a
single extended-InGaAs photodiode, and a chopper plus lock-in for
detection.
The proof-of-concept system took me about six weeks start to finish,
including the photon budget, optical design, designing and building the
electronics, assembling the optomechanics, and writing the software. It
was built on a 12 x 24-inch aluminum breadboard using a combination of
hhacked Microbench (**) parts, JB Weld (the poor man's machine shop),
and a servo from an RC airplane for moving the grating. The grating
cradle was also built from toy airplane parts, courtesy of
servocity.com. The electronics was all built in die cast aluminum stomp
boxes, dead bug style, wired up with BNC cables. The chopper was a
commercial (Thor Labs) unit, and the back end was a LabJack and a
console-mode C++ program running on a second-hand laptop.
It all worked great, and was very amusing to watch--an advanced clinical
instrument built out of JB Weld and toy parts. (Wouldn't the FDA have
loved that?)
We did the preliminary acceptance test by having some friends over for
cocktails and measuring their blood spectra every 15 minutes or so. The
data did exactly as we hoped--nice repeatable curves with the right time
dependence and no big physiological variations between subjects. We did
some glucose work using a strip reader for comparison, but the strips
have relatively poor accuracy, so we concentrated on the alcohol
measurement for that part of the demo. (Quaffing a few cool ones is
much more fun than sticking pins in your fingers, too.)
After the founder used the POC data to raise a bunch more money, we
brought the proto and the Perkin-Elmer FTIR to a contract engineering
house in Orange County CA that will remain nameless because they have
this unfortunate tendency to sue everybody in sight. The founder kept
me sort of distantly in the loop, but his crucial mistake was trying to
save money by supervising the CE firm himself. (I tried to help, but
they ignored me almost entirely because I wasn't the one writing the
cheques.)
The CE folks proceeded to fall into every pothole along the road, like a
drunk. They ignored the photon budget, and so redesigned the front end
to use an ordinary op amp TIA, not realizing they lost about 15 dB of
SNR in the process. (I managed to get that one fixed, and the guy
responsible taken off the project. Unfortunately they were almost all
like that.)
They replaced the direct drive for the grating with a belt drive, which
gave nice smooth motion but of course rapidly lost accuracy as the belt
squirmed around while moving, so that the calibration wouldn't sit
still. They needed more encoder precision, so they put an encoder on
the motor as well as the grating, and did some micky-mouse trick to
combine the two encoder readings. Even the magnetic encoder on the
grating shaft refused to sit still--it drifted around like mad. I went
there to try to get to the bottom of some of this stuff, and although
they mostly sidelined me because I wasn't writing the cheques, we did
manage to get to the bottom of that one. Turned out that the encoder's
output was the duty cycle of a pulse train (like the RC servo only
backwards), and they were measuring the pulse width instead, using a
capture input of their MCU. That turned the frequency drift into a
position drift. Once it was fixed, I hit that poor encoder with cold
spray and a heat gun, and couldn't get it to move at all. Kudos to US
Digital for that one.
The belt-drive system failed nonetheless, basically because the
measurement was being done on the slope of the very strong IR absorption
spectrum of water in the 1.4-1.7 micron range, so that small wavelength
shifts caused much larger amplitude errors.
I told them to use a sine-bar drive like every other Czerny-Turner
monochromator in the world, but they refused, insisting on using a
worm-and-sector gear instead, with the encoder on the worm shaft.
Unlike nearly any other sort of gearing, worms work using sliding
friction. That makes the grease film thin out with time. I calculated
for their benefit that in their design, with the very small radius of
the sector gear, the maximum lubricant variation we could tolerate was
about 70 nanometres. Since they were nearly finished with the prototype
build for the formal clinical trial, I told them to use dry molybdenum
disulphide for lubricant instead of grease.
They straight-up refused, saying they couldn't get MoS2, so I sent them
a link to the exact SKU on fastenall.com, after verifying that their
local Fastenall had it in stock. (I even sent them a Mapquest link so
they could find the store. That was a bit sarcastic, which I regret,
but I was getting pretty tired of them by that point.) They proceeded
to ship one unit with grease and three units unlubricated.
When I complained about all the directionless fiddling they were doing,
one bright lad smiled and said brightly, "That's engineering!" He was
one of the better ones.
They also took the POC proto apart to use bits of it in their test
system, so that they had no comparison data, and, oh, yes, they broke
the $100k FTIR and didn't tell anyone.
The units failed the acceptance test. I attended it, but since the USC
folks weren't crunching the data in real time, the failure wasn't
entirely apparent till later. By that point the CE had run through a
year's time and most of a million bucks.
Some months later, two units arrived on my bench, along with an urgent
request for me to get to the bottom of it all.
Turned out to be a real onion problem--you know, peel off one layer,
cry, and peel off the next.
The phase of the detected signal was moving around by 10 degrees or so,
which was easily enough to destroy the measurement. The code seemed to
be a PID controller using an optointerrupter on the chopper wheel, which
should have been fine. I built a strobe light using an HP 3325A
synthesizer driving a LED, so that I could see the loop dynamics. The
controller was totally broken--regardless of the settings of P, I, and
D, there was no way of making the phase sit still. A gentle stream of
canned air would move the phase, and it would never recover--i.e. there
was no integral term in the control law, despite what the settings would
have one believe.
And then it turned out that they'd never built a lock-in before, and
were trying to extract the (approximately triangular) signal waveform by
least-squares curve fitting to a sine wave instead of using an FFT like
normal people. Everybody screws up their first digital lock-in, but
I've never seen one as bad as that. (For non signals-and-systems folks:
least squares fitting works OK at high SNR, but for noisy data it falls
apart completely. The FFT uses orthogonality, and so works at any SNR.)
I didn't get to the last onion layer, because the founder ran out of
both dough and friends. He never did pay me for my last month's work.
A pity. I would have made those boxes work eventually.
(*) One where the business end slides around on a curved surface, like
the blade assembly on some razors.
(**) A cage system using plates held together with 6-mm
centreless-ground stainless steel rods, similar to the Thor Labs 30-mm
cage system.
Cheers
Phil Hobbs
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510
http://electrooptical.net
http://hobbs-eo.com
Wow! Thanks, nice story. I've half dreamed of making a cheap spectrometer
with a grating and rotation stage/ worm drive... figuring if you always
turn it in one direction the backlash won't be a problem... I never thought
about the grease!
Re digital LI: Color me ignorant, but my first idea would be to
multiply the signal and ref. in software... is there a reason that is
a bad idea?
Not at all, if you have the computrons available. The issues are mostly
that the frequency domain will show up all sorts of analogue issues that
don't bug you at all when your signal isn't swamped by wideband noise.
For instance, some ADCs can't swing their internal nodes fast enough to
avoid pattern-dependent errors, and a lot of amplifiers get driven nuts
by the charge pulse that comes out the ADC input during sampling. The
effects look subtle until you torture-test them.
My usual approach is to use analogue lock-ins, with something like a
74HC4017 or firmware to produce non-overlapping gate signals for the
0/pi phases. The non-overlap is pretty generous to allow the op amps to
settle completely between sample periods. That never causes any
problems IME.
Cheers
Phil Hobbs
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510
http://electrooptical.net
http://hobbs-eo.com