User avatar
HermannSW
Posts: 1581
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Creating a RPI-assisted microscope

Fri Dec 28, 2018 3:19 pm

I was searching for µm range movement and finally found it. I recorded air bubbles moving really slowly in spittle.
I did record with 1fps only for time lapse of video when uploaded to youtube because youtube plays at 25fps, 25 times faster:
https://www.youtube.com/watch?v=4SQAbNr ... e=youtu.be
Image

Code: Select all

$ raspivid -md 1 -fps 1 -t 0 -o spittle.h264
^Cmmal: Aborting program

$

Movement is really really slow, since video width is 1920*0.7=1344µm=1.344mm only.
I took two frames from video 150 frames (seconds) apart.
I did measure movement of center big air bubble in that time, and computed 0.347µm/s speed(!) from that:

Code: Select all

$ bc -ql
sqrt(50^2+55^2)*0.7/150
.34687493743743179552
This very low speed is a nice contrast to my very fast moving inhouse circular robot experiments (18.9m/s or 68km/h) ... ;-)


I have just one question regarding the colored horizontal lines:
I have never seen these when recording with raspivid.
I use official Raspberry 5.1V 2.5A mains adapter.
Recorded on Raspberry 3B+ with v1 camera.
Can these (seldom) frame distortions be caused by "--fps 1"?
Image


P.S:
I did reboot the Pi 3B+ and took another recording -- all fine now, no horizontal line distortions ...
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1581
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Creating a RPI-assisted microscope

Sun Dec 30, 2018 8:04 pm

Yesterday I bought a 1m aluminum tube and tried that between Raspberry v1 camera sensor and lens.
I was not able to get any image visible, although the setup (1m aluminum tube in microscope) was impressive:
https://twitter.com/HermannSW/status/10 ... 3319776257

Next I did cut a 13cm aluminum tube, superglued two M12 mount rings to it and tried with that setup (distance sensor-lens 15cm).
I got an image, but was not able to get light under control:
https://twitter.com/HermannSW/status/10 ... 0843364353

Today I did cut less than 7cm aluminum tube, resulting in 10cm between sensor and lens.
This is a nice and stable setup (camera sensor as well as lens fully screwed) -- my Raspberry microscope.
Again two lego pieces fit perfectly to have aluminum tube mounted very firmly:
Image


There is a problem in measuring resulution as only one of the FPC2DIP board contacts shows up in 5MP v1 camera image.
I learned that I can move the camera view slightly left/right by pressing the microscope wheel up/down.
I took 4 overlapping 5MP photos and copied them into one 8656x2080 pixel photo for measuring:
Image


Measuring middle of left and right contact (apart exactly 2*0.5=1mm) showed 0.153µm/pixel resolution!
Same tube, same lens but v2 sensor would give 0.121µm/pixel resolution.

I wanted to take photo of something from Pi Zero that fully fits the 5MP image.
But given the resolution that was a difficult task.
Finally I found it, the little white dot between "U1" and the Broadcom SoC:
Image


And this is the 5MP photo taken:
Image


With 0.153µm/pixel the width of the photo corresponds to 2592*0.153=396.6µm=0.3966mm(!).
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

rwb27
Posts: 1
Joined: Fri Aug 30, 2019 1:49 pm

Re: Creating a RPI-assisted microscope

Fri Aug 30, 2019 2:19 pm

Hello, with apologies for posting on a relatively old thread, I thought it might be relevant to mention the OpenFlexure Microscope project that I've been involved with for the last few years. https://openflexure.org/ It's an open-source, Raspberry-Pi based microscope, with several different optics modules and even an automated translation stage to move the sample and focus. It's mostly 3D printed, plus the optical parts and the Raspberry Pi. It's intended for use in science labs, so I'd be interested to see what you think of it.

User avatar
HermannSW
Posts: 1581
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Creating a RPI-assisted microscope

Sat Aug 31, 2019 12:47 pm

