What is the best way to snub a bipolar stepper motor coil

(Edit: Corrected first paragraph below.)

Thank you, very much, Perry. I appreciate the pics you sent in your PM to me. And I see that the pictures have now appeared on your original post (but not in their correct places. There are place-holders in the text, and the pictures now appear after the text.)

I have a question: What is the best way to snub a bipolar stepper motor coil (e.g. a Lavet stepper motor, as used in most inexpensive quartz wall-clock movements), when driving such coils from two I/O pins of a microcontroller device? I have seen a few snubber circuits for these (some of which look questionable).

The first one here (which falls into the “very questionable” category) is for a Vetinari type wall clock project:

Snubber1_LooksBad

The original schematic shows D1 and D2 as 1N4001 rectifier diodes.

I think the above circuit is bad, because it looks like there is an almost short circuit across either D1 or D2, whenever the microcontroller pulses a logic high on (respectively) either PB1 or PB0.
Nevertheless, the developer of this circuit has a YouTube video showing that his clock, indeed, works! (In the video, note the red clock on the right.)

I am surprised the video does not show any of “The Magic Smoke”* escaping from either of the diodes or from the microcontroller. Perhaps he added some series resistors into the circuit and did not update the original schematic as published in his blog post. But, even if he did, the voltage that would pulse the coil would only be the voltage drop of the forward-biased diode (about 0.7V ?) instead of the 1.5 V that the motor coil expects. So I am not sure how this clock is working.

BTW, that original schematic also shows a 1.5 V clock module circuit output directly driving the bases of two BJTs (configured as a 2-input NOR gate) WITHOUT any base resistor!. So, again, I wonder that “The Magic Smoke”* has not escaped from the clock module or either transistor, due to a large base current.

(* Of course, we all know that silicon devices, integrated circuits, etc., all work because of The Magic Smoke particles that live inside them. However, if someone were to ever abuse any such device with too much voltage or current, The Magic Smoke would become very unhappy, and escape from the device, which will never work again, because The Magic Smoke is no longer inside to make it work. :grinning_face_with_smiling_eyes:)

The next snubber circuit (for another Vetinari clock project) looks a lot better:

Snubber2_LooksBetter

(Note that, in this case, the original schematic shows the designer using a PIC micro instead of an AVR one, but I wanted to keep this post “Arduino-friendly,” :wink:)

I have seen examples of the above type of snubber, using either rectifier diodes (like 1N400X type diodes) or Schottky diodes. But I am wondering if this type of snubber circuit would affect the power supply? Most of these types of projects are battery powered (for use in a wall clock). So, when the magnetic field of the stepper motor coil collapses, would a lot of current flow from the negative battery terminal (connected to ground), and affect the power supply?

The third (and final) circuit that I have seen (I forget the source) looks even better:

Snubber3_LooksBest

In this case, diodes D5 and D6 are 2.4 V, 1 W Zener diodes. my understanding of this circuit is that, when the magnetic field collapses, and the “back EMF” becomes larger than the Zener voltage of (say) D5 plus the forward voltage drop of D6, then both diodes conduct and “short out” the coil.

So, enough (too much?) background, and on to my questions.

Is the second circuit shown above (with either regular rectifier or Schottky diodes, connected to ground) “good enough”, or should the third circuit (with Zener diodes) be used?

Is there a better way (than the ones shown above) to “snub” a bipolar stepper motor coil?

With thanks and regards,
DuinoSoar.

@DuinoSoar
I have split your question from the tutorial notes, it’s a question on its own, it doesn’t belong there. Please read: How to get the best out of this forum
Thanks.

My apologies it it did not fit. I felt it was related because I asked about snubber (or fly-back) diodes for a particular type of coil circuit. (i.e. bipolar as opposed to unipolar coils). As well, I thought that others who had contributed to the original discussion might have some thoughts on this.

One question, one topic, that’s the rule here. People will see the question, those that know the answer will help. If no one knows the answer no one will help, but from what I have seen here there are several people who will give you a good answer. The tutorial addresses ‘why’ you need them, it does not address and is not intended to address any specific case and the best way to use diodes in each case.

Didn’t read the lengthy post, but the correct way is four Schottky clamping diodes.
Two from each line to ground, and two from each line to VCC.
On the motor side, in case you use resistors.
Leo…

The answer is basically a rectifier bridge, with the “~” (AC) pins connected to the motor pins and “+” and “-” connected to the corresponding supply terminals - “Vdd” and “ground”.

