PDA

View Full Version : Run a stepper from 2 DM542 drive



gabi68
10-12-2021, 09:46 AM
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

Snowtech
11-12-2021, 12:49 AM
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

gabi68
11-12-2021, 11:06 AM
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

Snowtech
11-12-2021, 01:57 PM
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

Clive S
11-12-2021, 06:30 PM
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

gabi68
11-12-2021, 07:19 PM
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

Snowtech
11-12-2021, 09:51 PM
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

Clive S
11-12-2021, 11:38 PM
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 👍

A_Camera
12-12-2021, 05:57 PM
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.

JAZZCNC
12-12-2021, 08:39 PM
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.

Doddy
12-12-2021, 11:22 PM
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.

BeagleBrainz
13-12-2021, 09:00 AM
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.

Snowtech
13-12-2021, 10:49 AM
But, depending on the weight, disabeling the Z-axis may cause it to lose position.

BeagleBrainz
13-12-2021, 11:48 AM
Yes a very good point.

A_Camera
13-12-2021, 12:19 PM
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.

Doddy
16-12-2021, 08:58 AM
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.

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.

gabi68
19-12-2021, 08:59 PM
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

gabi68
19-12-2021, 09:06 PM
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

dazp1976
19-12-2021, 09:18 PM
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.

BeagleBrainz
20-12-2021, 10:08 AM
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.

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.

gabi68
20-12-2021, 10:49 AM
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
30714
30715

BeagleBrainz
21-12-2021, 02:07 AM
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.

Kitwn
21-12-2021, 09:38 AM
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.

A_Camera
22-12-2021, 09:28 PM
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.

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

gabi68
22-12-2021, 09:49 PM
What kind of relay? A link, please?

A_Camera
22-12-2021, 10:37 PM
What kind of relay? A link, please?

I have no link. As I said, I had it in my drawer. You have to Google.

dazp1976
22-12-2021, 11:50 PM
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?.

gabi68
23-12-2021, 12:59 AM
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.

Neale
23-12-2021, 08:55 AM
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!

gabi68
23-12-2021, 09:13 AM
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).

gabi68
23-12-2021, 09:20 AM
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/B07QLYZ364/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
It is a good candidate for what I need?
Or this one is better:
https://www.amazon.co.uk/General-Purpose-Relay-PYF14A-Socket/dp/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

A_Camera
23-12-2021, 11:09 AM
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.

A_Camera
23-12-2021, 11:29 AM
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-rel%C3%A4-kontrollbr%C3%A4da-optoelement-Arduino/dp/B07GXBSX58/ref=asc_df_B07GXBSX58/?tag=shpngadsglede-21&linkCode=df0&hvadid=476555136704&hvpos=&hvnetw=g&hvrand=6871930059675222274&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=1012442&hvtargid=pla-532503086861&psc=1

A_Camera
23-12-2021, 11:31 AM
I have something similar with this:
https://www.amazon.co.uk/gp/product/B07QLYZ364/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
It is a good candidate for what I need?
Or this one is better:
https://www.amazon.co.uk/General-Purpose-Relay-PYF14A-Socket/dp/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

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.

gabi68
23-12-2021, 09:47 PM
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-rel%C3%A4-kontrollbr%C3%A4da-optoelement-Arduino/dp/B07GXBSX58/ref=asc_df_B07GXBSX58/?tag=shpngadsglede-21&linkCode=df0&hvadid=476555136704&hvpos=&hvnetw=g&hvrand=6871930059675222274&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=1012442&hvtargid=pla-532503086861&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 you30721

BeagleBrainz
23-12-2021, 11:12 PM
Use a 4 pole double throw relay. Known as 4PDT.

If you do not understand this do a google search about relay basics.

m_c
24-12-2021, 12:55 AM
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.

BeagleBrainz
24-12-2021, 05:01 AM
Yeah so basically go for a relay rather than a contactor.

A_Camera
24-12-2021, 09:22 AM
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.

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.

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.

BeagleBrainz
24-12-2021, 09:26 AM
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.

A_Camera
24-12-2021, 09:36 AM
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.

...but that is really difficult to find. Of course, it could be done with 2 or even 4 individual switches also.

A_Camera
24-12-2021, 10:05 AM
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 you30721

It is getting difficult to help because I don't know your background and don't have a clue about your wiring or who did the original work, but I'll make a new effort.

