How does StackShot know when it has reached the rail limits?

Have questions about the equipment used for macro- or micro- photography? Post those questions in this forum.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

iconoclastica wrote:
Do you have a method for knowing your "zero" independent of the value stored by the driver/your software? I've done some limited testing but nothing that can independently confirm the repeatability of my zero position to within 1 step (2.5um).
I have a few suggestions that don't answer your needs, mainly for lack of precision, but they may give starting point for new thoughts:
- Digital calipers contain linear encoders that can be tapped. Typically they are more precise than 0.1mm and may have reference to a an absolute zero. Right now I am trying to turn a pair of them into a position reference for the x-y stage on my microscope, but it's too early yet to report success.
- Likewise, when I dismantled a large format inkjet printer, I found two position encoders: a linear one for the print head position and a circular one for the paper transport. Both are transparent plastic (sheet/strip) with engraved markings that are optically read. I didn't salvage the reader component, but I suppose they can be found in any printer. Even if you don't use them for positioning, they still might come in useful for motion detection.
- The thought crossed my mind that e.g. a laser beam shot through a narrow hole (e.g. the needle of syringe, o a pair of apertures) would mark a pretty exact position (but maybe not enough...).
Felix,

That's a great idea using the digital caliber if one could figure out how to mount it or remove the sensor. Keep us informed of your progress.

Here's a couple sites about reading these calibers.

https://pylin.com/2017/05/26/reading-di ... m-arduino/

http://www.shumatech.com/support/chinese_scales.htm

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

Chris S.
Site Admin
Posts: 4042
Joined: Sun Apr 05, 2009 9:55 pm
Location: Ohio, USA

Post by Chris S. »

iconoclastica wrote:Digital calipers contain linear encoders that can be tapped. . . .

Right now I am trying to turn a pair of them into a position reference for the x-y stage on my microscope, but it's too early yet to report success.
Just in case you haven't already seen them, iGaging digital readouts might be easier to integrate for this purpose. I believe these may be available more cheaply on Amazon, and a few other makers have similar products.

Also--Mike, those are two very informative links!

--Chris S.

kaleun96
Posts: 270
Joined: Sat Oct 20, 2018 3:47 pm
Location: Stockholm, Sweden

Post by kaleun96 »

Just thought of another possible method to detect the "limits". Set the motor current to a very low value, just enough for reliable movement, then slowly run into the rail stops and record the "limit"
Do you mean you would then "mark" the position of the rail at this point manually or that you would try to determine whether the motor has stalled based on a change in current?
You can add a optical coupler to the flash and use that as feedback but requires you open up the flash and install the coupler.
This is an interesting idea as well. I think it would also be possible to calibrate a photodiode to sit in the open near the subject and only trigger on a flash as well but to me it's too much hassle dealing with op-amps to get the perfect sensitivity out of the sensor.
Another option would be to include a built in strobe/flash recycle delay that covers the recycle time in the code, since I already have a shutter time and camera trigger & settling delay, this would be just another parameter.
I currently have done this but like you I would like to optimise the time between photos. It's amazing that I can do a 60-shot stack in less than 2-3 minutes but if I think about using this controller with a more portable setup for outdoors I would like the fastest possible stack sequence.

Thanks for your other ideas too, lots of food for thought! Think I will experiment with the Stall detection in the TMC2130 over the next weeks.

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

Do you mean you would then "mark" the position of the rail at this point manually or that you would try to determine whether the motor has stalled based on a change in current?
Yes, "mark" meaning recording the location of the rail stop in the motor controlling program for use as a limit. This would not look for a change in current, just a physical stop of the rail movement.

Have thought about using a simple integral/derivative circuit to detect the change in supply current when the rail hits the stop. Here's a simple circuit using a differential amp with a couple npn (2N3904) and a few resistors & caps. This should work to detect the motor current increases due to a stop limit. Note the label motor current waveform should be the voltage on the right side of Rd, since as motor current increases this voltage drops. You could replace the diff amp with an Op-amp or comparator if you wish. I haven't got the time to build this but anyone is welcome to give it a try.

Image

During the course of this discussion I realized I have some magnetic limit sensors (Panasonic SUNX GX-F12A) and the Tic-500 controller I'm using can be setup for a limit detect and even includes a Homing Command. Now I'm considering this, even with the additional 3 wires per motor :roll:

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

I simulated the circuit and it behaves as expected, added an additional resistor in series with the base of the non transistor to better equalize the base current drop.

I also used the same concept with a Op-Amp (or Comparator) and it behaves well also. The Op-Amp is simpler, so I may order some cheap ones to play around with someday.

