Switch for flicking between two Stackshots from 1 controller
Moderators: Chris S., Pau, Beatsy, rjlittlefield, ChrisR
Switch for flicking between two Stackshots from 1 controller
Would any of you more electrically-oriented folk have any idea where to buy or how to make a simple on-off-on toggle switch to quickly flick between two different Stackshots from one controller?
The Stackshot uses 4-pin DIN cabling (basically same as s-video as far as I can see). So any switch box will have one DIN cable in and two out. What I am not clear about is the wiring to the stepper motor and hence what sort of switch is needed to handle the transfer between two sets of DIN cabling.
A little set-up like this will save me the hassle of unplugging and replugging cables.
The Stackshot uses 4-pin DIN cabling (basically same as s-video as far as I can see). So any switch box will have one DIN cable in and two out. What I am not clear about is the wiring to the stepper motor and hence what sort of switch is needed to handle the transfer between two sets of DIN cabling.
A little set-up like this will save me the hassle of unplugging and replugging cables.
One way would be to just use 4 toggle switches
You probably need to power off the Stackshots and the controller before switching. I don't know if either can handle being disconnected with the power on. My stepper driver controllers cannot handle the stepper motor being disconnected while it's powered on.
It may be easier to just ask Cognisys to make the cable and switches for you. I would tell them that you need to create a field unit that is as light as possible

You probably need to power off the Stackshots and the controller before switching. I don't know if either can handle being disconnected with the power on. My stepper driver controllers cannot handle the stepper motor being disconnected while it's powered on.
It may be easier to just ask Cognisys to make the cable and switches for you. I would tell them that you need to create a field unit that is as light as possible
Making such a switch would be pretty easy. I'd start with a "4PDT center off switch" such as this one for $6.37 USD.

There are many similar switches available on the Internet, and a bit of explanation will help you find numerous other sources.
The word "pole" indicates the number of wires that can be switched--in your application, four. So you need a "four pole" switch, often indicated "4P."
The word "throw" indicates the number of positions the switch has that will make an electrical connection. Single throw and double throw switches are very common--you need a double throw, or "DT" switch.
Double throw switches may or may not have an "off" position in the center. Those that do may be referred to as "center off" or "on-off-on" switches.
The one in the picture is nice because it has small screws, rather than crimps, to attach the wires. But I'd probably add a bit of solder, as well, for a nice electrical connection.
You could mount a switch like this in a small project box, wire it to three female 4-pin DIN jacks, and bang, you're done. Sounds like a project that should cost under $20 and take less than an hour.
I can't see any reason that the motor would need to be switched off prior, as that is precisely what this switch would do, anyway. One of these days, I may make a switch to go between my StackShot controller and the Bratcam, as a convenient way to permit easy and safe freewheeling of the motor. But I'd use a 4PST switch for that.
--Chris

There are many similar switches available on the Internet, and a bit of explanation will help you find numerous other sources.
The word "pole" indicates the number of wires that can be switched--in your application, four. So you need a "four pole" switch, often indicated "4P."
The word "throw" indicates the number of positions the switch has that will make an electrical connection. Single throw and double throw switches are very common--you need a double throw, or "DT" switch.
Double throw switches may or may not have an "off" position in the center. Those that do may be referred to as "center off" or "on-off-on" switches.
The one in the picture is nice because it has small screws, rather than crimps, to attach the wires. But I'd probably add a bit of solder, as well, for a nice electrical connection.
You could mount a switch like this in a small project box, wire it to three female 4-pin DIN jacks, and bang, you're done. Sounds like a project that should cost under $20 and take less than an hour.
I can't see any reason that the motor would need to be switched off prior, as that is precisely what this switch would do, anyway. One of these days, I may make a switch to go between my StackShot controller and the Bratcam, as a convenient way to permit easy and safe freewheeling of the motor. But I'd use a 4PST switch for that.

--Chris
You'll also want three 4 pin mini DIN female chassis mount jacks, such as the ones for $1.79 USD each, labeled Philmore # EMS4 at cablesandconnectors.com. (Again, not a company that I've dealt with.) This is current as of 11-13-2011. Their Website contains a nice explanatory graphic:

Note that these jacks are available as in-line (for use on wires), PC (for mounting on a board), or chassis (for mounting on something like a project box) configurations.
Both the StackShot and motor termination have female mini DIN connections, and the S-video cable is male at both ends. Hence the need for three female jacks in this project.
--Chris
--Edited to correct error: mini Din jacks, appropriate for the S-video connections used in the StackShot, are now listed, rather than DIN versions, which are too large.