rwb27 wrote:
Fri Aug 30, 2019 2:19 pm
It's an open-source, Raspberry-Pi based microscope, with several different optics modules and even an automated translation stage to move the sample and focus.
On the project page it is stated that moving the object and focus can be done with sub-micron (<1µm) precision.
That sounds helpful, it means one step with v2 camera and the 10cm distance from v2 sensor to lens described above resulting at 0.12µm/px would move the image by less than 8 pixels.

Perhaps you can help to fill the gap between maginification of eg. 100× mentioned on project page and 0.12µm/px as I determined with v2 camera in above mentioned scenario?
Does the magnification for 0.12µm/px is dependent on the size of the monitor used to display the image?
If so, what is the formula to translate between Xµm/px on a Y" monitor and Z× magification?
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1581
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Creating a RPI-assisted microscope

Tue Nov 05, 2019 7:47 am

HermannSW wrote:
Sun Dec 30, 2018 8:04 pm
...
Today I did cut less than 7cm aluminum tube, resulting in 10cm between sensor and lens.
This is a nice and stable setup (camera sensor as well as lens fully screwed) -- my Raspberry microscope.
Again two lego pieces fit perfectly to have aluminum tube mounted very firmly:
Image


There is a problem in measuring resulution as only one of the FPC2DIP board contacts shows up in 5MP v1 camera image.
I learned that I can move the camera view slightly left/right by pressing the microscope wheel up/down.
I took 4 overlapping 5MP photos and copied them into one 8656x2080 pixel photo for measuring:
Image


Measuring middle of left and right contact (apart exactly 2*0.5=1mm) showed 0.153µm/pixel resolution!
Same tube, same lens but v2 sensor would give 0.121µm/pixel resolution.
...
0.153µm/pixel resolution is 153nm/pixel.

From:
https://en.wikipedia.org/wiki/Optical_m ... imitations
... the resolution d ... In practice the lowest value of d obtainable with conventional lenses is about 200 nm. ...
How does the 153nm/pixel measured above relate to the d=200nm bound?
Does it mean that with 153nm/pixel resolution a pixel in Pi photo is already below what is possible and has to show unclear?
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

gordon77
Posts: 4221
Joined: Sun Aug 05, 2012 3:12 pm

Re: Creating a RPI-assisted microscope

Tue Nov 05, 2019 8:55 am

Just a thought..

Has it really resolved it down to that level ? Looking at part of your image are features resolved to a pixel level ?

I think you would need a fine grating to determine that.
Attachments
crop.jpg
crop.jpg (9.03 KiB) Viewed 632 times

User avatar
HermannSW
Posts: 1581
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Creating a RPI-assisted microscope

Tue Nov 05, 2019 8:37 pm

gordon77 wrote:
Tue Nov 05, 2019 8:55 am
Just a thought..
Thank you.
Has it really resolved it down to that level ? Looking at part of your image are features resolved to a pixel level ?
Obviously not (because visible light does allow for d=200nm only).

What the image shows is that 1mm distance middle left to middle right contact is 6528 pixel.
So we have 153nm DISTANCE per pixel (and not resolution).

Code: Select all

[email protected]:~ $ echo "scale=2; 1000000/6528" | bc -ql
153.18
[email protected]:~ $ 
I think you would need a fine grating to determine that.
Good idea!
I searched a lot and found 0.1mm and 0.01mm microscope-micrometers.
I did not find any 0.001mm=1µm microscope-micrometers, perhaps because of minimal optical d=0.2µm.

So I did order this microscope-micrometer in China for 9$.
It has circles with 0.15mm and 0.07mm diameter in addition:
Image


That will arrive here in Germany at end of the month.
Therefore I did order just a 0.01mm version for 14$ on amazon that will arrive tomorrow:
Image


P.S:
I just did the math, the 0.07mm diameter cross dot will have a diameter of 457 pixels -- will be interesting to see how "round" it will look under Pi microscope:

Code: Select all

$ echo "scale=2; 6528*0.07/1" | bc -ql
456.96
$ 
Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1581
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Creating a RPI-assisted microscope

Wed Nov 06, 2019 9:43 pm

Package arrived today, I used 20° F2.0 16mm 1/3" M12 lens as before, but did not completely screw it into bottom part of aluminum tube:
https://de.aliexpress.com/item/32822002070.html