1. If you are sure you NEVER will use the enable signal then you don't have to care about that, so just ignore as it is ignored in your picture.
2. Check PUL - and DIR - with a DMM, I think those are connected to the same source, so basically you could have only the blue wire connected and from that bridge to PUL -.
3. In theory, if both your controlling devices share a common signal ground then you don't need to switch that signal, but it is a good engineering practice to do it, so I would definitely switch that also.
4. This leaves you with three signals to switch and these are the same as PUL + , DIR + and DIR -. Remember that DIR - is bridged to PUL - otherwise it will not work.

In the end, according to the above, you will need a relay which can switch three signals, but you won't find such relay. They are always made as 1, 2 or 4 (or more) pole relays.

BeagleBrainz
24-12-2021, 11:34 AM
I wouldn't assume -DIR or -STEP are connected to ground, the output circuit could be a NPN transistor (open collector). So the safest bet would be to put each (for lack of better description signal) on a separate pole.
Maybe the output circuit of one of the boards can recognize an open circuit, on either the STEP or DIR causing a fault condition.
The user has provided no circuit diagrams so it is really hard to say which way to jump.

It would be the same as asking a programmer to design a routine to process a data packet without actually telling them anything about the format of the data packet.

m_c
24-12-2021, 05:34 PM
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.

If you'd looked at the relevant photo, you would see the Enable on the driver has nothing connected to it, plus there is also the post stating he doesn't want the axis to become disabled to avoid the axis dropping, so connecting the enable is not needed.



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.

Not on the existing step source, as again, the photo shows differential outputs.
However I did think about this earlier, as the alternative controller may not have differential outputs, so some thought may be needed in that regard.



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.

All relays, apart from specialist relays have minimum switching currents. It is not something that only applies to contactors.
Good relay manufacturer's will publish the relevant detail in the datasheet.

gabi68
24-12-2021, 06:40 PM
Well, taking your advices I have a relay with appropriate socket on the way
https://www.rapidonline.com/Relpol-R4N-2014-23-1012-WTL-Industrial-12V-DC-7A-4PDT-Plug-In-Relay-61-6063
and I will connect Pul-, Pul+,Dir- and Dir+ and power the relay from a 12V power supply.

I also bought this fancy button
https://www.amazon.co.uk/gp/product/B07PHW2WKT/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1 .

The last advice need it is where should I connect the button to make the change of the inputs?

Thank you
Gabi

A_Camera
24-12-2021, 06:53 PM
The user has provided no circuit diagrams so it is really hard to say which way to jump.

Yes, that's the key issue. We are all only guessing. I provided my solution, but yes, other solutions might be needed, we have no idea since we don't have enough information about his design. I was however very clear that the solution I proposed is what I use and it works for me, and I bet you that I could make it work with his driver also.

There are two documented possible ways of connecting the driver, in one case you bridge all the + to the same and switch all the - signals, the other way is what I am using, which is I think the most commonly used. Basically there is very little difference between them (I know that electrically the difference is huge), and both uses the same principle, but without knowing all the details of his solution it is impossible the say which is right and which is wrong.

30722

A_Camera
24-12-2021, 07:04 PM
Well, taking your advices I have a relay with appropriate socket on the way
https://www.rapidonline.com/Relpol-R4N-2014-23-1012-WTL-Industrial-12V-DC-7A-4PDT-Plug-In-Relay-61-6063
and I will connect Pul-, Pul+,Dir- and Dir+ and power the relay from a 12V power supply.

I also bought this fancy button
https://www.amazon.co.uk/gp/product/B07PHW2WKT/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1 .

The last advice need it is where should I connect the button to make the change of the inputs?

Thank you
Gabi

That relay will work just fine, I don't think you will have problems with it. If you switch all four wires then you don't need to care about anything else, just that you connect all the wires right. Good luck.

A_Camera
24-12-2021, 07:05 PM
The user has provided no circuit diagrams so it is really hard to say which way to jump.

Yes, that's the key issue. We are all only guessing. I provided my solution, but yes, other solutions might be needed, we have no idea since we don't have enough information about his design. I was however very clear that the solution I proposed is what I use and it works for me, and I bet you that I could make it work with his driver also.

There are two documented possible ways of connecting the driver, in one case you bridge all the + to the same and switch all the - signals, the other way is what I am using, which is I think the most commonly used. Basically there is very little difference between them (I know that electrically the difference is huge), and both uses the same principle, but without knowing all the details of his solution it is impossible the say which is right and which is wrong.

30722

