A smarter approach to rotary control : a second stepper driver controlled by a relay

I installed a relay for my rotary axis to steal the Y axis outputs. I then added an aircraft connector for a disconnect for the rotary unit. Its probably not the best solution but it has worked for me for several years and I am used to it. I do have to make a machine profile for the xy or rotary modes… Next laser build I will set that up better. lol

1 Like

That’s a nice way to do that. I’d probably be too concerned with breaking a circuit with an energized motor winding and Back-EMF into the stepper motor driver. I think you’re seeing something I’m not since it’s worked so well for so long.

Where would this come from?

I have hot swapped my rotary, since I got it… he’s doing the same thing…


I should have specified… I just took the pulse and direction from Y axis through a dual pole relay to another stepper driver. I was frustrated with accidentally moving the axis when jogging my x over the rotary. I kept pushing Y and messing up my center on the rotary axis. I first move the machine to known coordinate centered to the rotary. Then push the switch. This way both my Y axis motors stay locked and I physically cannot jog that axis. I was still using LaserCAD when I built my laser. I have since been using lightburn with much more advanced rotary features… now still have to reconfigure the machine and place the rotary axis on another output. Put that all off because the machine is giant and I conveniently have all the electronics accessible only from the back… several design concessions taken into note for next laser build. I am learnding.

Excellent idea!

Using two drivers finesses the whole motor current gotcha and avoids glitching the driver transistors every time.

Well done!

Any time you (try to) interrupt the current through an inductor, the current will continue to flow, with the voltage across the switch / relay / whatever increasing up to air’s breakdown voltage. With solenoid valves you put a catch diode across the coil and avoid that drama.

A stepper motor winding sees bidirectional current in normal use and the only diodes are clamps from the driver outputs to the supply voltage. Disconnecting an active winding dumps that transient voltage into the supply. Eventually, hilarity ensues.

1 Like

most modern stepper drivers have a current shunt resistor to sink back EMF to ground. It may or may not be a problem depending on the topology of your stepper driver and the size of the inductive load. Fortunately most laser machines use smaller stepper motors and they physically cannot produce a huge spike when discharged. Also a motor at rest will have less chance of producing a large spike when disconnected. I do not recommend switching while in operation or if your stepper driver has a low current rating. Some of the arduino or raspbian hats do not even contain back emf current shunt and should be treated as such. If you are using a decently over specked driver you will be safe to swap with a relay even at the motor outputs as long as you use a multi pole relay or two dual pole relays and swap both/all poles at once. The powered load will be disconnected and the back emf will not dump to your drivers. It should be quite safe either way.

some documentation below shows typical driver topology as well as current vs voltage in various BEMF conditions

Back EMF is a different animal than the problem arising from disconnecting / unplugging the motor from the driver with the power on. It’s what the spinning rotor magnets produce in the stator windIngs, which looks like this:

The voltage works against the supply voltage (particularly 12 V supplies on cheap CNC / lasers) and lowers the driver’s control authority, eventually wiping out all the torque:

Depending on where the motor stops with respect to the major step sequence, one of the windings may be sitting at maximum current and the other at zero. At best, they’ll both sit at √2 of the peak current, so you take your chances.

Long ago in a universe far away, I got tapped for a failure analysis of several steppers that died randomly in a particular CNC machine. Turned out the problem came from a flaky connector randomly opening the windings; the charring inside the motors was a wonder to behold.

So maybe I’m overcautious, but: been there, seen that.

As with most risky things, most of the time you live to tell the tale.

I blew two stepper drivers on my 60120 cnc with a flaky phoenix connector. That condition was rather hard on the components. Both stepper drivers connected to one beefy 48 volt 40 amp power supply… both drivers let out some of the magic. Upon inspection of the boards I could clearly see both shunt resistors melted on each…

We’ve gone a fair bit off topic without helping the original poster. I’m going to move the interesting sidebar to a new topic so we can refocus on the original quesiton.


Yes, I understand… although when I pull the plug there is only a disconnected winding… the only place it could discharge would be across the field windings…


It’s what happens as you pull the plug: the arc forms across the first contact to open: after the fireworks end, then you have a disconnected winding.

1 Like

There is nowhere that the driver manuals state you have to have snub diodes on these…

The fields are building and collapsing normally… so what would be the difference?


The driver can control the current through the winding, with the dV/dt limited by the supply voltage (minus back EMF, as above), during normal operation.

Because the current through the winding is bipolar, there’s no way a snub / catch / flyback diode will work, which is why you don’t see them recommended. As above, the only diodes are from the driver terminals to the supply.

As you yank the plug, the energy stored in the magnetic field must go somewhere. The arc starts between the contacts as they open, with the current declining as the energy dissipates in the winding & arc resistance.

1 Like

They do this with an H-Bridge and have snub diodes there…?

L293 driver…

Snub diodes are here the polarity flips completely… unless the motor drive splits the supply some way, it can’t be any worse than this…


Which is an obsolete driver intended for DC motors and full-step high-resistance steppers, where the winding resistance limiting the current.

The two motors on the right are DC motors, not steppers, driven in a single direction.

The motor on the left runs in bipolar mode, but is also a DC motor. Note that the diodes are not across the windings, but to the supply voltage (and ground).

They do show how to drive a bipolar two-phase stepper in Figure 6 of the TI datasheet, with the same diode arrangement as on the left: to the supply and to ground, not across the windings.

The datasheet for the venerable A4988, a slightly less obsolete microstepping driver, shows the same bridge wiring, but using MOSFET body diodes and a current feedback resistor for each winding. The datasheet goes into great detail about shorted windings, but is conspicuously silent about opened windings, for well and good reason.

1 Like