Hey, I make confocal, whitelight interferometers and microscopes for a living. Here is a few insights to improve your results. 1) Your setup is non-rigid, which means there will be vibrational motion and modes oscillation between sample and microscope. Fix this by adding a heavy base and using steel instead of aluminum. 2) Laser Diodes suffer from Speckle noise, which is up to 15% of intensity. Switch instead to a LED based emitter. 3) Dont leave cables hanging, air drafts might push and move source or detector. Make sure they are fixed. 4) Using thick half mirrors is not recommended, as they create ghosting. That happens when double reflections overlap with slight change in angle. Cheap option is film beam splitter or cube beam splitter. 5)In Confocal, we dont move the stage to scan. Instead, we use DLP (mirror arrays) or liquid crystal to raster the image, pixel by pixel at a fixed height, then move along Z, until we find the peak for all points. Otherwise, its a cool prototype V1. good job.
@BreakingTaps3 жыл бұрын
Awesome, thanks for the tips! Really appreciate it! And doh, didn't even think about the detector moving but that seems very obvious in retrospect. Interesting about DLP, I assumed commercial systems used a galvo system to raster the laser around. Very cool, thanks for sharing!
@petevenuti735513 күн бұрын
I know nothing about microscope design, but I have a question about it number two, What's the difference between a laser diode that emits light and a light emitting diode that emits lasers? And what is speckle in that context?
@StuffMadeHere3 жыл бұрын
Dude your videos look soooo good. Also, sweet microscope :)
@Airjew6663 жыл бұрын
*Videos shot with a confocal laser microscope*
@BreakingTaps3 жыл бұрын
❤ Thanks! Don't tell anyone but I only release videos because I like color grading footage and pretending I'm Michael Bay. All the science junk is an elaborate cover story 😇
@herrgerd16843 жыл бұрын
@@BreakingTaps where's the explosions then? bay movies are 50% explosions minimum!
@BreakingTaps3 жыл бұрын
@Herr Gerd Soon™ hahaha
@Jcewazhere3 жыл бұрын
Since you're here, and your most recent video is weeks old and has tens of thousands of comments :P @Stuff Made Here: Idea for you: A holster for cops that when the firearm is drawn it automatically calls for backup and EMS. Beau of the Fifth Column did a 9 minute video showing some of the benefits of it. Either try to make one yourself, or help put out the message that this would be good for cops and the people they point firearms at.
@nobirdsnomasters3 жыл бұрын
I have absolutely zero need for a "confocal laser microscope" but your channel is so incredibly well done I can't help but watch.
@MikkoRantalainen2 жыл бұрын
I'd love to have confocal laser microscope but I need it so little that I cannot justify even the cost of DIY project to get one. Just like I would want to have accurate spectrophotometer, too.
@josejimenez896 Жыл бұрын
I've never heard of one but now I need one
@blitzar844311 ай бұрын
It's one of those impulse buys frfr
@timthompson4683 жыл бұрын
Very cool. In the 1990s I worked with a startup developing a commercial confocal laser review station in the semiconductor industry. We scanned the laser in x-y and had a piezo stage for the z-axis. It also required a proprietary frame grabber board that was synced to the laser scanner and z-stage. My work was on the microcontrollers, so I only knew the general optics design. We experienced what we called the pit-particle issue where what we knew to be a solid above the surface (a sub micron calibrated latex sphere) could sometimes show up in the 3D image as a hole.That seems similar to what you were sing on the one image. Our optics engineering team spent a lot of time resolving that, but I don’t recall how they attacked it. Great video. Thanks.
@diegofloor2 жыл бұрын
That seems like a problem that could be "solved" (mitigated maybe) by analyzing the curve. If the peak is out of reach there should be a steady climb before, which should be detectable with a proper numerical analysis. Then I would replace this value with a max value. It would at least make it obvious in the image where the 'z cropping' happens, instead of random valleys.
@AdityaMehendale3 жыл бұрын
If I may suggest - please consider putting the transimpedance amplifier _very_ close to the photodiode, preferably mount the diode directly piggybacked on the opamp IC (directly soldered, no sockets) onto the DIP8 of the opamp. The capacitance of the long coax between the PD and the TIA limits the bandwidth, in your current setup.
@victortitov17403 жыл бұрын
Yep. And also using a smaller diode will give better speed (thx lower capacitance) and lower noise.
@BreakingTaps3 жыл бұрын
Cheers for the tips! This project really taught me that my EE skills are terrible and I need to spend some time learning the fundamentals. Just barely got the amp working and it really is awful in every way :) Will keep that in mind for the next one, I forsee myself needing a decent photodiode amplifier in the future :)
@StanIvanov3 жыл бұрын
If you're still working on this, consider replacing your photodiode and aperture with a linear CCD array. You can use the reflected beam width as feedback for the next Z position to find the focal height in 2-3 iterations instead of scanning.
@mikeselectricstuff3 жыл бұрын
For small movements like, that, maybe a voice-coil based actuator would probably be better - could you maybe adapt a CD/DVD optical block?
@cnxunuo3 жыл бұрын
Piezo will also be nice, voice coil need some clever close loop thing which piezo you can almost get away with complete open loop
@BreakingTaps3 жыл бұрын
Agreed! Would be a _ton_ faster and probably more precise too. Lesson learned I suppose :) There's a followup technique (chromatic confocal) which I might explore, and will definitely explore alternative motion options. The OpenFlexure stage was super convenient but I didn't realize the movement speed itself would end up being the limiting factor.
@DmitryKiktenko3 жыл бұрын
maybe heads drive from hdd drive could be better?
@DmitryKiktenko3 жыл бұрын
really awesome project! i think you should use kinda white matte spray paint to get rid of scanning artifacts. i've build ultrasonic "scanner" to make an image using standard arduino us-sensor and had a lot of time to figure out what do i see on my result images )
@excitedbox57053 жыл бұрын
That is what I am using and you can scan thousands of points per second. I only have dvd lasers on hand but you get better resolution with a BluRay laser. You also get the entire optical unit and sensor as 1 piece and only need to build the stage. There is also a chip inside the drive that contains 7 op amps / comparators to control the voice coils and time the readings.
@HuygensOptics3 жыл бұрын
Really cool project! Another way to do this is by using a standard cd or dvd laser head. You cannot scan very large areas, but with very high resolution.
@BreakingTaps3 жыл бұрын
Thanks, and cheers for stopping by! Will take a closer look at those DVD units, are there open source designs/plans/software to control them? I'm not sure I have the skills to hack one myself :)
@edengleback8723 жыл бұрын
@@BreakingTaps I think that styropyro has some tutorials on youtube, and they mostly revolve around an lm317 regulator. Also I had an idea for the optimisation which might be interesting: set a grid over the area you're scanning, and go to each point sequentially and move the z axis to find the height of the point. After the first scan look for areas where there is a large change in height and then go back to get more resolution in those areas. This should result in being able to start with a coarser grid which should make the scan a bit faster, although fine detail may be lost in some areas. This was really cool and I don't need a confocal microscope but now I'd really like to try at some point
@vincentguttmann22313 жыл бұрын
@@BreakingTaps They are actually not that difficult to control. But, one potential problem is that you need a special 2x2 photodiode to focus properly. Let me try to explain: imagine a 2x2 grid of photodiodes, with them being oriented at 45 degrees. The optics in there are special so that if you are too far away, the beam becomes elliptical from top to bottom, so the top and bottom photodiodes get more light than the left and right one, but if you're too too far away, the left and right ones get more light than the top and bottom ones. And if you're perfectly in focus, the laser for forms a perfect circle and all photodiodes get the same amount of light. I know Hamamatsu offers photodiodes that can be used for that, but they'd probably cost you a kidney, and the chip that's currently in there doesn't expose the focus data to you. If you want pictures for what I'm talking about, wikipedia has images in the article about the CD player. But driving the coils themselves is relatively easy, their movement is proportional to the voltage across them. Actually, a laser unit should be a pretty good confocal stage if I'm not completely mistaken, since you have the exact same thing happening that's happening here, and it's all one unit.
@hullinstruments3 жыл бұрын
@@BreakingTaps dude there are absolutely tons of wonderfully documented open source projects utilizing the high end opto-mechanics in a standard DVD/Blu-ray optical pickup. a bit of googling, there are a few things on hackaday and elsewhere. Really incredible documented projects out there. One of my favorites will show up in Google image results… You will see a nice looking finished product with all of the circuitboards in a purple color. They got some really good results with that, and I think A set a fresh eyes like yours could really push the project further. Billions of dollars of R&D have gone into developing the optical pickups in some of the higher end units. They absolutely engineered those things to within an inch of their life 😂 I’ve got dozens of them, so if you need some parts just let me know and I’ll ship you a box no charge. Also have a bunch of really high-end hamamatsu optical sensors and components from a bunch of equipment I’ve repaired or salvaged. So I may just have something you need. I’ll gladly chip in and help however I can
@ElectricalInsanity3 жыл бұрын
After watching this video, I thought this was going to be one of those huge million plus channels that I just hadn't heard of yet. That you only have 25k subs is outrageous to me. Everything here is on par with the best of the best KZbin has to offer.
@SarahKchannel3 жыл бұрын
You could try to have the beamsplitter at the Brewster angle of you laser source and mirror material, could avoid the laser dump, when the optical path is geometrically redesigned.
@BreakingTaps3 жыл бұрын
Woah! That's new to me, just did some reading. Very cool! I had no idea polarized light had that property.
@GeorgeTsiros3 жыл бұрын
@@BreakingTaps brewster's angle is the kind of thing when you see it happen, the coffee goes out your nose even if you're not drinking coffee
@markp57263 жыл бұрын
@@GeorgeTsiros This comment caused coffee to come out my nose. And judging by my neighbor's shouts, I know from where the coffee was teleported.
@chunxia40943 жыл бұрын
@@BreakingTaps There are two more reasons for the poor SNR: (1) the laser beam is highly aberrated due to poor alignment quality, and (2) some reflected light will be fed into the laser cavity, which actually affects the output beam intensity. The reflected beam is definitely something you want to avoid.
@michaelhaardt59882 жыл бұрын
If the laser is polarized, it might be an option to filter the returning light in that direction to exclude specular reflection from those shiny surfaces. That reduces the return signal very much, but scans for scattering and the surface geometry matters much less, which may otherwise deflect a focused beam in a different direction. It has the same effect as coating the surface matte.
@CNCKitchen3 жыл бұрын
I need (want) one! Awesome work, man!
@reps3 жыл бұрын
What's this, I see laser but nothing getting burnt, evaporated or even slightly charred? 🤨 JK that's really cool and I am looking forward to that thing back there in the summer!
@Koodie23 жыл бұрын
Nice to see you here. Guten Tag!
@zachbrown72723 жыл бұрын
okay, break time's over. Go work on OSMU some more.
@BreakingTaps3 жыл бұрын
Just _really tiny_ charring on the sample 😉
@GermanMythbuster3 жыл бұрын
So fun to always see my most loved youtubers on the same channels I subscribed to 😄😄😄 Well we all like Science 😄
@Sqwince233 жыл бұрын
why are you browsing KZbin videos? Don't you have a CNC mill to be recording for us?
@derchesten3 жыл бұрын
Jesus christ! this is a 2Msub channel level production quality! how you manage! I mean, i loved all your videos but you really outdid yourself with this one!
@juzadee2 жыл бұрын
Hey, awesome video! I see there already was some comments about reflective surfaces here - and that is indeed the probable cause for the inverted shield structure. When the beam hits the slightly higher point of the shields edge it is scattered into the room and not back into the lense making the signal weaker. This would explain the smaller values in some of the curves peaks too. Alexander Sannikov mentioned in their comment that the metal oxides being diffuseve cause noise in the signal. Indeed if the samples were to be prepared beforehand (like they do for electron microscopes) to be compleately matt with a coating of a white matt substance the laser would behave more uniformly along the entire surface.
@Alexander_Sannikov3 жыл бұрын
I think one of the reasons why you're getting artifacts is because of how metals reflect light : it's mostly specular reflection(it's directional, in your case parasitic) and not diffusive (unidirectional, what you're detecting). metal oxides, however, tend to build up in tiny crevices of metal surfaces and they are dielectrics, so they create tiny diffusive areas in otherwise specular metal which might look like noisy height changes.
@timjackson39543 жыл бұрын
This is a bugaboo when working on PCB's under a microscope generally. They are SHINY, and what you see is not a nice illuminated surface but a reflection of the light source. That's why we use ring lights to work on PCBs, at least that eliminates reflections from the surface plane, although not from solder fillets.
@Daniel-zw6gz3 жыл бұрын
I think you are right about reflections. And to add something else. I think some reflections are courses by lights other than the laser. Like the image with the "EC". The left, white part of the image could have a lot of room light. Then the lights were turned of for a little while. And then a small light in the room is turned on what causes the reflections on top of the characters. But I could be wrong because the scans took multiple days and then I would expect to see more day night effects.
@starrfiddler3 жыл бұрын
@@Daniel-zw6gz What type of temperature fluctuation is seen in this workspace over 24 hours? The PCB has many components, each with a different CTE. Also conformal coatings can confuse the sense of sharp focus.
@starrfiddler3 жыл бұрын
Egads! Sorry, this is not where I should have put the question!
@clawsoon2 жыл бұрын
I was thinking about reflectivity, too, after a recent experience trying to use photographs to create 3D models using Meshroom. Reflections make it basically impossible for the algorithms to figure out what's going on in the images. Anything reflective has to be dusted with a matte powder to get it to work.
@ElenarMT2 жыл бұрын
YOU GIVE ME HOPE. I'm in awe of this video. My intellect is only barely sufficient to grasp what the components do. It's true that I feel bitter in myself for not being smart enough to do something like this. But I am profoundly happy that you are. It gives me hope for humanity's future that there are people as brilliant as you in the world. It really does. I wish you all the very best
@SABlackhawk3 жыл бұрын
Wow only just saw this video. For faster scanning you could use an x-y galvo stage and f-theta lens like used in a laser marker or SLM 3D printer, that way you can raster scan an area with a fixed subject vs. having to move the subject around. You could effectively steer your beam around as fast as you could read the photodiode and your reading electronics would become the main bottleneck.
@chrisreichelt72023 жыл бұрын
Dude your video quality and experimental setups keep on getting better! Awesome stuff, keep it up!
@BreakingTaps3 жыл бұрын
Thanks! Really appreciate it :)
@graealex3 жыл бұрын
It's just a matter of time until this channel explodes. Keep on!
@AlphaPhoenixChannel3 жыл бұрын
Awesome stuff! I'm amazed that the data collection was actually limiting - I probably would have gone with a different xyz stage and scanned voxels one by one and been way too slow. the continuous scan seemed to be enabled by the latency of the stage so that's pretty awesome! I'm also glad you called out the big cylinder of conflat flanges in the background cause I was getting really curious...
@BreakingTaps3 жыл бұрын
Thanks! Hehehe, I'm pretty excited to start working on the chamber, think I have all the necessary components... just need to wait for my garage to warm up a bit (we just got more snow! argh!) and machine a few different adapters. Soon!
@JGHFunRun2 жыл бұрын
I'm only slightly surprised to see you here
@tomz8083 жыл бұрын
Fascinating. Great job and good explanation of the optical path. I wonder if it would be faster to run the scan like an atomic force microscope, riding the surface by tracking the amplitude of the photodiode. Move a step in x, then move the z up or down to maximize the amplitude, repeat. Advance y each time you hit the end of x. The assumption is the surface is often flat, or at least has a gentle slope, so instead of scanning the whole z stack for an x,y point, just search around the last height (z) each time you move to a neighboring point.
@clonkex2 жыл бұрын
I would think you could then attempt to recognise the trend from previous points in the direction you're currently moving and predict which way you need to scan in z.
@kentvandervelden3 жыл бұрын
This is really well done! I watched an OpenFlexure video and this was suggested. Really shows that a lot of time went into the project and into the presentation. Wishing you the best of success.
@BreakingTaps3 жыл бұрын
Thanks Kent! Good to see you, hope things are well!
@JamesBailey1233 жыл бұрын
Great video, 20 minutes fly by, just the right level of detail. From my experience stacking microscope shots and focus failures, it will be that 'specular highlights' (very shiny surfaces) break your algorithm. You'll be assuming that the thing you are scanning has unchanging topology (which is true), but accidentally assuming that when you move the microscope stage that the pattern of light reflected would not change (untrue), because unless the surface is perfectly matte, the 'brightness' does not 1:1 correlate with 'in focus', it also correlates with 'shiny thing pointing at lucky angle to send light back to sender'. Imagine you were scanning a microscopic disco ball, if you strapped a torch to just above a camera lens and moved it closer and further, you'd see that different panels would suddenly become very bright, and others very dark. It confuses normal cameras with their contrast based focus detection (and even sometimes phase detection). If you want to test what I'm talking about, scan some glitter or a retroreflective tape. I would spray the item to be scanned with a misting of 'airplane glue' smelling hairspray in the giant cans from 50cm away. It will 'matte' your surfaces sufficiently. If it kills the retroreflection of tape, it will be scannable by your algorithm.
@vladislavpistrunenko16393 жыл бұрын
What if find particularily enjoyable about this video is that due to the relative simplicity of the optical setup it works really well as an explanation of how a confocal system functions. What you have built here is essentially a physical version of a diagram one might find in a textbook. The pinhole demonstration, for example, is really cool, since it's not something that you can show on a commercial confocal microscope, and the custom optical table-based setups are usually a bit too complex to serve well as illustrations for those who are not already familliar with the lightpath. I might actually start showing this to my students, the whole video is remarkably well made.
@BreakingTaps3 жыл бұрын
Thanks for the kind words! Really appreciate it, especially from someone that actually knows the subject matter and knows what they are talking about! I'm definitely an optics beginner so it's encouraging to hear there weren't too many mistakes made :)
@GeorgeTsiros3 жыл бұрын
12:15 you can possibly increase the scanning speed dramatically by making a feedback system, like autofocus, which tracks the surface or, equivalently, the height at which the intensity is maximum, which is the maximum of the curve so when x-y changes, you need only change the z enough to stay at the maximum
@MikkoRantalainen2 жыл бұрын
Great idea. And if you can implement it with phase detection similar to SLR cameras, you don't need to even guess which way you need to move to get into focus. The end result would be pretty much like optical LP needle. That said, laser scanner LP players do exist. Maybe one could take some ideas about those. I think the tech is old enough that the patents have already expired but are publicly available.
@kVital_20233 жыл бұрын
Cool project. Try to modulate ur laser beam with chopper or so and demodulate ur photodiode signal at the same frequency. This will remove much of noise.
@mr_gerber3 жыл бұрын
Good point! I was about to suggest some physical wavelength filtering as well, just to remove signals from ambient light, but some decent modulation will remove a lot of the ambient (DC in any case)
@spearhead303 жыл бұрын
Thanks!
@BreakingTaps3 жыл бұрын
Thank you! ♥ Really appreciate the support!
@TheCensoreduser3 жыл бұрын
Very cool, i worked on a similar project a few years back using DVD optical pickup heads and its internal optical path, which is indeed a confocal arrangement with an electromagnetic vertical adjustment which provides a high degree of precision.. my failure was in the X-Y stage.. might have to revisit with openflexure but it was something that worked as an arduino shield.
@lewsdiod2 жыл бұрын
You've come such a long way in your video production. Hilarious intro and great quality, plus intriguing topics!
@urano19883 жыл бұрын
I was about to comment on your complaints about the slowness of the system given the insane amount of points that you have on the z-scans (eg. 13:10), but then I heard the explanation at 21:01... Anyway, it seems that you have quite a lot of resolution, a quick and easy way of trading it for a bit more speed or range would be adjusting the gearing of the steppers. Also those 250 ms of "network response time" are weird and likely worth profiling.
@trollenz3 жыл бұрын
That project deserves a subscription right out of the box ! Thanks for producing such an interesting content.
@johnandersen89993 жыл бұрын
This channel just keeps getting better!
@movercast3 жыл бұрын
This was a great video. I've found having a fiberoptic cable act as the pin hole to be a good solution. Also adding 2 scanning mirror to traverse the XY plane reduces the need to rely on mechanical movement. A photo-multiplier-tube is a great way to increase the electrons per photon ratio. Also using a quarter wave plate and a polarization beam splitter lets you keep more of the precious photons going to the source.
@BreakingTaps3 жыл бұрын
Interesting, I had thought about using a fiber but wasn't sure if that was correct or not. Does it have to be a single mode fiber, or would larger multi-mode fibers work too? I guess larger would be fine, since I'm already using a multi-mode laser and I should care one way or another anyway. Might give that a shot! Good idea about quarter wave and polarizing beam splitter! Looks like I need to grab a few more optical components to have on hand for the next project :) my box of optics is slowly growing haha
@movercast3 жыл бұрын
@@BreakingTaps - MMF is more forgiving because it's 50µm vs SMF being 10µm. Either is a PITA for alignment / focusing. I think going w/ some wave plates and polarizing beam splitter would be more useful to keep those precious photons going to the meter. Good luck!
@bretcannon38263 жыл бұрын
The quarter wave plate and polarizing beamsplitter also reduces optical feedback into the laser diode. Optical feedback into a laser diode can cause a lot of noise. Using single mode fiber gives a smaller effective pinhole and a diverging beam that can then be well collimated with a single achromatic lens, which would remove the need for the input lens in your beam expander. I have just butt coupled a telecom patch cable, with a 9 micron diameter core, to a high power LED and imaged the output onto a cheap security camera and have to turn down the current to the LED to not saturate the pixels on the camera. If you need more power into the fiber, you can buy a "visual fault locator Fiber optic cable tester" which couples mW of light into the core of a single mode optical fiber with no alignment. These are available on Amazon for under $20. You could also use a fiber-optic circulator or a 3dB fiber optic coupler to replace the beamsplitter, which would remove all need to align pinholes to precise locations.
@KallePihlajasaari2 жыл бұрын
@@bretcannon3826 That Y coupler is a brilliant idea. The optics would be one focus lens to bring the fibre end to a parallel beam for the microscope optic. a fibre coupled laser and detector would complete the capture system.
@ikocheratcr3 жыл бұрын
Nice project. Very good details on what this microscope is and how it works, very good. About the optimization "issue" you commented, I see it as a simple thing to run an arduino (or any other microcontroller) driving the steppers directly and sampling the data. I am not sure how much ADC resolution is required to get nice data, but many uC have 10~12bit ADCs and sample at > 20kS/s, which is way over the stepper frequency. A simple loop will take stepper to "home" and do step; take sample; print sample; next. repeat. You do not need to "verify" the position, just let the actuator (stepper) do it job. There is for sure a time need for the the actuator to stop moving (settle position), but that can be measured by looking at the samples, and dynamically determine how long to wait for. Also running the scan at constant speed, will help to vibration and "inertia problems", ie accelerations. I am not familiar at all with the OpenFlexure device, so maybe I do not see how it would not work like I described.
@BloodAsp3 жыл бұрын
There should be a tech/science youtuber collab, you'd fit in nicely!
@markp57263 жыл бұрын
Sounds like something Hank Green (SciShow, Crash Course, Journey to the Microcosmos, etc etc etc) could be interested in... but no idea how to get his attention.
@DantalionNl3 жыл бұрын
I really can't stand how at such exhuming scientific and video quality you only have 25k subscribers. Luckily you have already managed to capture the attention of major scientific channels.
@Gwallacec23 жыл бұрын
This man is absolutely incredible. I wish I was able to retain and use learned information as well as he does. He just is a wealth of knowledge.
@AsmageddonPrince3 жыл бұрын
You retain information by using it. Memorization is a myth and not real learning.
@paulpease8254 Жыл бұрын
Cool project. One of the reasons confocal can be so good for biology is that it uses fluorescence, so you get isotopic emission from each point with little effect like absorption or reflection differences. Would be interesting to see if you could coat your samples in a fluorescent dye and add an emission filter if it would significantly improve the quality.
@jacobyoung68763 жыл бұрын
This is really impressive! It's great to see people really pushing the limits of DIY science.
@notromttocs2 жыл бұрын
@ 17:39, your issue is with the zener diodes encased in glass, the solder joint is fairly clear but the round glass is scattering the light and there goes the resolution
@23edsa3 жыл бұрын
I dont know if it was already mentioned in the comments, but. I have some experience in 3d scanning, basically extracting height information from a series of images, and the general recommendation for an object not to bee too white, or too black in albedo and what is sometimes more important not to be too shiny. From your samples you can clearely see that varnished surface of a PCB net you the worst result, and edges of the shiny metallic coin tricked sensor into wrong depth, even though the xy shape was correct. Try taking pictures of embossed areas of paper money and see if it will make a real difference. Amazing video though!
@cnxunuo3 жыл бұрын
I would suggest trying something call white light confocal instead of intensity only pinhole confocal, but you need a spectrometer which can also be quite easily made as theres little need for narrow FWHM, a commercial version will be chrocodile from precitec, it gives depth info and you only need to scan in XY, plus with different chromatic abberation lens, you can get different scan range, something like 100um to few mm dynamic range
@BreakingTaps3 жыл бұрын
Hehe, on the todo list actually! I discovered the Nanovea version of the same thing (I think they call it "chromatic confocal" instead, just to be confusing i guess) while working on this project, but was too invested in the regular confocal to quit at that point. I agree, it looks great! Should be so much faster, and it's such a clever mechanism using/abusing chromatic aberration. I think the optics should be pretty straightforward, right? Just a bunch of regular lenses stacked up to increase the chromatic aberration at each lens?
@cnxunuo3 жыл бұрын
@@BreakingTaps yes, the optics are very straight forward, calibration is a bit tricky, but doable in a home shop i think, we bodged together a chrocodile taped to a benchtop cnc router and did some mapping that way, it worked alright as at high speed weight will average out imperfections, didnt even need filtering. one thing chrocodile can do is 4KHz readout, with a tiny DSP, i will think with a FPGA demo board it will be equally good.
@RichardBetel3 жыл бұрын
In a previous life, I learned a lot about CT scanners. The basics are simple: take a big hubless wheel. Put an X-ray source on the wheel, pointed at the centre of rotation. Put a detector on the other side of the wheel. spin the wheel, gather signal strength data, do *LOTS* of computation, get a detailed image, called a slice. Throw in a motorized bed to move the patient in and out of the machine, and you can scan a volume by gathering *many* slices. OK, so at some point, Toshiba had a bright idea: they used an X-ray source that produced a line of light, not a point, and opposite it, they put a line of sensors. That way, they got multiple slices in a single pass. By about a decade ago, they had such density that they could image an entire human heart in a single rotation, and since they were doing about 3RPM IIRC, that meant that they could make CT scan videos of a heart as it pumped! Anyhow, it seems to me that you could do the same: miniaturise the laser+sensor system and put more in side by side. I haven't looked into the optics of it, but if you could use a bar diode and a linear ccd, you might be able build a system that can scan the entire Y-axis at once. A 64hour scan would come down to 8 hours. I also wonder if there are better scanning patterns. eg: diagonals. Start at [MaxX, Miny,MaxZ] and command a move to [MinX,MinY,minZ], then move to [MinX,MinY,MinZ+1], then scan to [MaxX-1,MinY,MaxZ], etc.
@DCsk8rgoelz3 жыл бұрын
I audibly shouted "SIIIIICK" when you showed the topological renderings. Instant subscription.
@nijram153 жыл бұрын
Congrats on making a convocal! I build microscopes for biological research in my phd for living. Some tips: it seems there are is lot of aberration in the spot at the pinhole, resulting in bad contrast. Use a mirror (in focus) and try tilting and moving the second lens to get a bettet spot. You probably want a kinematic mount for that lens to make the alignment easier.
@professord88883 жыл бұрын
2 minutes in, this is what it's all about on so many levels. So impressed already!
@Doodlebud2 жыл бұрын
Love the project! Miss doing this stuff. Man if it takes a week to image a surface you wonder how much temperature change over that time frame would impact the sample. Its a small area you're sampling but the whole object would chmage temp. For efficiency buildings can drop temp overnight. You're measuring such small features I wonder if it might be enough to cause some of those anomalies in the data plots. It's always a challenge coming up with the right algorithms to filter the way you want but not kill good data or pick the wrong point.
@whytelove3 жыл бұрын
funny video ! It reminded me one of my internship : I had to build an interferometer to mesure optical elements with 10 nm accuracy for the Z dimension. But instead of laser I used a white light source. Thanks for the video, it brought back some great memories :)
@Justin-dv7ul2 жыл бұрын
Umm could you do this with the openflexure block stage, it's movements are much more precise
@BreakingTaps2 жыл бұрын
Probably! Much smaller range of motion if I remember correctly, but would definitely provide more accurate steps!
@soronemus88153 жыл бұрын
Staggeringly awesome project and video dude! My area of expertise is mechanical engineering/robotics/machining but I have been trying to learn more about optics, ever since learning about how autocollimators can measure the flatness of surface plates. My one comment/question is this: Do you think the results could be improved if you did your best to isolate the microscope from any vibrations? I remember you saying you 'tried not to bump it', which I assume means it was sitting on a bench or other casual surface. I may be off base, but at those resolutions, the machine might be vibrating at amplitudes small enough as to be imperceptible to the human eye, but still affect the measurements. Even something as small as an air conditioner running in the next room, you walking past the machine, or even sound waves could possibly affect the actual position of the x/y/z delta stage relative to the laser. Maybe something worth trying would be mounting the machine on something with a lot of mass, and wrapping any non-essential surface with electrical tape, along with securing any loose wires? Aluminum has high stiffness and low mass, and therefore transmits vibrations dangerously well, and your entire gantry/laser assembly appears to be one big cantilevered beam, which might be causing it to behave like a tuning fork. I spent 3 years helping design a robotic medical device that used low intensity vibrations applied to the ulna (forearm) then analyzing the tissue's response to infer the mechanical properties of someone's bone strength for the purpose of osteoporosis study. We used a piezoelectric sensor to gather data on how the bone reacted to the vibrations, then reverse engineered the mechanical properties of the bone using statistical analysis and lots of complicated math. So I have spent far too many hours looking at frequency response function plots trying to figure out where sources of unwanted vibration came from haha. Again, awesome project, and thanks for putting together this vid! Huge respect!
@Resonantfate2 жыл бұрын
Yeah, I very much wonder about the effect of vibrations on his results.
@TsunauticusIV3 жыл бұрын
Holy cow. Hidden gem of a channel. Proud to say I was here before he hits 10 million subs!
@davidsandy59173 жыл бұрын
I have a personal ambition to build an STM. I will consider myself successful when I can see atomic dislocations in a metallic crystal. So far I have designs but no working prototypes. Just an occasional image before a tip crash. I have no real need for one of these but my purpose of designing one is one of learning. At the same time, I end up creating supporting hardware that has other uses. Videos like this one are inspirational. I work in the semiconductor industry and need to worry about particle contamination at the sub-micron level. The difference between what I do at home and at work is about 4 orders of magnitude in cost.
@mynyasabut2 жыл бұрын
Man! your videos are awesome. We get months worth of education in science and technology in every one of them. Your detailed way of explaining is incredible. Thanks
@BinalBruno3 жыл бұрын
Really cool work. Couple of questions/comments. Did you calibrate your sensor data with a dark measurement? What's the spot size achieved? We have built a confocal microscope at our lab. we do line scans to get faster results (easy if you know the acceleration and speed of the stage). Limiting factor is of course how fast you sample the data. We limit 'stop and measure' at each point to situations where we need more precise measurement or small area scans. We also have a dynamic profile measurement mode where we can measure periodically moving samples. Also I see that you have a structuring laser. You could make custom precise pinholes using black hard paper. You could over complicate your optics to get a smaller spot size. Or use white light as your source which result in different focal point for each wavelength and use a spectrometer to get the profile.
@etmax13 жыл бұрын
I've worked with confocals, and the easiest way to get the pin hole and X/Y/Z stage is to use an optical fibre for the pinhole then move the fibre tip. Also we used photomultiplier tubes which give you much better sensitivity.
@BreakingTaps3 жыл бұрын
Ah, that's clever! I assume you have to use a single mode fiber, or would a larger multi-mode work? That would certainly cut down on the complexity of the optics and alignment!
@marcopolo16133 жыл бұрын
The curved surface at the top of the shield is probably scattering light like a convex mirror. If you had a matte textured object you might get better results.
@MiniLuv-19843 жыл бұрын
Very impressive Mr. Breaking Taps! I hope you continue to refine this. One thought that occurred (and I have no idea if this effect is as I imagine it, nor if it can be utilised) is that the laser diode emits photons in a random direction which you carefully collimate and truncate to a circle through the "hole" before the 2 way half silvered mirror. What if you allowed the random photons to bathe the sample and put that camera back in place of the photodiode with a fine grid of holes rather than a single hole. Would that create a 2D image of the sample at a particular height and then use the z axis on the openflexure platform to scan through the heights creating a series of 2D images that you can then analyse and assemble into a 3D data set?
@BreakingTaps3 жыл бұрын
This is a really good observation! I had a segment in the video about this topic but it got cut due to video length. What you propose is very similar to what real, commercial confocals do. They use a spinning disk filled with pinholes in a spiral pattern, and use a camera sensor instead of a photodiode. This lets an array of pinholes "expose" the sample in parallel at that Z-height, and then the the array of pinhole spots are analyzed on the sensor individually. If you search for "spinning disk confocal" or "Nipkow disk" you'll see how it works. So yeah, you're intuition is spot on :)
@JeremyLea3 жыл бұрын
Two thoughts: 1. How about using a nozzle as a pinhole. 0.1mm nozzles are pretty cheap, and you could always drill out the back if you need more room for the beam to expand. They come with a convenient screw thread for mounting and fine adjustment along the beam path! 2. RobRenz has a video on an autocollimator mirror system with some interesting differential screws for the precise positioning of mirrors. Been trying to figure out if it is possible to make a 3D printed laser autocollimator...
@bensmith33043 жыл бұрын
You could also get a really quick profile using a camera in reflected brightfield. Image a focus series in Z, and then do an Extended Depth of Focus in FIJI (ImageJ). This will return a height map identical to the one you are getting with the confocal. Spiral scanning and photomultiplier tubes will also greatly increase your speed. Finally, a Teensy running in DMA mode can do dual channel ADC at 1.1 MHz per channel which can then be dumped from RAM to an SD card for rapid storage and later processing.
@danratsnapnames3 жыл бұрын
first thing that comes to mind is reflectivity would greatly affect the results and create ALLOT of noise.. because after all, your relying on the reflection of the laser to plot the data.. so if the surface of what your measuring has a higher reflection than that of other points, then it will throw it off, because your measuring the reflection at a specific Z point, as opposed to the actual surface height. this is why electron microscopes work so well, because an electron cares less about reflectivity of light upon the surface that its measuring.
@makarlock3 жыл бұрын
Absolutely love the jank to performance ratio of this project!
@stiquin3 жыл бұрын
I am working regularly with a confocal laser scanning microscope since the beginning of this year and I had no clue this technology existed before and now YT randomly suggests me your video! what coincidence. And yes you are right about them costing a fortune. they are obscenely expensive... on the other hand our particular microscope takes seconds for a scan, so maybe the price tag is reasonable...
@aidanmcbeath92022 жыл бұрын
I’d say that when it scans a rounded surface, some of the light is reflected away at an angle which would show as a lower intensity in the data. That would explain why the top of the rounded surface kind of showed but the sides didn’t.
@voncheeseburger3 жыл бұрын
I feel like a faster way to scan this would be to use a PID to try and keep focus by affecting the Z height of the stage. You could start by moving to (0,0) and finding the optimal z height with the highest signal intensity, and then begin a slow raster scan of the subject. Provided the x-y movement was slow enough that the PID had ample time to try and keep the focus optimal, you could just directly save your Z height as the output, essentially eliminating a whole dimension from your problem
@echolambda3 жыл бұрын
My guess is that for some images the normal of the surface matters very much (e.g. the screw). Thus you don't get the light back as it's reflected in a different direction
@BreakingTaps3 жыл бұрын
Yeah I think you're probably right, between being highly reflective and also at a very bad angle, probably very little light probably made it to the sensor.
@Shandrunn3 жыл бұрын
Very cool! My knowledge of optical scanning goes no further than end user where I push button and machine goes brrt, so it's great to see the community come together with advice. I'm very excited to see an upgraded model!
@kajvezd47273 жыл бұрын
i have learned more about building optical set-ups from this video than in all of my 3 years in an electro-optics phd program
@encryptedmaze3 жыл бұрын
Your channel is *insanely* underrated. This is sooo cool.
@coatduck3 жыл бұрын
Dude the cinematography in this is NUTS
@jcims3 жыл бұрын
We're still under 100 comments and I'm subscribed to a chunk of the commenters that left them lol. I feel like I'm with my people here (not for long of course, remember us when you get that gold button!) Amazing job with the intro by the way. Probably obvious but still needs said. Guess I can unpause and watch the rest now haha.
@JV-pu8kx3 жыл бұрын
The correct term is "debossed". deboss: the design is recessed into the surface. emboss: the design is raised from the surface.
@FPiorski3 жыл бұрын
Would something along the lines of modulating the laser diode supply with a 1kHz signal and then bandpass filtering the signal from the photodiode for 1kHz help with environmental noise/whatever? I'm just throwing this out there in case someone who knows more about the subject can comment on it, I just remember seeing this method of reducing 1/f noise during some rf labs at uni.
@BreakingTaps3 жыл бұрын
Oh, interesting! Would love to hear what other folks have to say, this is well above my pay grade in terms of EE. :)
@keantoken64333 жыл бұрын
@@BreakingTaps You could get very high noise suppression with a synchronous or coherent FFT. Especially if the laser modulator DAC and the photodiode ADC are on the same crystal clock (IE the same soundcard), so are in perfect sync.
@keantoken64333 жыл бұрын
@@BreakingTaps Thinking about this more, this would only suppress noise caused by the laser or photodiode. Obscuration from reflections in the optical assembly would still be present, although captured with greater fidelity. In this case if the reflections are repeatable they could be calibrated out (subtracted from the dataset if they are known well enough), and the pilot tone and coherent FFT would still help with this. Perhaps the calibration could be done with a suitably dark calibration target. I would have fun playing with this, I don't know about you.
@lazyman1143 жыл бұрын
@@BreakingTaps If you could replicate a set-up like this, it would probably reduce noise by a fair bit. I'm not sure how you could do it without this expensive equipment though. kzbin.info/www/bejne/qKvdnZyElNuHgdU
@bretcannon38263 жыл бұрын
Modulation and synchronous detection will suppress 1/f noise in the detection electronics and things like room light leaking to the detector. I believe that bigger noise reduction would come from better detecter front end electronics. A good reference is Phil C.D. Hobbs' book "Building Electro-Optical Systems" and especially chapter 18 on detector front ends.
@asusloff2 жыл бұрын
Great project, going to try to repeat it myself) One question, why scanning the whole Z axis? When you have height-to-intencity curve (which is looking somewhat parabolish), just a single measurement makes you to choose a height from one of the two points on that curve. So you could make another measurement in any other point to distinguish them. Moreover this method should work even when your scanning range does not cover all the heights of a specimen, you can calculate the height out of the range.
@smg950u3 жыл бұрын
Punching my ticket, this channel is gonna be in the hundreds of thousands some day. Damn good explanation and camera work, + the start skit. Maybe even pushing a million like TOT...
@DiggaDiggaDug3 жыл бұрын
OMG the kafka-esque deconvolution line XD funniest shit I've heard all week.
@Nevir202 Жыл бұрын
20:57 Hilarious to me, that I know nothing about microscopy or any kind of precision metrology, but when you were talking about the images you took, and the issues they had, I came up with this exact same solution.
@microcolonel3 жыл бұрын
It'd be cool to do this with multiple wavelengths. IR vs. visible topologies for example. Another thing worth looking at might be to use a mild diffuser and concentric photodiodes instead of a single diode or a camera. Because those contours are slopey and fairly linear, you could get instantaneous readings (if I understand the principle at work here lol) and if you set up the diode array intelligently, you possibly reduce the problem with finding the wrong maximum. Another option is reducing the number of measurements with active scanning by processing the samples in real time; if you combine this with the multi-diode thing, maybe the differences between the diodes can get you closer faster. Of course, I get that there's a lot more mechanical complexity involved when you have four or more pinholes, and need chambers for those holes.
@timk.13953 жыл бұрын
I love the way you explain! Thank you for shining the light of knowledge all over like that.
@joe72723 жыл бұрын
It's amazing to think in 14 years we went from first advanced computer in your pocket to garage microscopy and nanolithaography.
@JonathanGeier3 жыл бұрын
Wow this is the best channel! BT, great stuff as always! If it doesn't mess with your workflow too much you should consider discussing the upcoming projects at the end of your videos. Also, I'm sure you run into a ton of problems trying to get these types of amazing things working, you should consider asking for help (suggestions and ideas) in the comments. It would help with the KZbin algorithm, it would get people emotionally invested and it would help you make more videos. Apart from the obvious, I think one of the biggest reasons that AVE and Applied Science have been so successful is that they spend a lot of time fostering genuine discord in the comments. Great videos!
@BreakingTaps3 жыл бұрын
That's a good idea, just might start doing that! One thing that makes me hesitant is that I'm never _quite_ sure what projects will end up working out. E.g. I have a few being worked on right now, but it's pretty common for a project to hit a roadblock and pause indefinitely (the confocal was nearly at that point, before I had some ideas to fix the problems). I'd be potentially worried about sharing projects that will never get turned into a video due to circumstances. Think that would be a problem? I don't want to mislead viewers, but maybe I'm just overthinking things here? :) But that's a good point regarding help - lots of smart people watch these videos and might be able to help me unstick the problem projects, so from that perspective it makes a lot of sense to share a little more proactively. Was just chatting with someone who wanted to see some videos about my failed projects, maybe I can do a somewhat recurring video about work-in-progress and failed projects, see if folks have ideas. In any case, cheers! Appreciate the feedback! Will think over the best way to do that.
@MrLareneon3 жыл бұрын
I wonder if increased rigidity would reduce the input noise? Also cleaning up that terror of an amplifier would definitely help. Getting a decent ADC board with a low noise amplifier and taking multiple samples and averaging them would cut out a ton of noise. If you're feeling crazy ambitious you could try to use a real time digital filter on the incoming data to filter noise out while constantly moving the motion platform in multiple dimensions to track the curve. But the vibrations from the motors would probably be an issue in that case. Anyway fantastic video, I would love to see more! The more I think about it the more it really just seems like an FPGA problem. Now I want to design a scanning laser microscope control board...
@RemcoM0132 жыл бұрын
Since you already have the raspberry pi camera, you could probably reduce the issue with the local maxima: Take the expanded beam, and take only the top half of the spot (so before the beam splitter). Instead of the pinhole and the photodiode, just use the raspberry pi camera. Out of focus away from the lens will look like a half circle on the top half of the sensor, out of focus near the lens will look like a half circle on the top half of the sensor. With the right amount of calibration, you could even do away with the entire Z-positioning, and just use the spot size as a distance indicator. This has the benefit of being fully independent of the reflectivity of the target (as long as enough gets reflected for the camera, but you could also change the photodiode brightness to compensate.
@JustinRK812 жыл бұрын
I find it absolutely amazing that you built this yourself WOW!! Thanks for sharing
@DevashishGuptaOfficial3 жыл бұрын
A further possibility might finding the point spread response of the microscope, which might be useful to later deconvolve the height map based on the point spread response, to get a clearer picture. Kudos!
@1111080743 жыл бұрын
Not sure if anyone mentioned this before but you can make the raspberry pi camera into a photodiode by integrating all pixels. This kind of avoids all the extra electronics for amplification. You can also increase signal by binning pixels which will just increase signal strength at the cost of reduced resolution.
@BreakingTaps3 жыл бұрын
Yep, that's the approach I took at first. It was still too slow :( To overcome shot noise on the sensor you have to leave the pinhole light fairly concentrated on the sensor, so there is only a small region to bin together and find average intensity. Still needs 1-3s of exposure at max gain and ISO.
@stevejin945911 ай бұрын
As mentioned in the end of the video, scan in z axis. If remove the pin hole and change the photodiode to a camera. A single trip scan result 100 bitmap image, let’s say 100steps in a scan trip. By calculate the coefficient of the 100 image, the height image can calculated. That change 10000s single data captures to cpu extensive calculation. In the setup above, a modern cpu with GB memory is needed, and computing time may longer than scan time.
@Totalis19893 жыл бұрын
This is amazing! It's fantastic that you can achieve this level of detail using 3d printed components. The explanation was very useful and covers a topic which isn't well covered elsewhere. Thank you.
@-szega2 жыл бұрын
Dunno if you know about this but it looks like you used a high-Z scope probe cable for connecting the photodiode to the TIA - probe cables are lossy by design and have a few hundred Ohms of resistance per meter, which might be part of your "speed woes"
@kevinroosa13152 жыл бұрын
You may be able to build a small piezo stack for ultrafine travel. Combined with linear encoders, you'd have the ability to move within your typical tolerance to sub-micron. (i.e. stepper moves to position, encoder receives a call to provide the precise position value, and a differential voltage is applied across the piezo stack to provide movement offset) The traditional large assemblies wouldn't be needed for this sort of payload, might be able to DIY something up with a few piezo crystal stacks. Edit: Just checked a local supplier, they're $77 for a stroke length of 17.4 microns, dynamic load force 200N rated.
@helmutzollner54963 жыл бұрын
Wow! Really interesting project. Hope to see more of this soon. Thank you for sharing!
@demetriusmichael2 жыл бұрын
Have you tried pointing the laser at the photo receptor for the expected duration of a scan? That’ll quantify the noise that’s outside of the microscope stage.
@petevenuti735513 күн бұрын
10:17 the basic operating principal and the whole root of what it actually is! I could imagine working with one of those for 20 years and only knowing what it _does_, without knowing what it __*_is_* until now! And I love how you solved a major problem to get it to work with a piece of scrap aluminum foil! Definitely an advantage to know the operating principles for one to be able to do things like that!!!!
@minikretz1 Жыл бұрын
Amazing explanation, I understood the whole process and know why each piece is so important. Great work
@victornpb2 жыл бұрын
If you use a ccd sensor without the pinhole, you could scan for the smallest radius, so intensity doesn't matter. that way you can scan both reflectivity and height at the same time, instead of trying to correlate both
@Niohimself3 жыл бұрын
Do you plan to do some more science with this setup in the future? Some thoughts: I can think of three main causes of error in your measurements, 1) specular / non-matte surfaces might be reflecting light in a very position-dependent way, so that might throw off some of the scans. Usually when they want to make a 3D scan of a big, reflective object, they paint it with an anti-reflective coating so light spreads in a diffuse manner and surface brightness only depends on angle to the light source + shadows. 2) piggybacking on that, curved and slanted objects may cause error because, things "on axis / in reticle" would look dimmer than they are IF the light is reflecting away from the scope instead of diffusely, and things "away from axis" would look brighter because they might have shiny spots on them. 3) have you tried using multiple wavelengths or a white light source? It might reduce the effect of diffraction/interference, though you'd have to deal with chromatic aberration then. Also, it's interesting how the traces of a pcb look sharper (more step-like) under an optical microscope - could this be related to multiple wavelengths?
@BreakingTaps3 жыл бұрын
Possibly, definitely going to take a break from it for a while though. These are good tips, saving for future iterations! Speaking of chromatic aberration, there's a variant called chromatic confocal which I'd like to try. It uses/abuses chromatic aberration to detect Z-height in a single pass (no scanning in Z). Using an optical stack that purposefully introduces chromatic aberration, different colors are stretched and focused to very different z-heights, and then you use a spectrometer to read which color is highest intensity. Looks fun, and should be faster / more precise (z resolution depends on how much you aberrate it, and on spectrometer resolution)
@hci8402 жыл бұрын
I had a similar issue with scan time on an IR camera I built, based on a single-point IR detector and a couple of silicon mirrors, also driven by stepper motors. In the end, I got it to a) scan the scene at very low resolution and then b) automatically pick points of interest (essentially, hot bits) and go back and scan around them at higher res.
@DanteNava3 жыл бұрын
So, when laser scanning Total Internal Reflection (TIR) optics they have to be painted black in order for the laser to see them properly. Some of your data looks like the shinyness of the items affected your data by messing with exposure rates or something. You might want to try a matte black or something to improve clarity. Though it might affect details, it might be a worthwhile experiment since you're looking for relative depth and not a "color picture" Very cool microscope by the way, I don't even know why yet, but I want one!
@BreakingTaps3 жыл бұрын
Makes sense! Might give that a shot, would be an easy test to see how much the specular reflections affect things. And I hear ya about wanting instruments even without a need... that accurately sums up most of my shop experience :)
@FalconFour3 жыл бұрын
I was reeeeaaaally hoping/expecting to see it in operation. Literally laughed out loud when I saw that op-amp circuit. I have no idea how it works (I'm a digital/battery/power guy... poor excuse), but just how you were like "lol I pooped this out" was amazing. Still, you got a sub out of me. Good stuff!
@markp57263 жыл бұрын
Regarding the PCB at 17:10, something transparent (solder mask, a conformal coating, or rosin) could interfere. There's something that could be rosin or conformal coating over the N on the chip to the left (NANYA ram, I'm guessing). Reflections from both surfaces of a transparent material could give you weird data, and I wonder what you'd see if you filter out higher (in Z) peaks when there are multiple peaks of similar intensity.
@defenestrated233 жыл бұрын
Have you thought about using some sort of descent/optimization method to increase the overall scan rate? I.e. quickly sweep through the max extent, find the most promising sub-region, then sweep that region, iterating until you reach some confidence value? Thus you are landing a higher density of voxel captures in the region of interest. Local maxima are a PITA but if you get clever with filter/wavelet/kernel methods you can usually detect global vs local maxima. You can also possibly use wavelet denoising or lowpass filtering and get the gradient and actually use that like a servo to drive the Z to the focal distance, and stop once your delta is small enough. Fitting a parabolic curve might also work. What I would want to try: 1) sweep the whole Z in one direction (z+) to find the rough global max. 2) Skip to just before the global max and scan (z-) until you are definitely trending away from focus 3) sweep (z+) back over the max 4) repeat with smaller sweeps each stage until convergence