This is the setup, you can read "1 DIV = 0.01 mm" below circle around my shortest ruler ever.
Total length of scale is 1mm that is subdivided into 100 divisions,each division is 0.01mm:
Image


This is first 5MP photo from ruler (I used a v1 NoIR camera, so I used "-awb greyworld" with raspistill):
Image


And this is 5MP photo of part of the circle around the ruler:
Image


Total horizontal length of ruler frame 71 ticks or 0.71mm.
Horizontal distance per pixel is 274nm this time (because of the not ompletely screwed in M12 lens):

Code: Select all

$ echo "scale=2; 0.71*1000000/2592" | bc -ql
273.91
$ 

For looking at the pixel level, I did cut out leftmost part containing circle arc 1:1 from last photo:
Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1581
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Creating a RPI-assisted microscope

Thu Nov 07, 2019 11:56 pm

I tested whether my 600dpi HP M102w laser printer can help -- and it cannot.

I found Perl module "PostScript::Simple" and decided to use it to create PostScript files for microscope testing:
https://metacpan.org/pod/PostScript::Simple

I started with the example on that page, and ended up with this simple script:

Code: Select all

use PostScript::Simple;
 
$p = new PostScript::Simple(papersize => "A4",
                            colour => 1,
                            eps => 0,
                            units => "mm");
 
$p->newpage;
 
for (my $i=1000; $i <= 1999; $i+=20) {
  for (my $j=1000; $j <= 1999; $j+=20) {
    $p->box( {filled => 1}, $i/100,$j/100, ($i+2)/100,($j+2)/100);
  }
}

$p->output("file.ps");
These commands show what gets created on the monitor:

Code: Select all

perl grid.pl
ps2pdf file.ps
evince file.pdf
I played with the parameters, and ended with step width 20/100 millimeter.
Perhaps slightly better results can be achieved with inch or pt (point, 1/72 inch).

I placed the 1cm² printed output under the microscope, and did overlay it with the microscope-micrometer.
In order to see the higher scale, or the lower printed pattern, I had to turn microscope wheel.
Nothing in the scene changed, repeatedly changing focus between both layers always shows the same unchanged scene.

Next I took two 5MP raspistill images as before, one of the scale, and one of the printed dots.
No I opened the scale image with gimp, used "Threshold" function to convert into b&w image, and stored as .pgm (portable greymap) for alpha blending.
And I inverted the colors and stored as .pbm (portable bitmap).
Finally I did overlay the inverted (part of scale) with the .pgm file as alpha file using pnmcomp alpha blending.
Image


Too coarse, too imprecise, the 3x4 dots are not helpful in determining what the real resolution of Pi microscope is.

I will have to wait for the 0.07mm diameter filled circle to arrive.
Or find something else precise with with known length in micrometer range.
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1581
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Creating a RPI-assisted microscope

Fri Nov 08, 2019 3:01 pm

HermannSW wrote:
Thu Nov 07, 2019 11:56 pm
Or find something else precise with with known length in micrometer range.
I did find two somethings working in micrometer range!



First I did buy a 0.001mm resolution electronic micrometer, for 46$ on German amazon prime arriving tomorrow:
https://www.amazon.com/Neoteck-Digital- ... ref=sr_1_6
Image
This will allow for micrometer resolution measurements. And the flat surface of the measuring beds should allow to operate the micrometer horizontally and let the beds touch the 0.01mm scale in order to see both, scale and beds at same time with Pi microscope.

I learned that zeroing is important (the above product allows for that). And that too much pressure might be a problem -- I plan to work with 0 pressure. The product has an RS232 serial interface as well, not sure whether I can make use of that.


Second I found a way to initiate a single <=3µm linear move with a 28BYJ-48 stepper motor!

That stepper motor allows for half-steps, with stride angle 5.625° a half step is 2.8075°.
Motor is 5V motor, so will drive it from 5V Arduino Uno.
Just found L293D IC and will build driver according:
https://lastminuteengineers.com/stepper ... -tutorial/
Standard Arduino stepper library does not support half-stepping, but here it is described how to do:
https://www.teachmemicro.com/control-28 ... r-arduino/

Code: Select all