gabi68
24-12-2021, 07:22 PM
That relay will work just fine, I don't think you will have problems with it. If you switch all four wires then you don't need to care about anything else, just that you connect all the wires right. Good luck.
How should I connect the button, please?

BeagleBrainz
25-12-2021, 02:06 AM
https://www.circuitbasics.com/what-is-a-relay/

Or Pick your choice

https://www.google.com/search?newwindow=1&sxsrf=AOaemvIIKii6NkKG6h93PwuC7YGfp8_mWQ:164039430 3881&q=How+to+wire+a+relay&stick=H4sIAAAAAAAAAONQF5LQr0jW18_VNzDLzcqzAjEsjLPL HFLzlHDKaMnlppYkWulXFCTmpeYAVeXnJacWlFgVZ6aklidWFk cJZ-SXK5TkK5RnFqUqJCoUpeYkVi5iFACZV5SalpmXmpuaV6Jv8ItR LMDVP8DHVcHRJ9hfIdjVMcjZQ8HNP2gBC8MCFsYFLBwLWNgXsH AtYGFewMK6gIV7EauwB6bJt9gkGW7M5DK1qnxZw8XnucHWvVJt zbuP_40650QAAHBkVtnhAAAA&sa=X&ved=2ahUKEwjfsJj-4P30AhWwSmwGHcCsBuUQ4qYDegQIOhAI&biw=1600&bih=707&dpr=1

A_Camera
25-12-2021, 10:53 AM
How should I connect the button, please?

Use my simple diagram above. The only thing you have to be careful of is polarity. The relay you selected has a built in diode, so the coil has a + and a - terminal. You connect - to your 12VDC - and switch to the plus terminal (this is the most common way of switching). When you push the button the relay should release or pull, depending on how you wired (NO or NC). I didn't look at your fancy button, so I have no idea if it is a single pole, or dual pole switch, or if it has both NO and NC contacts or not.

To be honest, I agree with the previous poster that you seem to be in a need of elementary electrical knowledge, because your questions regarding the relay and how to wire are really very basic. Try to read some basic information sheets because you will need it. You will also need a simple DMM and some basic electrical measurement knowledge. That is a minimum when you start wiring things. Whatever you do, DON'T TOUCH THE MAINS SIDE. Making mistakes on the low voltage DC side might burn some parts and generate some blue smoke, but making mistakes on the mains side might kill you. I don't think you have the knowledge to touch the mains side. I am not saying this to sound rude, but I think if you plan on doing any electrical modifications then your knowledge level must be increased to at least basic level of understanding electrical circuits and switching. You will need that knowledge constantly if you intend to make changes or trying to find and fix faults.

m_c
25-12-2021, 02:29 PM
I was going to do this in F360 to test the schematic section, but the default component choice is limited, so here's a quick doodle -

30723

I've marked the resistor, but I'm assuming as the switch is listed as 12V, it already has an internal resistor for the LED part, so it shouldn't be needed, but without seeing the datasheet, I'd add it just in case.

m_c
25-12-2021, 02:30 PM
One bit of information that's not clear, is what kind of step/dir output is your alternative source outputting?

gabi68
26-12-2021, 12:39 PM
Hi,

I know very little about electronics. I am a software programmer with a many skipped electronic courses. I always was like this, when I don't know something start asking many and stupid questions and also start reading. I will always try to stay away from mains.
After reading and try to educate myself I understand now you connect the switch on the hot side (+) of the relay. I also read about how to connect my "fancy" button. Long story short I came up with this crude diagram. Have a look and tell me if this will work, please.

Many thanks
Gabi
30724

m_c
26-12-2021, 01:30 PM
That looks fine for the switch/relay side wiring.

gabi68
26-12-2021, 01:39 PM
That looks fine for the switch/relay side wiring.

On the relay side I will have Pul-, Pul+, Dir- and Dir+ from the stepper drive on the NO and Pul-, Pul+, Dir- and Dir on the NC for the measuring device. The only thing which is not very clear is if I need to supply 24V from the stepper drive to the measuring device or that needs to be wired separately from the power supply (the same one which supply the stepper driver). Please have a look and comment.

BeagleBrainz
26-12-2021, 01:45 PM
Ok what you need to do is the following.

Approach whoever it was that gave you this task and explain to them that you are way over your head. Also that you have attempted to obtain some advice your lack of knowledge does not put you in position to assess the advice.

Now there is no shame in this. One of the controllers mentioned is worth a couple of grand. I do not want you to be responsible for messing things up if you make a mistake. We all do.