But if you ever might (unlikely in general and certainly not for a clock!) be commutating within the recovery time of the diodes, you would want to use fast recovery diodes, which Schottky diodes are. Whether you need Schottky diodes to restrict the voltage excursions to less that 0.5 V either sides of the supply range is a bit of a question in itself and all ready-made driver modules will necessarily include these diodes in any case.

For a clock motor and an ATtiny85, any old bridge rectifier wodul be fine. As would 1N914/ 1N4148 diodes. :grin:

The resistors are to limit the current draw from the ATtiny, nothing to do with the diodes. If the motor resistance already limits the current to 20 mA or less (more that 250 Ohms), they are not required.

Thanks for responding, Leo.

But why Schottky diodes? Would normal rectifier diodes be too slow to start conducting, and allow some spike(s) to get back to the processor inputs? As noted in my original (and, as you pointed out, admittedly lengthy} post, I have seen (on the web) folks using 1N400X rectifier diodes instead of Schottkys. As well, the original post by @PerryBebbington shows a 1N4004 (rectifier diode) for his unipolar coil example. Does the difference in unipolar vs bipolar coils make a difference in what kind of diodes to use?

Also, why the diodes to Vcc? Again, none of the examples I have seen on the web have them, and Perry did not show one in his original post,

From Perry’s oscillographs, I see that, for the uncorrected version, there are, indeed, high-voltage spikes of both polarities during the ringing (on his 20 uS per div trace), but then, his corrected version (with the single 1N4004 diode to ground, but none to the positive supply) shows no significant spiking of either polarity. (Although that last trace is only 4 mS per div so, perhaps that oscillograph’s time-base was too slow to catch any spikes?)

And, finally, why would the back-to-back Zener solution (in the third example that I showed) be inferior to connecting diodes to ground (or, as you suggested, to Vcc)? My (maybe incorrect?) thinking is that the third example would prevent large transient currents from flowing through the supply battery (whereas the diodes connected to ground - and Vcc - might do so).

I’m not trying to naysay your suggestion; I just want to understand how these things work, and the necessity of using Schottky diodes (over rectifier diodes), and of adding the extra diodes to Vcc.

Thanks, and very best regards,
DuinoSoar.

It is a common misunderstanding that diodes are slow to start conducting. All diodes start conducting equally fast. It is “fast recovery” diodes that are chosen to stop conducting quickly when you instantly reverse bias them.

Thanks for your reply, Paul.

I have not (yet) characterised the clock coil (and I expect they are different for different clock motors), so do not know its resistance; and I have no way (that I know of) to measure its inductance (i.e. how many little Millie’s and Henry’s are squeezed into the coil :grinning_face_with_smiling_eyes:) to determine the reactance.

However, since I plan to run the ATtiny85V at 3 or 3.3 V, I will probably want to add a total extra resistance of (or nearly) the same value as the coil resistance, to bring the pulse voltage from the ATtiny85V down to approximately 1.5 V (the normal pulse amplitude supplied to the clock coil from the clock motor’s little circuit module).

I really appreciate the help and suggestions I am reading here, so thanks, again!

Best regards,
DuinoSoar.

Oh, thank you! I just learned something new! So for this application, the recovery time really does not matter, I think, because the next pulse will be eons later (in diode switching time, that is :grinning_face_with_smiling_eyes:).

You want the external diodes to conduct before the internal pin-protection diodes.
Schottky diodes have a lower Vf (forward voltage), so the MCU pin hopefully stays below the specified ~0.5volt max.
The 1N5819 should be in every toolbox.
Leo…

Ah, so now I understand better. So the 0.5 Vf will allow the Schottkys to conduct before the internal protection diodes in the micro. I actually did not think about that (the internal diodes, that is).

I guess I am going to order a big handful of 1N5819s for my toolbox :grinning_face_with_smiling_eyes:

And here in the Great White North (well, it’s a bit greener here, now :grinning_face_with_smiling_eyes:) vendor “FTVOGUE” (via Amazon.ca) sell a kit of 200 assorted rectifier and Schottky diodes for CDN$10.69: 20 each of 1N4001 to 1N4007 and 20 each of 1N5817 to 1N5819. Probably all I need for now.

Edit: Oh, rats! So much for ordering from Amazon.ca for the next couple of weeks. :frowning_face:

Thanks, once again, guys.

Actually, for this application it will not matter because you will presumably have the microcontroller pins always set to OUTPUT, so the pin will be clamped to whichever supply rail the logic sets it to. Not only does the output stage pull the pin to the corresponding rail, but it prevents it going beyond that rail.