I've included some waveform plots that show motor current from 800ma to 1000ma indicated a Stop Limit. R1 and L1 are just to model a motor coil.

Image
Image
Image


Image

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

mawyatt wrote:
Do you mean you would then "mark" the position of the rail at this point manually or that you would try to determine whether the motor has stalled based on a change in current?
Yes, "mark" meaning recording the location of the rail stop in the motor controlling program for use as a limit. This would not look for a change in current, just a physical stop of the rail movement.

Have thought about using a simple integral/derivative circuit to detect the change in supply current when the rail hits the stop. Here's a simple circuit using a differential amp with a couple npn (2N3904) and a few resistors & caps. This should work to detect the motor current increases due to a stop limit. Note the label motor current waveform should be the voltage on the right side of Rd, since as motor current increases this voltage drops. You could replace the diff amp with an Op-amp or comparator if you wish. I haven't got the time to build this but anyone is welcome to give it a try.

Image

During the course of this discussion I realized I have some magnetic limit sensors (Panasonic SUNX GX-F12A) and the Tic-500 controller I'm using can be setup for a limit detect and even includes a Homing Command. Now I'm considering this, even with the additional 3 wires per motor :roll:

Best,
I couldn't resist attempting using the Panasonic SUNX GX-F12A as a limit detector (even with the extra wires), and last night rigged up a test setup with it connected to my Developmental S&S system.

Now I'm going to implement it on the THK KR20 focus rail I use for the Z axis, and incorporate a "Homing Function" to find the KR20 safe starting position. Don't think I'll do this on the X or Y axis since the Z axis "Home" will be to pull up the lens/camera "Home" and out of the way, but this isn't necessary for the Y and X axis which move the subject.

To keep the wiring reasonable I'll move the Z axis Controller (Tic-500) to the KR20 focus rail and mount on the rail. I'll only need to supply a USB cable and power cable, so just two cables instead of one.

I'll post some images and report the results later on my older thread on the Developmental S&S system, so as not to clutter this thread.

Bottom line is works and works really well :D

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

kaleun96
Posts: 270
Joined: Sat Oct 20, 2018 3:47 pm
Location: Stockholm, Sweden

Post by kaleun96 »

Cool to see you got it working! They're a much cleaner limit sensor than switches in my opinion.

I've got a TMC2130 on the way to try its method of limit detection (i.e. stall detection). I think I will redesign my circuitry since I can now do away with the limit switches, at least I hope so.

Mike, do you have any plans for professional wiring on your S&S system? I've been looking into DIN, D-sub 9, and XLR connectors as a way of minimizing the numbers of wires and improving the durability and look of the rig. For mini DIN I'm having trouble finding good selections on Mouser etc. D Sub has great selection but I'm not a fan of the bulky connector, and tiny XLRs look well suited but are expensive.

None of the above connect well to PCBs but at least for XLRs, they have easy solder-able connections to work with.

enricosavazzi
Posts: 1474
Joined: Sat Nov 21, 2009 2:41 pm
Location: Västerås, Sweden
Contact:

Post by enricosavazzi »

kaleun96 wrote:[...]
I've been looking into DIN, D-sub 9, and XLR connectors as a way of minimizing the numbers of wires and improving the durability and look of the rig. For mini DIN I'm having trouble finding good selections on Mouser etc. D Sub has great selection but I'm not a fan of the bulky connector, and tiny XLRs look well suited but are expensive.
[...]
What about GX16 connectors? They are not unlike DIN in general appearance, but differ in the presence of a threaded collar that prevents the plug from accidentally falling out of the socket, and in the fact that the male pins are on the panel socket rather than on the cable plug (at least in all GX16 connectors I have seen, but extension cables with a male and a female end are available).

GX16 connectors come in 2 to 10 pin models, so plenty to choose from and to avoid accidentally connecting a plug to the wrong socket on the same panel. Above 7-8 pins they become crowded and hard to solder, IMHO.

Unlike DIN and other connectors, the GX16 models with few contacts have thicker pins, so suitable for higher currents.

Ready-to-use cables with two female connectors seem to be commonly available in length of 2 m.
Last edited by enricosavazzi on Fri Mar 08, 2019 1:58 pm, edited 1 time in total.
--ES

kaleun96
Posts: 270
Joined: Sat Oct 20, 2018 3:47 pm
Location: Stockholm, Sweden

Post by kaleun96 »

