-
Run a stepper from 2 DM542 drive
Hi all,
I need to control safely a stepper with 2 drives (cheapo DM542). I have a fiber laser which has a Z axis controlled by a board DLC2 (step and dir) thru a DM542 to a stepper. I have another device which has his own driver (also a DM542), but needs to acces the same stepper.
The process should be like this:
- start the machine with the Z axis stepper using the DLC board;
- push a button to use the other device - isolate the DLC board and the drive and let the other drive to take control;
- push another button or use the same one to be back to the normal state (at start up).
I am thinking to have a relay of some sort or a contactor which needs to be to a board for the step and dir, but this is vaguely.
What is your advice on this?
Gabi
-
Re: Run a stepper from 2 DM542 drive
Another option would be to use only one driver and switch the control signals (step, direction, and what else you have) between the two devices.
Jan
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
Snowtech
Another option would be to use only one driver and switch the control signals (step, direction, and what else you have) between the two devices.
Jan
Can you be more specific, please?
Is there a device like that?
Should I make a board with step and direction from both motors and a switch between them for changing? .
Sorry, for the newbie questions, but I try to figure this one out by myself.
Many thanks
GAbi
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
gabi68
Can you be more specific, please?
Is there a device like that?
Should I make a board with step and direction from both motors and a switch between them for changing? .
Sorry, for the newbie questions, but I try to figure this one out by myself.
Many thanks
GAbi
Well, if the DM542 drivers are already built into two different machines, my suggestion might be more work.
What you need to do it the way you described would be a 4p2t (4 poles, 2 throw) switch or relay.
This can switch the 4 wires of the stepper between 2 sources, but the switch has to be rated for the full current of the steppers.
Jan
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
Snowtech
Well, if the DM542 drivers are already built into two different machines, my suggestion might be more work.
What you need to do it the way you described would be a 4p2t (4 poles, 2 throw) switch or relay.
This can switch the 4 wires of the stepper between 2 sources, but the switch has to be rated for the full current of the steppers.
Jan
You will have a good chance of blowing the drive if you switch if you switch it live
-
Re: Run a stepper from 2 DM542 drive
This is what I am afraid. Blowing a driver is not that bad (they are cheap), but the board of the laser is £1000. Open to any working solution. Thank you
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
Clive S
You will have a good chance of blowing the drive if you switch if you switch it live
Yes, i agree, thought about that only seconds after posting, but my post count is so low that every post has to be approved by a mod, so i couldnt edit it in time.
Sorry for giving bad advice :-)
Jan
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
Snowtech
Yes, i agree, thought about that only seconds after posting, but my post count is so low that every post has to be approved by a mod, so i couldnt edit it in time.
Sorry for giving bad advice :-)
Jan
Your welcome, we all have to learn 👍
-
Re: Run a stepper from 2 DM542 drive
Skip one driver and switch the control signals step, dir, enable and gnd. This is what I am doing on my DIY lathe / 4th axis combo. I would not switch the stepper wires. Beware that if you have some interference then you might get some extra steps, so you must be careful with the wiring.
-
Re: Run a stepper from 2 DM542 drive
The only safe way is to switch the step/dir signals, you will 99% blow the drive if you swap the motor wires when the drive is powered up.
-
Re: Run a stepper from 2 DM542 drive
Ignoring the behaviour of the energised coils causing back-emf when disconnected (Jazz's reply) - there's another issue at play here - the stepper drivers would have their own instance of the X/Y coil phasing - swapping between controllers would introduce a discrete change in motor armature position - which I would expect is not desired. That and blowing up the drivers.
As previously explained - use a control system that allows the step/dir to be multiplexed. If using open-collector drives it's possible to wire-or the cathodes on the driver step/dir inputs.
-
Re: Run a stepper from 2 DM542 drive
If you disable the drive before switching the switching the STEP & DIR it may help with not generating any spurious steps. Just don't forget to re-enable the drive before kicking off again.
-
Re: Run a stepper from 2 DM542 drive
But, depending on the weight, disabeling the Z-axis may cause it to lose position.
-
Re: Run a stepper from 2 DM542 drive
-
Re: Run a stepper from 2 DM542 drive
If losing position after switching is a problem then you need to zero after each switch. Regardless how you do it you can't expect that the position is the same after switching.
However several people mentioned switching only STEP and DIR. That will not work well. You MUST also switch the GND as a minimum, but if you use the EN for any of the drivers then you must include that also.
-
1 Attachment(s)
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
BeagleBrainz
If you disable the drive before switching the switching the STEP & DIR it may help with not generating any spurious steps. Just don't forget to re-enable the drive before kicking off again.
Not intended to drag this conversation onwards, but for clarity on the behaviour of a stepper driver:
A stepper driver can be described as a finite-state machine. It will present a series of currents to each of the two (e.g.) coils according to the number of micro-steps selected. The following is an extract from the data sheet for the TB6600 - though the principle applies to any stepper driver.
Attachment 30712
You should be able to see that for a 1/8 micro-step, there's 32 discrete states for the A/B coil currents. Whether you move CW or CCW, you're just stepping either forwards or backwards in the state-machine ("phase", in my original post).
My point?, if using two stepper drivers, each will maintain it's own internal state as its operated. If you swap the outputs from one driver to another - unless there's the random fluke of each driver having the same state, there WILL be a discrete change in the coil currents appropriate to the different phase in the state machine that WILL result in a discrete change in shaft position. There's no mechanism available to synchronise the drivers. Disabling the drivers before switching the STEP/DIR will have no impact on this.
A_Camera's point of switching grounds is valid - or my lazy assumption that you share a common ground.
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
A_Camera
Skip one driver and switch the control signals step, dir, enable and gnd. This is what I am doing on my DIY lathe / 4th axis combo. I would not switch the stepper wires. Beware that if you have some interference then you might get some extra steps, so you must be careful with the wiring.
Can you be more specific? A diagram will be awesome. Thank you
-
Re: Run a stepper from 2 DM542 drive
Woa. The forum system didn't send any emails regarding a new post on my thread. Thank you everybody for your opinions. Regarding the accuracy, a step or two will not harm (this is a fiber laser not milling machine) the focus is forgiving, but a disabled driver will cause the Z axis to fall, not good.
What is the best solution for this situation? Anything already made it out there?
Thank you
Gabi
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
gabi68
Woa. The forum system didn't send any emails regarding a new post on my thread. Thank you everybody for your opinions. Regarding the accuracy, a step or two will not harm (this is a fiber laser not milling machine) the focus is forgiving, but a disabled driver will cause the Z axis to fall, not good.
What is the best solution for this situation? Anything already made it out there?
Thank you
Gabi
A motor with a brake then?.
Engage / disengage brake as you switch?.
I'm prob clueless and talking crap though.
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
Doddy
Not intended to drag this conversation onwards, but for clarity on the behaviour of a stepper driver:
A stepper driver can be described as a finite-state machine. It will present a series of currents to each of the two (e.g.) coils according to the number of micro-steps selected. The following is an extract from the data sheet for the TB6600 - though the principle applies to any stepper driver.
Attachment 30712
You should be able to see that for a 1/8 micro-step, there's 32 discrete states for the A/B coil currents. Whether you move CW or CCW, you're just stepping either forwards or backwards in the state-machine ("phase", in my original post).
My point?, if using two stepper drivers, each will maintain it's own internal state as its operated. If you swap the outputs from one driver to another - unless there's the random fluke of each driver having the same state, there WILL be a discrete change in the coil currents appropriate to the different phase in the state machine that WILL result in a discrete change in shaft position. There's no mechanism available to synchronise the drivers. Disabling the drivers before switching the STEP/DIR will have no impact on this.
A_Camera's point of switching grounds is valid - or my lazy assumption that you share a common ground.
Very good points.
As long as the outputs driving the STEP & DIR are at a logic LOW (assuming common) is ground there should be an issue, but if the outputs are at a logic HI and using a mechanical switch to change over disabling the drive would prevent spurious steps, due to bounce.
All in all a better mechanical design would help.
Actually it would be worthwhile knowing the circuitry that drives the STEP & DIRECTION, before really delving in too deep. Considering that the design requires switching 2 different sources for driving the stepper who knows how the electrical side has been done.
-
2 Attachment(s)
Re: Run a stepper from 2 DM542 drive
The fiber laser has a board called DLC2-M4-2D which is a 2 board connected with pins. The top board is a controller for X,Y,Z,A axis (can drive a Z axis, a rotary axis, an XY table and all the combination between). The bottom board is dedicated to run the laser head itself (2 small servo motors connected to 2 mirrors to steer the beam and stop it and start it depending the user design).
The top board is a step and dir controller and is connected to a stepper motor which operates the Z axis
I also have a device (with his own stepper driver) which has a measuring sensor for the focal distance (different lens have different focal distance) and this device needs to use the same stepper motor on the z axis.
This was my question: how can I change the drivers (safely) to use the same motor when I need to use one or the other device?
Thank you
Gabi
Attachment 30714
Attachment 30715
-
Re: Run a stepper from 2 DM542 drive
They're have been a couple of methods put forward.
Unfortunately with no actual information on the controller boards only a generic answer can be given. The actual way to implement a specific method is up to the person/persons that have the hardware sitting in front of them. That's usually the situation with these issues. A question is asked without a lot of information regarding the hardware involved so only a generic answer can be given.
Maybe the best answer would be to ask the person/persons that designed your setup, or try and think of a way of not having to change the stepper driver or inputs.
The best option would for the main control software\hardware to operate\adjust the Z axis and be able to read the output from the system that adjusts your focal length. Of course this would depend on the main control software\hardware.
-
Re: Run a stepper from 2 DM542 drive
I assume you are manually selecting between the two devices rather than using both systems at once. Then I would suggest using a single driver with step and dir inputs switched as previously suggested but use standard logic gates to do the selecting between sources, possibly with optical or other isolators on the inputs to keep the grounds of the two boards separate if required. Power the logic and provide it's ground from the same board that powers the driver.
This way you could avoid any contact bounce on a mechanical switch and remove the need to common the logic grounds of your two boards. The enable line (if used) could also be buffered/switched/maintained during the changeover by your logic if required.
-
1 Attachment(s)
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
gabi68
Can you be more specific? A diagram will be awesome. Thank you
I am sorry but I have no diagram. Anyway, it is a simple circuit with one switch and a relay which flips the step, dir, en and gnd signals, all four at the flip of the switch. The circuit is really simple.
I made a simple sketch and scanned it for clarity.
Attachment 30720
UCCNC generates the pulses if I flip the switch and select it, or the Arduino box if I select the lathe mode. The servo is a servo with integrated driver, but it could be a DM542 also, it makes no difference as long as the step, dir, en and the gnd can be used to control it. The relay in my case is one I had in my drawer, if you can't find one which switches all the four signals at once, you can use two, or even four separate relays as long as you switch all at the same time. Just connect the coils in parallel and you'll be fine. Of course, as I said before, it assumes that both controlling devices work independently and you don't need to rely on exact positions between each devices. In my case, I don't care where the motor stops, the lathe accelerates and decelerates to a speed I want it to, and if I use UCCNC then I have to zero the position for UCCNC, so the position is lost every time I flip the switch, but for me that's perfectly fine.
I don't know if you have seen this before, but I made a video about the control box. This is an early version, since then I swapped the stepper to a servo and built my lathe, which now can spin considerably faster.
https://youtu.be/qfiPTDvZlIs
-
Re: Run a stepper from 2 DM542 drive
What kind of relay? A link, please?
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
gabi68
What kind of relay? A link, please?
I have no link. As I said, I had it in my drawer. You have to Google.
-
Re: Run a stepper from 2 DM542 drive
Diagram looks like some kind of 4 pole contactor type where the coil activates all the contacts at once.
Positioned all 4 NO for UC300 use and NC for arduino.
I'd suggest the most used one of the 2 controls be on the NO side then power the switch to the coil to flip it NC for the other.
Step/Dir could be a problem if the logic I/O flips with contactor switch over could it not?.
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
A_Camera
I have no link. As I said, I had it in my drawer. You have to Google.
I keep asking about the relay because DM542 has - Pul+, Pul-, Dir+, Dir-, Ena +, Ena-, Gnd and+24VDC. According to your diagram I should have a relay with 7 inputs. Where I can find something like that? Or I got this wrong....
You use Arduino for the operation you want to be executed by your lathe. I don't need this. I only need to use safely 2 stepper motors (alternatively) with a one stepper driver.
-
Re: Run a stepper from 2 DM542 drive
But surely the original question concerned one stepper and two drivers? And that's the question that's been answered - best way is one driver, one motor, and switch the inputs to the driver. However, the precise way of doing this - couple of logic chips, relays, switches, etc - depends so much on what you have already. Need to isolate common grounds, whether opto-isolation is needed, a bunch of things like that, are trivial to sort out - but only with a full understanding of where you are coming from, and I appreciate that this is difficult for someone with no knowledge of electronics so no insight into what info is needed.
But please don't change the question!
-
Re: Run a stepper from 2 DM542 drive
Hi,
I din't change the question. I simply follow the advices given. Now I understand is easy to use one driver and switch the inputs. Sorry for confusion since I am very new to this and obviously electronic circuitry are not my forte (IT software background here).
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
A_Camera
I have no link. As I said, I had it in my drawer. You have to Google.
I have something similar with this:
https://www.amazon.co.uk/gp/product/...?ie=UTF8&psc=1
It is a good candidate for what I need?
Or this one is better:
https://www.amazon.co.uk/General-Pur.../B0087ZTGNNext I need to wire an on/off button. I need to have a way to change the state of the relay to use one or another sets of inputs.
Thank you
Gabi
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
dazp1976
Diagram looks like some kind of 4 pole contactor type where the coil activates all the contacts at once.
Positioned all 4 NO for UC300 use and NC for arduino.
I'd suggest the most used one of the 2 controls be on the NO side then power the switch to the coil to flip it NC for the other.
Step/Dir could be a problem if the logic I/O flips with contactor switch over could it not?.
I don't know what would be the point of changing to your suggestion. The way I do it works fine. The switch is manual, has actually nothing to do with Arduino. Step/dir/en is controlled by Arduino or UCCNC, depending on the position of the switch. Why would Step/Dir be a problem...? As I said, it works and I use it.
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
gabi68
I keep asking about the relay because DM542 has - Pul+, Pul-, Dir+, Dir-, Ena +, Ena-, Gnd and+24VDC. According to your diagram I should have a relay with 7 inputs. Where I can find something like that? Or I got this wrong....
You use Arduino for the operation you want to be executed by your lathe. I don't need this. I only need to use safely 2 stepper motors (alternatively) with a one stepper driver.
No. All you need is a 4-pole relay. Pul -, Dir - and Ena - are all connected together to GND. You are controlling only Step, Dir and Ena.
I know you don't need the Arduino. The Arduino is generating the pulses I need for the lathe operation, but that's just for your information on my use. All you need is what my drawing shows, i.e. a 4 pole relay and a switch. The one I am using is DS4E-M-DC5V made by SDS. It is a low power signal relay, fast and requires very little current, but it is obsolete so maybe hard to find. Anyway, there are plenty small signal relays which can be used, and it is not critical that all the contacts are in the same casing, so you can use 4, 2 or 1 relay depending on what you find. Here is an example which works also, but you need to wire it:
https://www.amazon.se/Yizhet-kanal-r...03086861&psc=1
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
gabi68
The second link does not show me anything, but the first is OK, except that you only need four relays, so it is better to buy a 4-channel type.
-
1 Attachment(s)
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
A_Camera
No. All you need is a 4-pole relay. Pul -, Dir - and Ena - are all connected together to GND. You are controlling only Step, Dir and Ena.
I know you don't need the Arduino. The Arduino is generating the pulses I need for the lathe operation, but that's just for your information on my use. All you need is what my drawing shows, i.e. a 4 pole relay and a switch. The one I am using is DS4E-M-DC5V made by SDS. It is a low power signal relay, fast and requires very little current, but it is obsolete so maybe hard to find. Anyway, there are plenty small signal relays which can be used, and it is not critical that all the contacts are in the same casing, so you can use 4, 2 or 1 relay depending on what you find. Here is an example which works also, but you need to wire it:
https://www.amazon.se/Yizhet-kanal-r...03086861&psc=1
Sorry to be a pain. I have 4 inputs which need to be changed between. You said I will need Pul+, Dir+ and Ena (unconnected in my case). What should I do with the rest of the wires (Pul-, Dir- and Ena).
Thank youAttachment 30721
-
Re: Run a stepper from 2 DM542 drive
Use a 4 pole double throw relay. Known as 4PDT.
If you do not understand this do a google search about relay basics.
-
Re: Run a stepper from 2 DM542 drive
I've not really been following this thread, but the simplest option is a 4PDT relay as has been suggested, but you only need to switch the Dir+/-, and Step +/- signals.
Driver is permanently enabled, so you don't have to worry about it losing power and the Z dropping.
And the GND is only needed for the main power, as the driver inputs are optoisolated.
The only issue with using a relay is with switching such a small current, the contacts will likely oxidise with use due to lack of current to wet/clean the contacts, eventually leading to lack of continuity,
For a circuit only switching occasionally, it'll likely be a long time before failure is likely to be an issue, but it's something to bear in mind.
-
Re: Run a stepper from 2 DM542 drive
Yeah so basically go for a relay rather than a contactor.
-
Re: Run a stepper from 2 DM542 drive
Quote:
Originally Posted by
m_c
I've not really been following this thread, but the simplest option is a 4PDT relay as has been suggested, but you only need to switch the Dir+/-, and Step +/- signals.
Driver is permanently enabled, so you don't have to worry about it losing power and the Z dropping.
That is only true if he ALWAYS wants to have the stepper energised and always holding. That is not always desirable or even advised. So unless you absolutely certain that he doesn't care about enabling/disabling the driver it is indeed necessary to switch the enable signal also. Regardless of which, there is no harm in switching it, but there can be harm in not switching it.
Quote:
And the GND is only needed for the main power, as the driver inputs are optoisolated.
GND is the same as STEP - , DIR - and EN -. It is better to connect those to the same - output as the one providing the control signals. Again, it would do no harm and we know too little about his design and implementation.
Quote:
The only issue with using a relay is with switching such a small current, the contacts will likely oxidise with use due to lack of current to wet/clean the contacts, eventually leading to lack of continuity,
For a circuit only switching occasionally, it'll likely be a long time before failure is likely to be an issue, but it's something to bear in mind.
That's why I said that a small signal relay needs to be used, not a contactor. You talk about a contactor which is designed for high voltage and current.
-
Re: Run a stepper from 2 DM542 drive
Or if you want to be really simple, a 4PDT switch. Which would mean a human having to do the change over. Would do even during just testing.