The best and safest solution is to get an electrician in, this is not electronics any capable electrician will be able to perform the wiring. Yes it may cost some currency, but is the wisest way to progress. I fear the actual wiring of the relay contacts to the various signal sources may prove to be overwhelming for yourself.

So it’s time to fess up, be honest and get some actual on site help. Sometimes that is just the way it is.

I honestly think this is the wrong project for you to begin on. Others may disagree and you are quite welcome to disregard my advice.

All in all I wish you the best of luck. Last of all if you do this yourself work slowly and check for correct operation as you go. It is easier to deal with one mistake at a time.

gabi68
26-12-2021, 02:04 PM
Ok what you need to do is the following.

Approach whoever it was that gave you this task and explain to them that you are way over your head. Also that you have attempted to obtain some advice your lack of knowledge does not put you in position to assess the advice.

Now there is no shame in this. One of the controllers mentioned is worth a couple of grand. I do not want you to be responsible for messing things up if you make a mistake. We all do.

The best and safest solution is to get an electrician in, this is not electronics any capable electrician will be able to perform the wiring. Yes it may cost some currency, but is the wisest way to progress. I fear the actual wiring of the relay contacts to the various signal sources may prove to be overwhelming for yourself.

So it’s time to fess up, be honest and get some actual on site help. Sometimes that is just the way it is.

I honestly think this is the wrong project for you to begin on. Others may disagree and you are quite welcome to disregard my advice.

All in all I wish you the best of luck. Last of all if you do this yourself work slowly and check for correct operation as you go. It is easier to deal with one mistake at a time.

This a personal project (it is my fiber laser) and I will do this by myself. I will put some led's with the appropriate resistor (for load) and try the circuit before commit and install everything on the laser. Nothing on the last question...

Thank you for your advices so far.

A_Camera
27-12-2021, 10:53 AM
Ok what you need to do is the following.

Approach whoever it was that gave you this task and explain to them that you are way over your head. Also that you have attempted to obtain some advice your lack of knowledge does not put you in position to assess the advice.

Now there is no shame in this. One of the controllers mentioned is worth a couple of grand. I do not want you to be responsible for messing things up if you make a mistake. We all do.

The best and safest solution is to get an electrician in, this is not electronics any capable electrician will be able to perform the wiring. Yes it may cost some currency, but is the wisest way to progress. I fear the actual wiring of the relay contacts to the various signal sources may prove to be overwhelming for yourself.

So it’s time to fess up, be honest and get some actual on site help. Sometimes that is just the way it is.

I honestly think this is the wrong project for you to begin on. Others may disagree and you are quite welcome to disregard my advice.

All in all I wish you the best of luck. Last of all if you do this yourself work slowly and check for correct operation as you go. It is easier to deal with one mistake at a time.

Exactly. ...and if I knew about his ignorant attitude I wouldn't have wasted my time on him. Being proud about skipping classes is the ultimate proof of stupidity. I'd be ashamed of asking to be spoon fed if I had the chance of learning and gaining knowledge and had the mental ability to read and understand. It's a different thing compared to someone who has learning disabilities but fights and tries to understand things.

gabi68
27-12-2021, 11:55 AM
Exactly. ...and if I knew about his ignorant attitude I wouldn't have wasted my time on him. Being proud about skipping classes is the ultimate proof of stupidity. I'd be ashamed of asking to be spoon fed if I had the chance of learning and gaining knowledge and had the mental ability to read and understand. It's a different thing compared to someone who has learning disabilities but fights and tries to understand things.
You don't know nothing about me. Writing this kind of messages only prove your stupidity and this came with the normal package of arrogance. I skipped courses because I need to work to support myself in Uni. Asking questions is normal. Receiving this kind of responses is NOT. I was thinking the reason of this forums is to help and learn from each other. I was wrong. People like you makes this forums bad. Big muscle and mouth over internet are not good. If you have something constructive to say, say it, otherwise shut up.

BeagleBrainz
27-12-2021, 12:27 PM
You don't know nothing about me. Writing this kind of messages only prove your stupidity and this came with the normal package of arrogance. I skipped courses because I need to work to support myself in Uni. Asking questions is normal. Receiving this kind of responses is NOT. I was thinking the reason of this forums is to help and learn from each other. I was wrong. People like you makes this forums bad. Big muscle and mouth over internet are not good. If you have something constructive to say, say it, otherwise shut up.

This is the attitude that proves the previous post.

How did you manage to wire your project with so little knowledge ?

Did you wire the mains yourself ?