Note that these jacks are available as in-line (for use on wires), PC (for mounting on a board), or chassis (for mounting on something like a project box) configurations.
Both the StackShot and motor termination have female mini DIN connections, and the S-video cable is male at both ends. Hence the need for three female jacks in this project.
--Chris
--Edited to correct error: mini Din jacks, appropriate for the S-video connections used in the StackShot, are now listed, rather than DIN versions, which are too large.
Last edited by Chris S. on Mon Nov 14, 2011 12:54 am, edited 1 time in total.
Note that this particular item is on-on, whereas Steve needs on-off-on, at least according to his conversation with Matt at Cognisys. So the next item down in the McMaster-Carr list, item # 7347K98, would serve--and somewhat oddly, is a few cents cheaper than its sibling without the off position. I'd note that the McMaster-Carr switches both have solder-on lugs, rather than screw-on ones. While I'd probably solder either one, screws are kind of nice for holding wires in place while one solders them.SONYNUT wrote:# 7347K99 http://www.mcmaster.com
not sure why you would need on off on....on on would just be one motor or the other...you should shut unit off when switching anyway..but on off on won't hurt either..
Last edited by SONYNUT on Sat Nov 12, 2011 8:19 pm, edited 1 time in total.
..............................................................................
Just shoot it......
Just shoot it......
- rjlittlefield
- Site Admin
- Posts: 24429
- Joined: Tue Aug 01, 2006 8:34 am
- Location: Richland, Washington State, USA
- Contact:
The concern is high voltage spikes caused by suddenly stopping the current through an inductor. Even when the motor isn't moving, there is a certain amount of current being sent through the motor coils to make it hold position. Stepper motor controllers are normally designed to provide an alternate path for the current that lets it die down in a controlled fashion. When you simply open the switch, you leave no place for the current to go, and the voltage spikes can get quite large on the motor side. Cognisys can probably say whether that puts their controller at risk, and if so what to do about it.Chris S. wrote:I can't see any reason that the motor would need to be switched off prior, as that is precisely what this switch would do, anyway.
--Rik
I'm surely missing something. Let's say that the motor releases a voltage spike when the holding current is switched off. Since this same act of switching isolates the controller from the motor, how does this spike have any chance to get back to the controller?rjlittlefield wrote:. . .spikes can get quite large on the motor side. Cognisys can probably say whether that puts their controller at risk, and if so what to do about it.
Thought I wrote--but didn't and should have--that before I would build this I'd run it past Cognisys for a sniff test. My contact there is Paul--I don't believe I know Matt--and he has been great about such things.
BTW, for a couple days when I first started using the StackShot controller, I didn't realize that the cable connecting controller with stepping motor must be pressed in with surprising force. So during that time, the connectivity between these two items was intermittent. While this produced some erratic behavior, it didn't seem to harm the motor or controller in any way.
--Chris
- rjlittlefield
- Site Admin
- Posts: 24429
- Joined: Tue Aug 01, 2006 8:34 am
- Location: Richland, Washington State, USA
- Contact:
There are always couplings that don't appear in the schematics because they don't matter when the circuit is operating as designed. When the circuit is not operated as designed, they can become significant.Chris S. wrote:I'm surely missing something. Let's say that the motor releases a voltage spike when the holding current is switched off. Since this same act of switching isolates the controller from the motor, how does this spike have any chance to get back to the controller?rjlittlefield wrote:. . .spikes can get quite large on the motor side. Cognisys can probably say whether that puts their controller at risk, and if so what to do about it.
Let me pose a hypothetical question. Suppose you have a coil connected at both ends to a circuit that's running a current through it. You attempt to disconnect both ends at the same time, but of course one end opens first. When it does, there will be an inductive spike. Say that 100 volts develops across the coil. What you'd like to have happen is that the still-connected end of the coil just stays at the voltage level of the driving circuit, so the circuit doesn't get perturbed. But what exactly is supposed to make that happen, given that the now-disconnected end of the coil is flailing around 100 volts away? And what happens to the other motor coil that is still connected at both ends, given that the two coils live in the same enclosure and have cores in close proximity?
I've spent way too much time debugging glitches caused by power switching transients to have this issue drop completely off my radar. My first thought is always the same as yours -- the transient can't matter. That thought often manages to persist through the entire debugging process, despite that obviously it does matter because sometimes when I flip the switch the device state gets screwed up. It's an interesting form of cognitive partitioning.

