It’s been some time since my last update and I’ve been dreading this next part. I’ve had to wait until I had enough info to try and tackle the BD Pathway’s integrated laser autofocus device. So, here we go
Controlling the laser autofocus (BD Pathway 435)
On the BDPathway 435, the Laser autofocus is controlled by both a serial command sequence and some calculations done within AttoVision, from an analog readout and communication signals gathered on a NI PCI-6221 card (with a 37 pin connector).
Looking at the cable linking the BDPathway and the control PC, the following pins are connected on the DB37:
Looking at the live panels in the NI Measurement and Automation Explorer software (test panels tab), we know that Analog In is a differential signal (AI0 +, AI8 -) and its full range is -10V to 10V. We also have P0.0 and P0.1 possibly setup as inputs and/or Open Collector (?), and something happening on the P1 port, bits 1,2,3,5,6:
Other values of interest in AttoVision can be found in Autofocus Setup → Setup plate Type include sampling rate (12KHz), Z sweep relative displacement (160um), gain (? 20), use of a rolling average (20 values) and Algorithm type (one of Double threshold (default), DownTrend, Shoulder Peak, Simple Threshold):
Two things we can check. In the “Laser Auto-Focus offset calibration” panel:
what happens when we click “Find Laser Z position”? (‘S>’ serial controller (AttoVision) sends, ‘D>’ device responds)
And Laser autofocus position is reported at 138.920 um.
Here, TrZ16000 instructs the BDPathway to initiate a -160 to +160 um sweep from the current position.
TODO I will come back to this sequence later.
Then what happens when we click the “Test” (autofocus) button (with -29.34 um offset at the time of the test)?
TODO I will come back to this sequence. I will note that the transmitted light isn’t switched on with MT,2 but with P00 for some reason.
How does it work? (wild speculation ahead)
The laser autofocus readout is probably based on some kind of photodiode array like in this paper: High-speed and precision auto-focusing system for direct laser lithography from which I’ve pinched this figure:
and we’re looking for either a zero crossing (or a max value as described below) readout on AI.0/AI.8
In our case, “Material surface” is the bottom of our multi-well plate.
I am guessing that the serial command initiates a Z sweep and the digital lines are used as a clock signal and maybe some start stop signals. If these are sampled together with the analog signal, maybe that’s how we find how many Z steps there are between the current position and the focal plane.
Can we test any of this?
I just got a small circuit board manufactured, which should allow me to probe the digital signals with sigrok and a super cheap logic analysers (the little 24MHz / 8 channel USB ones).
I’m still waiting for the proper jumpers and headers I was planning on using here but this will do for a quick test.
What I really need is a mixed signal analyser to probe the analog and digital signals at the same time. In my head (ha!) I can replace the NI card with an “Arduino” (possibly an STM32F411 black pill) to sample the analog and digital signals and return a serial string telling micromanager the relative number of steps required to reach the focal plane.
Hopefully something along these lines will happen:
- A Z sweep is requested by Micro-Manager via a TrZ instruction.
- This activates some sort of signal which triggers the Arduino to sample the analog signal and whichever signals of interest.
- Z-offset calculations are carried out on the sampled analog signal (rolling average, find max or find zero crossing) and a relative Z value is stored in the STM32F411’s RAM.
- Micro-Manager can request that offset via a serial command to the black pill.
That’s it for now. Lots of things I’ve possibly missed, assumptions I should not have made, and maybe this adventure has / will shortly reach a dead-end. Whichever way, I will edit this post when I hook it all up and hopefully have more data to show! And if you have any comments, feel free to share them here.