Have you taken precautions to ensure there is proper grounding for the mains ?

Have you taken steps to have the mains side checked ?

It is not just you that are at risk if the wiring is not done correctly.

Mains electricity is not something to be blase about.

Yes one may ask questions, but one must also be prepared for answers and additional comments they don’t like.

gabi68
27-12-2021, 01:50 PM
Is not much of a project. I bought this fiber laser (I also have a CO2 laser and CNC router) and quite quickly realized that I need to find a way to automate the focus problem (which appear mostly when you change the lenses - every lens has a different focus - distance between part to be engraved and lens). After I found a device which do that (has a sensor for measuring distance) I realized I need to find a way to use the original software (which requires a homing procedure at start up) and the new device. I was told I cant use both and initially I was thinking to use 2 stepper drivers with the same motor. I took the advice give by some members (more experienced than me) to use the same driver with the same motor with a 4 pole relay (never worked with relays). All I need to do is hook up a relay with a 12V power supply (which is already there). Simple, but what kind of relay. I was asking that because I was thinking to make a PCB for all of this. With the relay and step/dir on the same board. That was my project. Nothing related with mains. I have some experience with electric and electronic devices, but all is at newbie level. I build a CNC controller and run into trouble with spindle and VFD noise. Dean (Jazz) was kind and helped me to understand the importance of star connection. All is working now, safely for over 2 years.
I asked some stupid questions, I know that, but to receive this kind of answer is harsh and I learn my lessons, not to ask anymore.
When the relay will show up I will connect everything with some led's first ofr proof and after that everything will be moved inside the fiber enclosure.

Thank you for your help

A_Camera
27-12-2021, 08:17 PM
You don't know nothing about me. Writing this kind of messages only prove your stupidity and this came with the normal package of arrogance. I skipped courses because I need to work to support myself in Uni. Asking questions is normal. Receiving this kind of responses is NOT. I was thinking the reason of this forums is to help and learn from each other. I was wrong. People like you makes this forums bad. Big muscle and mouth over internet are not good. If you have something constructive to say, say it, otherwise shut up.
Actually, you just proved my point. Even if you had to work, nothing prevents you from reading first BEFORE asking very basic questions. I helped you out all the way... and you call me stupid. I didn't skip classes and read the books. I have also programmed professionally during many years and even designed and developed both hardware, firmware AND software during the years, and believe it or not, I even have several inventions with my name on them... but I am the stupid... :thumsup: I actually like to help, but only those who are willing to learn and are not ignorant. Being proud of avoiding books is in my opinion ignorance. The arrogance is your attitude towards the criticism you received and the way you reacted to that criticism.

gabi68
27-12-2021, 08:24 PM
Actually, you just proved my point. Even if you had to work, nothing prevents you from reading first BEFORE asking very basic questions. I helped you out all the way... and you call me stupid. I didn't skip classes and read the books. I have also programmed professionally during many years and even designed and developed both hardware, firmware AND software during the years, and believe it or not, I even have several inventions with my name on them... but I am the stupid... :thumsup: I actually like to help, but only those who are willing to learn and are not ignorant. Being proud of avoiding books is in my opinion ignorance. The arrogance is your attitude towards the criticism you received and the way you reacted to that criticism.
You did not understand nothing. I did not call you stupid. You stated that about me, first. There is a word The clever give up first, so I will do just that. Take care.

BeagleBrainz
27-12-2021, 11:04 PM
Quote Originally Posted by gabi68 View Post
You don't know nothing about me. Writing this kind of messages only prove your stupidity blah blah blah


You did not understand nothing. I did not call you stupid. You stated that about me, first. There is a word The clever give up first, so I will do just that. Take care.

Obviously you still managed to get to the "Mental Gymnastics" and the "Advanced Double Negative" classes yet still missed "Remedial Plurals".

(Insert Preferred Pronoun here) gabi68 I insist you apologise.

A_Camera
28-12-2021, 09:19 AM
Obviously you still managed to get to the "Mental Gymnastics" and the "Advanced Double Negative" classes yet still missed "Remedial Plurals".

(Insert Preferred Pronoun here) gabi68 I insist you apologise.

It is not necessary to apologize. It would be pointless since he doesn't really understands his own words. To be honest, I think he is abusing the flag, his English is worse than mine and I don't think he is a British subject. At least not originally. Anyway, there is really not much to be said here.

BeagleBrainz
28-12-2021, 10:59 AM
Ah well I'll just sit back and wait for his next dummy spit.