My word "risk" was perhaps overly frightening. I suspect that no permanent damage will result. On the other hand, if stevekale finds that flipping the switch produces erratic behavior, that won't be an entirely happy situation either. I have no idea how much isolation the StackShot controller has between the motor drivers and the rest of the controller logic.
--Rik
Sonynut, the StackShot controller doesn't have an on/off switch, so one needs to pull out the power cord to turn it off. When plugging the power cord back in, the controller boots up, loading firmware and taking a few seconds to come to life. Not a big deal, but a hassle one might reasonably want to avoid in an efficient workflow.
In my approach (I should emphasize that I don't use the StackShot rail, and have the stepping motor driving the right hand fine shaft of a microscope block), I often leave the StackShot unplugged until composition and focus are achieved, and then plug it in to shoot the stack. If I shoot additional stacks, I usually do not bother to unplug it in between. The downside is that with the motor energized, I should avoid usind the remaining otherwise perfectly usable fine focus knob on the left side of the focus block, because if I do, I'm fighting with the motor. (It's of course theoretically possible that manually turning the motor could send a current back to the controller that might hurt it, but in practice this has seemed not to be a concern. Rather, having my silky-smooth fine focus movement made temporarily less than smooth by the holding torque of a stepping motor is annoying. At lower magnifications, I get along just fine with the coarse focus; at higher magnifications, I use the StackShot controller for fine focus, which works just fine. But if, with a single toggle, get my nice, tactile fine focus back for a moment, I'd do it.
Steve's needs appear to be different, but I could see that in his use, rebooting the controller when switching between axes of movement would be a bit annoying.
Cheers,
--Chris
In my approach (I should emphasize that I don't use the StackShot rail, and have the stepping motor driving the right hand fine shaft of a microscope block), I often leave the StackShot unplugged until composition and focus are achieved, and then plug it in to shoot the stack. If I shoot additional stacks, I usually do not bother to unplug it in between. The downside is that with the motor energized, I should avoid usind the remaining otherwise perfectly usable fine focus knob on the left side of the focus block, because if I do, I'm fighting with the motor. (It's of course theoretically possible that manually turning the motor could send a current back to the controller that might hurt it, but in practice this has seemed not to be a concern. Rather, having my silky-smooth fine focus movement made temporarily less than smooth by the holding torque of a stepping motor is annoying. At lower magnifications, I get along just fine with the coarse focus; at higher magnifications, I use the StackShot controller for fine focus, which works just fine. But if, with a single toggle, get my nice, tactile fine focus back for a moment, I'd do it.
Steve's needs appear to be different, but I could see that in his use, rebooting the controller when switching between axes of movement would be a bit annoying.
Makes sense. So if the cost in parts and time is something that Steve is comfortable gambling with, he might want to try it. Me, I'd give it a try--$20 worth of parts and an hour of time seem a reasonable price for an interesting experiment that might solve a problem. And if I got erratic results, it would give me a chance to try some electronic methods of dealing with such problems that I've read about, but not had the chance to try. In general, they don't seem so horridly difficult. . .famous last words.rjlittlefield wrote:I've spent way too much time debugging glitches caused by power switching transients to have this issue drop completely off my radar.
Cheers,
--Chris
- rjlittlefield
- Site Admin
- Posts: 24429
- Joined: Tue Aug 01, 2006 8:34 am
- Location: Richland, Washington State, USA
- Contact:
The controller takes several seconds to come up when power is cycled. If the controller is connected to a computer, software won't like the interruption.SONYNUT wrote:Is it that big of a deal just to turn it off?
Simple switching with power on may work fine in practice. I ran a quick experiment by setting my controller in high-precision mode to maximize the holding current, then quickly and repeatedly plugged/unplugged the motor cable. The controller never did anything weird that I could see.
--Rik
Thanks guys. I was familiar with DPDT switches but not 4 pole versions. Finding the DIN connectors was easy. Now I need to make sure I don't screw up the wiring!
Unplugging the motor cord while leaving the controller on seems to be okay and in fact would have been what I was going to do as I manually switched between motors by unplugging and replugging. Matt at Cognisys had said any switch would need to be "break-before-make" which I interpret as on-off-on.
Chris, when wiring your stepper for the Stackshot controller did you get a wiring diagramme? I'm wondering if all the DIN connections are used and, if not, which ones are. (The photo I saw of your rig suggests only 3 might be used.)
PS: they apparently plan on developing a multi-axis (XYZ) controller at some point with Z being rotation.
Unplugging the motor cord while leaving the controller on seems to be okay and in fact would have been what I was going to do as I manually switched between motors by unplugging and replugging. Matt at Cognisys had said any switch would need to be "break-before-make" which I interpret as on-off-on.
Chris, when wiring your stepper for the Stackshot controller did you get a wiring diagramme? I'm wondering if all the DIN connections are used and, if not, which ones are. (The photo I saw of your rig suggests only 3 might be used.)
PS: they apparently plan on developing a multi-axis (XYZ) controller at some point with Z being rotation.
Last edited by stevekale on Sun Nov 13, 2011 1:38 am, edited 2 times in total.