enricosavazzi wrote: What about GX16 connectors? They are not unlike DIN in general appearance, but differ in the presence of a threaded collar that prevents the plug from accidentally falling out of the socket, and in the fact that the male pins are on the panel socket rather than on the cable plug (at least in all GX16 connectors I have seen, but extension cables with a male and a female end are available).
Brilliant, those will work just fine!

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

kaleun96 wrote:Cool to see you got it working! They're a much cleaner limit sensor than switches in my opinion.

I've got a TMC2130 on the way to try its method of limit detection (i.e. stall detection). I think I will redesign my circuitry since I can now do away with the limit switches, at least I hope so.

Mike, do you have any plans for professional wiring on your S&S system? I've been looking into DIN, D-sub 9, and XLR connectors as a way of minimizing the numbers of wires and improving the durability and look of the rig. For mini DIN I'm having trouble finding good selections on Mouser etc. D Sub has great selection but I'm not a fan of the bulky connector, and tiny XLRs look well suited but are expensive.

None of the above connect well to PCBs but at least for XLRs, they have easy solder-able connections to work with.
Don't have any plans for this at the moment. Now I'm just using some cheap eBay connectors, they work well and easy to use on a PCB, and have been pretty durable, but certainly not up to a "professional standard". I like them because they mount directly to the Pololu Tic and other motor controller/driver boards. I solder all the connections rather than crimp since I don't have a crimp tool (old school solder vs. crimp).

Let us know if you find a connector system that fits your needs.

Just ran a homing routine and it works beautifully :D

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

enricosavazzi wrote:
kaleun96 wrote:[...]
I've been looking into DIN, D-sub 9, and XLR connectors as a way of minimizing the numbers of wires and improving the durability and look of the rig. For mini DIN I'm having trouble finding good selections on Mouser etc. D Sub has great selection but I'm not a fan of the bulky connector, and tiny XLRs look well suited but are expensive.
[...]
What about GX16 connectors? They are not unlike DIN in general appearance, but differ in the presence of a threaded collar that prevents the plug from accidentally falling out of the socket, and in the fact that the male pins are on the panel socket rather than on the cable plug (at least in all GX16 connectors I have seen, but extension cables with a male and a female end are available).

GX16 connectors come in 2 to 10 pin models, so plenty to choose from and to avoid accidentally connecting a plug to the wrong socket on the same panel. Above 7-8 pins they become crowded and hard to solder, IMHO.

Unlike DIN and other connectors, the GX16 models with few contacts have thicker pins, so suitable for higher currents.

Ready-to-use cables with two female connectors seem to be commonly available in length of 2 m.
ES,

Those look like the connectors Wemacro uses, they are really robust but very bulky. I've tried to stay with something much smaller since I have a lots of cables and PCB interfaces with the Precision S&S in development , this is why I didn't consider them.

For others with more typical setups these should be a good option.

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

kaleun96
Posts: 270
Joined: Sat Oct 20, 2018 3:47 pm
Location: Stockholm, Sweden

Post by kaleun96 »

Those look like the connectors Wemacro uses, they are really robust but very bulky. I've tried to stay with something much smaller since I have a lots of cables and PCB interfaces with the Precision S&S in development , this is why I didn't consider them.
I see they have a GX12 that is marginally smaller, but I see your point.

If you're keeping with the circuit/breakout board connectors (dupont?) then there's no reason to change to something like the GX12. Would only be worth it if you were planning on moving the setup frequently or had a lot of exposed cables.

As you probably saw in my thread on my stacking rig, I used JST crimped connectors for the circuit board. They're ok as they have a small footprint and are easy and cheap to make. They're not particularly robust though and can be a pain to disconnect if needed. Not worth implementing them while you're still prototyping though.

mawyatt
Posts: 2497
Joined: Thu Aug 22, 2013 6:54 pm
Location: Clearwater, Florida

Post by mawyatt »

kaleun96 wrote:
Those look like the connectors Wemacro uses, they are really robust but very bulky. I've tried to stay with something much smaller since I have a lots of cables and PCB interfaces with the Precision S&S in development , this is why I didn't consider them.
I see they have a GX12 that is marginally smaller, but I see your point.

If you're keeping with the circuit/breakout board connectors (dupont?) then there's no reason to change to something like the GX12. Would only be worth it if you were planning on moving the setup frequently or had a lot of exposed cables.

As you probably saw in my thread on my stacking rig, I used JST crimped connectors for the circuit board. They're ok as they have a small footprint and are easy and cheap to make. They're not particularly robust though and can be a pain to disconnect if needed. Not worth implementing them while you're still prototyping though.
Here's what I'm using.

Image


See:

https://www.photomacrography.net/forum/ ... highlight=

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Mike

Post Reply Previous topicNext topic