And in general, a silicon diode will suffice anyway as it conducts at the same threshold as the microcontroller silicon and has a much larger conductive area so it will divert almost all of the current.

It would be nice if we could get to “one question, one answer”, but it is rare that we get enough
info in the OP to do that. I have seen it done, but it’s the exception, rather than the rule.
Usually it comes down to a game of “20 questions”.

As far as the OP’s question, I’m not familiar with a Lavet-clock movement but I guess that
implies it is small and draws very little current.

If more current were needed , here are some options.
The A4988 is the cheapest easiest way to drive one, being that it has STEP/DIR inputs which
allow you to use the AccelStepper library.

Another alternative, not as user friendly is the L293 and L298 chips.
Here is an example of the L293. Just replace the M? labels with Coil-1 and Coil-2.

Here’s and example of the L298:
l298n-motor-driver-module_02
Not my choice because it lacks the STEP/DIR front end which is the preferred way to talk to
steppers. I’ve written code for a 4-input L293 but it is time consuming and not nearly as nice
as the AccelStepper library.
Here’s the A4988 with STEP/DIR without current boost

And here’s the A4988 with current boost:

I wouldn’t try to drive a stepper from an ATiny85, as much as I like that chip. It’s just not a stepper
driver.

To the first schematic from OP: common wall clocks are able to work down to very low battery voltage. Surely less than 1 V. Subtract the driver resistance and it is clear 0.7 V should be enough for the stepper to step.
The pins of microcontrollers have nontrivial resistance. This resistance limits the current seriously. At very low supply voltage the pin of an AVR is unable to exceed the absolute maximum rating of 40 mA even when shorted to a power supply rail. When you short two pins together their internal resistances add and so they survive even in case of considerably higher supply. When you add a diode between them and limit the current to a short pulse it is unlikely a damage will occur soon. It may cause reliability problems after extended time period or when another stress is added (such as high ambient temperature).
The driver resistance also explains why the discrete NOR gate works despite lack of Base resistors.
It is not a good design but I hope this explains how The Magic Smoke stays inside the ATTiny.

@Paul_B and @Smajdalf : Wow! Thanks for the physics lessons, folks. I probably knew the theory behind what you wrote, when I studied about semiconductor materials a long, long time ago. (In fact, back in the days when Don MacLean first released his song that starts out, “A long, long time ago …” :grinning_face_with_smiling_eyes:.) I have forgotten most of what I learned way back then, so it’s nice to be reminded. (BTW, there is a reason why my user name is close to “dinosaur”. :wink: )

I kind of disagree. One of the great things about a forum like this is that we can learn different perspectives and ideas from different contributors to a topic. I have learned something from each responder here, so I very much appreciated all of the contributions.

Concerning the Lavet stepper motor design, my original post had a Wikipedia link to the topic of the Lavet Stepper Motor. The motor has only one coil (so is “single phase”), which is alternately pulsed in either direction (so the coil is bipolar). What is really ingenious about this design, is the way that the geometry of the stator core is configured, to bias the magnetic rotor to turn an extra 45 degrees (or thereabouts) in one direction, after the pulse is removed from the coil. This causes the next pulse (of opposite polarity) to turn the rotor always in the same direction, instead of randomly flipping in either direction. The motor was designed in 1936 by the French engineer, Marius Lavet (another Wikipedia page).

Note also that these (clocks) are not stepper motors. A standard stepper driver maintains current on at least one coil. The clock motors are only ever pulsed, first in one direction and then the other. The reason is obvious.

A common amusing trick is to run them up to say, ten times normal speed. :laughing:

I know it is not a “stepper motor” in the traditional sense, but I have always seen them described as a “Lavet stepper motor.” After all, they do operate by “stepping” first one pulse, then another pulse.

See: How fast can a Quartz Clock spin? (YouTube video)

The YouTuber has the motor extracted, so we only see the effect on the magnetic rotor, not the clock hands.

I guess you can never get too much free advice.
Glad you are willing to learn. You would think
everyone would be but incredibly we’ve had
some posters who just want us to skip the theory
and fix their circuit. You know how this works.
If someone tells you something useful , you tell
two people and they tell two people etc etc etc

1 Like

You need the external protection diodes to conduct before the internal diodes to protect them - the internal diodes are very small and vulnerable to overload for repeated use. Schottky diodes conduct before the internal pn-diodes.

You can get multiple schottky diodes in a single package expressly designed for this sort
of protection, like the BAT54ST, BAS70-04 and QSBT40