macro-rail, micro-processor, nano-steps

A forum to ask questions, post setups, and generally discuss anything having to do with photomacrography and photomicroscopy.

Moderators: Pau, rjlittlefield, ChrisR, Chris S.

rjlittlefield
Site Admin
Posts: 21109
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

I have just tested the full rotation by the step-size of 635 microns.
...
So, the output of the gear-box has been rotated by this step exactly 360°.
OK, good. That leaves an unexplained scaling coefficient of roughly 2 someplace in the optical measurement, but for your situation I'm not worried about that.
In order to be able do that I had to change the variable numberOfSteps from int to float because my units are nano-meters :-)
Float is OK for this particular situation, but in general, a better choice would be type "long". For counting, floats have two disadvantages. One is that on Arduino floats have only 24 bits of precision, so the maximum integer value they can store exactly is less than 17 million. The other is that they take a lot longer to compute. Neither of these really matters in your move loop, but it's something to keep in mind for other applications.

--Rik

Adalbert
Posts: 1181
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello Rik,
”Arduino floats have only 24 bits of precision”
Many thanks for the hints!
BR, Adi

TheLostVertex
Posts: 315
Joined: Thu Sep 22, 2011 9:55 am
Location: Florida

Post by TheLostVertex »

rjlittlefield wrote: Float is OK for this particular situation, but in general, a better choice would be type "long". For counting, floats have two disadvantages. One is that on Arduino floats have only 24 bits of precision, so the maximum integer value they can store exactly is less than 17 million. The other is that they take a lot longer to compute. Neither of these really matters in your move loop, but it's something to keep in mind for other applications.
And a third is that float is sometimes inaccurate, especially with decimals. If you are doing any sort of math there may be unexpected behavior. Floating point numbers are some times not communicative or distributive when working with certain numbers. So its pretty easy to get hit by a rounding error and not know it. As Rik said, I dont think this would likely come into play either. But its worth knowing about.

And while we are on the topic of coding, digital write on Arduino is agonizingly slow. You will greatly increase your loop speed (and possibly motor function, depending on driver) by using something else.

See this link for more information and testing about the Arduino digitalwrite,
http://www.billporter.info/2010/08/18/r ... uino-pins/

Or if you do not want to do the translation manually, https://code.google.com/archive/p/digitalwritefast/

Adalbert
Posts: 1181
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello Steven,
Many thanks for the links!
But I’m not sure if the faster digitalWrite improves the speed of the motor.
Please take a look at the loop for the movement:
For every micro-step a delay of 200 micro-seconds is used anyway:

Code: Select all

  
for &#40;long i = 0; i < numberOfSteps; i++&#41; 
  &#123; 
    digitalWrite&#40;_pinStep, LOW&#41;;  // This LOW to HIGH change is what creates the 
    digitalWrite&#40;_pinStep, HIGH&#41;; // "Rising Edge" so the easydriver knows to when to step. 
    delayMicroseconds&#40;200&#41;;       // This delay time is close to top speed for this particular motor. Any faster the motor stalls 
  &#125; 
BR, Adi

Adalbert
Posts: 1181
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello everybody,

After I had stacked a spider I tested the step-size and the backlash of the rail with Zerene.
The calculated step-size should be 0,0044mm for the aperture 0.25 .
Two photos a level of the DOF should be taken with the NIKON CFI BE Plan 10x / 0,25 .

Expected result of test with Zerene (10 step forwards and then 10 steps backwards; first move then shot):

Code: Select all

	
S == calculated step-size = 0,0044mm
M == magnification = 40x	
W == width of the sensor = 36 &#91;mm&#93; 
X == expected offset in Zerene      =  S / W * M    =  0,0048889
Image

As far as I can see the real step-size is a little bit bigger then the calculated one.
The backlash is also visible between the last step forwards and the first step backwards.


BR, Adi

rjlittlefield
Site Admin
Posts: 21109
Joined: Tue Aug 01, 2006 8:34 am
Location: Richland, Washington State, USA
Contact:

Post by rjlittlefield »

That looks like very clean data, not surprising since you're now measuring a step size that's about 30 pixels on sensor, and a couple of degrees' rotation of the micrometer screw.

I'm still intrigued by exactly what happens when the rail reverses direction. Normally, uncorrected backlash results in some "lost movement" where the rail moves less than expected when reversed. But in your graph, the rail looks to move more than expected when the direction is reversed. It's the sort of behavior that I would expect to see in a system that is designed to compensate for backlash but happens to be over-correcting.