AccelStepper stepper(HALF4WIRE , motorPin1, motorPin3, motorPin2, motorPin4);
This is the motor shaft of 28BYJ-48 stepper motor:
Image
The radial part has diameter 5mm.
Define the angle 0° where the radial part and capped part join.
Now starting at 0°, doing a half-step into radial part direction, let us calculate the linear part:

Code: Select all

$ bc -ql
scale=6
pi=4*a(1)
deg=pi/180
hstep=360/64/2
r=2.5
r*(1-c(hstep*deg))
.003012
1 minus cosine of step angle is the linear move for 1mm radius, multiplied with r gives 3µm(!).
This is the maximal step when angle 0° is involved, it can be even lower.
In case motor is at postion -1°, the next half step goes to (hstep-1)°.
The linear move for this is much less than 3µm, only 0.9µm:

Code: Select all

r*(c(-1*deg)-c((hstep-1)*deg))
.000870

Whatever linear distance will be made when going from <=0° to >0° with a half step, that distance is <=3µm.
And the electronic micrometer bought will show how far that linear movement really went!

So instead of using thumb to trigger the electronic micrometer control lever, stepper motor shaft will do that.
Last edited by HermannSW on Sat Nov 09, 2019 4:57 pm, edited 1 time in total.
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1581
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Creating a RPI-assisted microscope

Fri Nov 08, 2019 7:25 pm

> The product has an RS232 serial interface as well, not sure whether I can make use of that.
>
I can -- this feedback should allow the Arduino to automatically(!) determine the 0° position ...


And now a big WOW for me.

I did run AccelStepper library Bounce demo:
https://www.youtube.com/watch?v=VFtnsZ0py5I
Image


The demo moves the stepper motor roughly a half revolution, but it did that with 500 steps?!?!?

I did step back and used Arduino Playground Stepper library instead, demo stepper_OneStepAtATime.
That demo does a single step and then waits for 500ms, repeatedly
I changed the wait to 20ms and watched the step count output on serial monitor.
It took slightly more than 2000 steps to complete a full revolution ...

Next I used DuckDuckGo to finally find this page:
https://dronebotworkshop.com/stepper-mo ... h-arduino/

From section "Demo 1 – 28BYJ-48 Unipolar Stepper with ULN2003":
The 28BYJ-48 is a 5-wire unipolar stepper motor that moves 32 steps per rotation internally but has a gearing system that moves the shaft by a factor of 64. The result is a motor that spins at 2048 steps per rotation. It should be noted that some of these motors may have a different gearing system so the number of steps per rotation of your motor may not be the same.
Wow, my stepper motor has the described gearing system, and 2048 steps do a full revolution!

Now back to the math from previous posting -- what does change by that?
Phantastic change, the linear step from <=0° to >0° is guaranteed to be <=0.012µm=12nm !!!

Code: Select all

scale=6
pi=4*a(1)
deg=pi/180
hstep=360/64/2
r=2.5
r*(1-c(hstep*deg))
.003012
step=360/2048
r*(1-c(step*deg))
.000012
Using the generalized formula of linear distance with start angle a allowed me to determine the maximal angle that results in a linear distance change of less than 1µm. That angle is a=7.388°, and allows for 42(!) consecutive steps from 0° degree position with each linear distance change less than 1µm. I would never have thought that less than 2$ stepper motor would allow for many such sub 1µm steps ...

Code: Select all

a=0
r*(c(a*deg)-c((a+step)*deg))
.000012
a=7.388
r*(c(a*deg)-c((a+step)*deg))
.000997
a/360*2048
42.029056
r*(1-c((a+step)*deg))
.021752
The last calculation shows that the total linear distance change introduced by 42 steps from 0° position is slightly less than 22µm!

22µm is slightly more than 2 diversions of the 0.01mm scale.
This should allow for nearly arbitrary positioning the flat measuring pad over a 2 diversion range.

Will verify this tomorrow when the electronic micrometer will have arrived ...
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1581
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Creating a RPI-assisted microscope

Sat Nov 09, 2019 1:51 pm

I got corrected on twitter that 2048 steps per revolution of stepper motor is not correct.
So I read datasheet again, and it says on stride angle: 5.625°/64
The total number of steps per revolution is therefore 360°/(5.625°/64)=4096!

I did run this AccelStepper demo I created with half-stepping:
It starts at 0(0°), moves to 2048(180°), then to 1024(90°), followed by 3072(270°) and then repeating to 0(0°):

Code: Select all

#include <AccelStepper.h>

AccelStepper stepper(AccelStepper::HALF4WIRE, 2, 3, 4, 5);

int i=0;
int A[]={2048,1024,3072,0};

void setup()
{  
  stepper.setMaxSpeed(800);
  stepper.setAcceleration(50);
  Serial.begin(9600);
}

void loop()
{
  if (stepper.distanceToGo() == 0)
  {
    Serial.print("moveto(");
    Serial.print(A[i]); Serial.println(")");
    stepper.moveTo(A[i++]);
    i %= sizeof(A)/sizeof(A[0]);
  }
    
  stepper.run();
}

I verified with that sketch that stepper motor indeed has 4096 half-steps per revolution.

Now back to the math from previous posting -- what does change by that?
The linear step from <=0° to >0° is guaranteed to be <0.003µm=3nm !

Code: Select all

$ bc -ql
scale=6; pi=4*a(1)
deg=pi/180
hstep=360/64/2
r=2.5
r*(1-c(hstep*deg))
.003012
hstep=360/4096
scale=8
r*(1-c(hstep*deg))
.00000295
Using the generalized formula of linear distance with start angle a allowed me to determine the maximal angle that results in a linear distance change of less than 1µm.
That angle is a=15.05°, and allows for 171(!) consecutive steps from 0° degree position with each linear distance change less than 1µm.
I would never have thought that less than 2$ stepper motor would allow for many such sub 1µm steps ...

Code: Select all

a=0
r*(c(a*deg)-c((a+hstep)*deg))
.00000295
scale=6
a=15.05
r*(c(a*deg)-c((a+hstep)*deg))
.000997
a/360*4096
171.233280
r*(1-c((a+hstep)*deg))
.086747
The last calculation shows that the total linear distance change introduced by 171 steps from 0° position is slightly less than 87µm!
That allows to cover more than 8 (of the 100) 0.01mm micrometer divisions.

The 4096 steps per revolution of stepper motor (and the small radius 2.5mm of motor shaft) even keep the maximal linear distance change small.

First the maximal angle needs to be computed, when the capped part of motor shaft is vertical, it is 53.13°:

Code: Select all

x=1.5
y=sqrt(r^2-x^2)
y
2.000000
a=atan(y/x)/deg
a
53.130980
Image


Last step linear distance change to that angle is 3.062µm only.
And the total operating range of this linear actuator is 0..1mm:

Code: Select all

r*(c((a-hstep)*deg)-c(a*deg))
.003062
r*(1-c(a*deg))
.999997
This allows for nearly arbitrary positioning the flat measuring pad over the whole 1mm range of 0.01mm micrometer, because at least 3 steps will be between any pair of successive scale divisions.

There are 604 steps in that range, and average linear distance change per step is 1.655µm:

Code: Select all

a/360*4096
604.512256
1/604
.001655
From 0° to 53.13° linear distance goes from 0 to 1.
If more steps are added, then from 53.13° to 106.26° distance goes back from 1 to 0.
Finally from 126.26° to 180° distance keeps constant at 0 because of radial part of motor shaft.


Summary for this high precision linear actuator:
Operating range: 0..1mm
Steps: 604
Linear distance change per step: min=3nm, max=3.062µm, avg=1.655µm
Feedback from 0.001mm electronic micrometer allows for automatic 0° calibration.
Last edited by HermannSW on Sun Nov 10, 2019 6:46 pm, edited 1 time in total.
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1581
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Creating a RPI-assisted microscope

Sat Nov 09, 2019 8:14 pm

The electronic 0.001mm resolution micrometer arrived.
I created a video of it, with some tests (measure thickness of 1€, measure thickness of microscope slide).
Positive was, that the measured working range 0..14.007mm was bigger than advertized (0..12.7mm):
https://www.youtube.com/watch?v=S67X0Xqn3Wo