Am I correct in assuming that your controller does not attempt to compensate for backlash?

--Rik

Adalbert
Posts: 1181
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello Rik,
“ Am I correct in assuming that your controller does not attempt to compensate for backlash?”
Yes, the rail is moved by the simple software step by step without any handling of the backlash. The stop current on TB6560 is set to 20% .
But I’m thinking of adding of some steps to the range in order to compensate the different distance covered by thy rail (dependent on direction).
My next problem is the mounting of the shaft coupling.
Maybe I should use a “casting silicone” or something like that, because the currently used plastic-film is slick.
BR, Adi

Adalbert
Posts: 1181
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello everybody,
The current version of my macro-slat looks as follows:
Image
BR, ADi
Last edited by Adalbert on Fri Mar 23, 2018 4:56 am, edited 1 time in total.

Adalbert
Posts: 1181
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello everybody,
I have just assembled a new Version of the slat. This time I have used the Arduino Uno instead of the Nano.

Image

Image


On this picture you also can see a sensor of the light-intensity, which I am using now for the test of the flash.

So, I have changed the program as follows:

Code: Select all

pinMode&#40;10, INPUT&#41;;  digitalWrite&#40;10, LOW&#41;;            // LCD back-light
LiquidCrystal*  lcd = new LiquidCrystal&#40;8,9,4,5,6,7&#41;;  // instead of 12,11,5,4,3,2
Rail* slat = new Rail&#40;13,12&#41; ;                         // instead of  8, 9 
Camera* canon = new Camera&#40;11,9,7300&#41; ;                // pin 11 instead of pin 10
And the rail looks like that:
Image

BTW, and the price of the rail & controller? The total comes to $60

BR, ADi
Last edited by Adalbert on Fri Mar 23, 2018 4:54 am, edited 1 time in total.

Adalbert
Posts: 1181
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello everybody,
Enclosed you will find my current software for the Arduino Uno.
https://drive.google.com/drive/folders/ ... jVUY3RBZmM
The structure of the main menu:
- "Rail GearBox 100"
- "Rail No GearBox "
- "2 Drops 2 Valves"
- "2 Drops 1 Valve "
- "Photo Sensor "
- "MeasureByZerene "
- "Move Step "
- "Rail Flash Movie"
BR, ADi

lonepal
Posts: 321
Joined: Sat Jan 28, 2017 12:26 pm
Location: Turkey

Post by lonepal »

Dear Adalbert;

Thanks for sharing your experiences.
I have questions.
I am inspecting the chinese made rail which has 3 support rods on the bottom Picture for a long time.
My questions;

1) Does it have any backlash and the movement is precise and smooth?
2) What is the minimum step size?
3) How is the build quality?

Thanks for your help.
Regards.
Omer

Adalbert
Posts: 1181
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello lonepal,
ad 1: I haven’t measured the backlash up to now
ad 2: the smallest step = 0.00125mm
ad 3: the quality is OK but I added a L-element ( right corner )
BR, ADi

lonepal
Posts: 321
Joined: Sat Jan 28, 2017 12:26 pm
Location: Turkey

Post by lonepal »

Thanks Adi!
It looks like it recompenses it's price.
I will think about buying it.

One more question.
Can you advice me a gearbox to use with nema17 motors?
Thanks.
Regards.
Omer

Adalbert
Posts: 1181
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello lonepal,
It depends on that, which lenses you want to use.
If you wanted to use the microscope-lens with the aperture of 0.55 then you would need the step-size=0,0006mm in order to take 3 pictures a DOF.
For the aperture of 0.80 you would need the step-size=0,0003mm. If you wanted to do more than 3 pictures a DOF then you would need smaller steps.
So, I would suggest 5:1 or max. 14:1 would be enough.
BTW, with the step size 0.00125mm you can use the lenses till the aperture 0.40 (0,0011mm expected).
BR, ADi

lonepal
Posts: 321
Joined: Sat Jan 28, 2017 12:26 pm
Location: Turkey

Post by lonepal »

Dear Adi;
Thanks for the explanations!
How did you connected the gearbox to the micrometer?
I checked your photos and saw it.
Is this a special coupling that gets longer during motion?
As I know all micrometers move when we spin them.
How did you eleminated this problem? With that red special coupling?
Regards.
Omer

Post Reply Previous topicNext topic