The plan is to lay the 0.01mm micrometer I have under new electronic micrometer test pads.
Unfortunately the height in electronic micrometer allows for 14.6 mm only.
And microscope slides (as the 0.01mm micrometer) are 75x26x1 mm.

I read a lot, and people talk much about problems with cutting glass.
I tried different methods on a test glass piece and broke a lot.
Because I don't have a diamond glass cutter, and I did not want to wait for next week for one to arrive, I tried my Dremel with a normal cutting disk. I did cut a not deep line into the glass, and then just broke one piece away from the other. I did so several times, and ended up with a small piece of microscope slide that contains the fully functional micrometer. This is first test setup to verify that mircometer did not get badly affected:
Image


This time I intentionally did not put white paper below micrometer. Instead I directly place the mircrometer onto aluminum alloy microscope stand base. I took a md=1 video of changing focus between micrometer diversions, aluminum alloy, diversions, alloy, ...:
https://www.youtube.com/watch?v=EQIJA2W4y3M
Image


I understand that the 1mm microscope slide glass between micrometer and aluminum alloy base do not allow for same focus. I looked and the micrometer diversions are on top of glass. So I did put the micrometer with diversions down onto aluminum alloy base and was able to capture both together:
Image


This is a good basis for placing the micrometer diversions directly below the two flat electronic micrometer test pads.

Plan is to to place at least top test pad of electronic micrometer onto 0.01 micrometer diversions, that the 0..1mm operating range of stepper motor linear actuator maps the top test pad to the 100 diversions 1mm of 0.01mm micrometer. The range on electronic display can be zeroed and maps to 0..1000µm for same 1mm.
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1581
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Creating a RPI-assisted microscope

Sun Nov 10, 2019 8:37 pm

I did really build the high precision linear actuator, and it works fine.
Detailed build instructions, needed Arduino sketches (I have to ported to Raspbian yet), ...:
https://forum.arduino.cc/index.php?topic=645745.0

Image
Operating range: 0..1mm [0..1038µm measured]
Steps: 604 [600 steps used for measurement]
Linear distance change per step: min=3nm, max=3.062µm, avg=1.655µm

Animation shows small part of this youtube video, that demonstrates repeatability
(moving two times to 0,100,200,300,400,500,600 results in identical micrometer readings 0/276/530/736/887/991/1038):
https://www.youtube.com/watch?v=Ys0vzWmJT8A
Image


P.S:
While I use it as linear actuator, the 4096 steps allow for super fine radial actuator as well-
A half-step angle-delta is .088°.
And the half-step arc on 2.5mm radius of motor shaft has length 2.5*2*pi/4096=3.8µm(!).
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

zwieblum
Posts: 21
Joined: Sun Jul 07, 2019 6:55 pm

Re: Creating a RPI-assisted microscope

Mon Nov 11, 2019 11:18 am

impressive :)

@ image quality: you can improve the quality quite a bit if you remove dark current and bracketing.

User avatar
HermannSW
Posts: 1581
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Creating a RPI-assisted microscope

Wed Nov 13, 2019 9:39 pm

Just learned today how to control ULN2003 driver and 28BYJ-48 stepper motor using C pigpio library.
So Raspberry can control the high precision linear actuator as well:
https://www.raspberrypi.org/forums/view ... 8#p1565748
Image

I found a way to greatly reduce the maximal linear distance change of linear actuator as well.
Not sure yet whether factor is 10, 100 or even 1000 (1000 would mean that maximal linear distance change would be 3nm!!).
But tomorrow automatic servo PT camera centering on airplane while recording needs to be done first,
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

ethanol100
Posts: 587
Joined: Wed Oct 02, 2013 12:28 pm

Re: Creating a RPI-assisted microscope

Thu Nov 14, 2019 5:59 pm

You could have a look at CD/DVD/BluRay(from Wikipedia):
Image

Looking at the distance between lines you end up with 1.6um for CD, 0.74um for DVD and 0.32um for Blu-rays.

It could be necessary to disassemble an old one to get rid of the protective layers....

Return to “Camera board”