Stepper Motors — Precise Position Control

The Great Benefit of Stepper Motors — No-H-Bridge or Closed Loop Needed— Ardu_Serie#51

J3
Jungletronics
9 min readNov 27, 2018

--

How does stepper Motor works? more specifically a NEMA and 28BYJ-48 stepper motors type.

First of all, we have to know how to connect the stepper motors with the chosen driver.

For this, we need to know the wires that poke through the ends of the coils and put them in a pair and in order of firing.

After much observation, I think I came to the pattern of how to discover the ends of the motor's coils.

Let’s get started!

NEMA

Usually, these types of motors the wires leave the motor in pairs and the other end of the wire appears in the firing sequence. it’s pretty easy. Look:

Wiring color: for Blue, Green, Red, and Black wires:

The coils’ pairs are distributed like this: 1 pair (blue + green) and 1 internal pair (black+ red);

28BYJ-48 12v (Bipolar mode)

Wiring color:

For Orange, Black, Red, Yellow, and Violet colors:

The coils’ pairs are distributed like this: 1 pair at the ends (orange + violet) and 1 internal pair (black + yellow); red is left disconnected

28BYJ-48 5v (Bipolar mode)

Wiring color:

For Yellow, Orange, Red, Pink, and Blue colors:

The coils’ pairs are distributed like this: 1 pair at the ends (yellow + blue) and 1 internal pair (orange + pink); red is left disconnected

Firing Order

Now regarding the firing, look at the sequence of the ends of the cables that follow the motor: usually, they are in ascending order of firing:

This is Unipolar Motor(hybrid, actually!); In its Bipolar mode, red(5) is left disconnected.

Amperage Detections

Another major concern, regarding stepper motors mainly, is the amperage that runs on each motor coil considered.

The datasheet informs us of these specifications.

But as a hobbyist, without sponsorship, I often have to buy a Chinese product, cheaper, and this often comes without datasheet or any documentation at all…

In fact, the main victim of the lack of amperage’s detection of the motor is the driver.

I have already killed my beloved Adafruit v1 and v2 and Easydriver 4.4 because of the lack of understanding of amperage specification.

So, figure out the amperage of your motor, please!

In the video above, you will see how to do and how not to do it… watch it, please!

What Are The Ways I Can Run Stepper Motors?

There are 3:

Wave Drive

Full Step

Half Step

Borrow from: 28BYJ-48 Stepper Motor and ULN2003 Driver Intro

We’ll start out talking about driving with Wave driving.

We’re going to fire just a single phase at a time; this is probably the simplest method but it’s likely the least used because the other two methods have some advantages but with wave driving again we’re only going to fire a single phase at a time, so if I look through this diagram on the top in any one time slice so with step one just the blue phases energized then just the pink phase then just the yellow then just the orange so there’s really four phases in this cycle here and then I just repeat blue-pink-yellow-orange;

LAB 01–03

Let’s now have a little practice:) Use your ULN2003 BOARD this way:

Connections for ULN2003 and Arduino UNO (or micro)

Please see this post for more information:

Full stepping is going to give me the same step angle as wave driving so I’m going to get the same precision with the full step as I do with wave drive but I’m going to get double the torque because with full stepping we’re actually going to energize two phases at a time so at any one given time slice; here two phases are energized; first the blue and the pink then the pink and the yellow then the yellow and orange then the blue and the orange; so that’s a single cycle through those four phases and then again I repeat blue and pink yellow pink yellow orange orange and blue.

Please see this post for more information:

The third choice that you have is Half-stepping; with half-stepping we’re actually going to sort of making a combination of wave driving and full stepping; this is going to give us a little bit less torque than full stepping because half of the time two phases will be energized but half of the time only one phase will be energized, so it’s not going to have as much torque as full step; the benefit of half-stepping though is that we’re going to get half the step angle so we get double the precision if you will with half-stepping; we’ll start out with just the blue phase then we’ll also turn on the pink and get the blue in the pink then just the pink and the pink and the yellow they’re just the yellow then the yellow and the orange then just the orange and then the blue and the orange so there’s actually eight phases in the full cycle here with half stepping.

64:1 GEAR RATIO

So let’s take a look at what the gears due to the behavior of the motor;

Borrow from: 28BYJ-48 Stepper Motor and ULN2003 Driver Intro

So sitting on top of the coils and the rotor and all that stuff was a plate; there’s a hole; in the middle that the rotor shaft pokes through that rotor shaft. It is itself a little 9; to that plate are some other gears; the first is a 32 tooth gear that meshes up with that 9 tooth gear; when two gears are in a mesh you can figure out their gear ratio simply by dividing the one by the other; that gives me a three-point five five five gear Ratio; That means that that inner rotor has to go around three-point five five five times for the outer 32 tooth gear to go around just once;

Now ganged on to that thirty-two tooth gear is an 11 to 9, and it meshes up with a 22 to that sum 9; to that meshes up with a 26 divided by nine is equal to two point 888 gear ratio, and then a final 10 tooth messed up to the 31 and that gives me a 3.1 gear ratio;

Now to figure out the gear ratio of the entire system I simply multiply those individual gear ratios up and that gives me a total 63 point six five to one gear ratio; so not exactly 64 but we’ll round it up and just call it a 64 to 1 gear ratio and what that means is that that inner rotor has to go around a total is 64 full rotations in order for the outer motor shaft to go around just once.

That’s going to give you some pretty good precision for this inexpensive motor.

When full stepping, It takes 32 steps for the magnetic rotor inside the motor to complete a full 360° rotation, turning 11.25° each step.

Half stepping changes that to 64 steps of 5.625° each for a full rotation.

The rotor shaft has a 64:1 ratio with the motor shaft though, so for the motor shaft, those numbers change to:

Full Stepping:

32*64 = 2048 Steps per motor shaft rotation

That gives us a .18° step angle.

Half Stepping:

64*64 = 4096 Steps per motor shaft rotation

That gives us a .09° step angle.

So again some pretty good precision for such an inexpensive motor.

Types of 24BYJ-48 Motors

The 28BYJ-48 is a small stepper motor suitable for a large range of applications.

The 28BYJ48 stepper is mainly used in Air Conditioner Louver, Small Cooling/Heating Fan, etc. It also can be used in K accurate control. Stable and all technical parameters are qualified for the national electronic standard of SJ/T10689–95. You can control this motor easily by ULN2003 Stepper Motor Driver.

There is the 5V and 12V version of 28BYJ-48 Stepper for your selection.

Types of NEMA Motors

The primary NEMA number specifies the position and size of the mounting face as shown in fig below. NEMA stands for National Electrical Manufacturers Association.

Image from: http://blog.inventables.com/p/stepper-motors.html
Image from: http://blog.inventables.com/p/stepper-motors.html
Nema’s stepper motors

Here in Brazil, some online electronics stores sell stepper motor written like this:

** AA**BB– AAAAA

For example, mine is a: JK 42 HS340424A, it means:

A = 42 mm ; B = 34 mm; 0.424A/Coil. HS means High Speed:), so, this is one NEMA17 (see table above).

(I suppose that’s the spec is right, by experimentation and self-measures :))

Simple as that!

Download All The files for This Project

👉️ github repo

Credits & References

28BYJ-48 Stepper Motor and ULN2003 Driver Intro by Bret Stateham

The Maker Show: Episode 8 — Driving Your Stepper Motor with an Arduino by Bret Stateham

Stepper Motors — Chapter 13 — AC Motors by https://www.allaboutcircuits.com

JayThree Balancing Car Project — Part 2/5

Stepper Motor NEMA^ Sizes

28BYJ-48–5V Stepper Motor datasheet

Sparkfun — Motors and Drivers

Related Posts:

Meet DoRobot — Assembly Techniques J3 Caterpillar-Crawler-Chassis v 1.0 — ArduSerie#46

L9100S — Toy Driver Easy To Use — Toy-low-voltage-h-bridge-easy-to-use-motor — .8A@12v peak — Ardu_Serie#47

EASYDRIVER: 4-Wire-Stepper Motor DriverBrian Schmalz Design on A3967 IC — Bi-Polar Motors — .75A@30v peak — Making Using These a Breeze! Ardu_Serie#48

DRV8825 — High Current Stepper Motor Driver Carrier — Stepper Motor — Bipolar Mode — 2.5A@45v peak — Ardu_Serie #59

L298N — Dual Full-Bridge Driver — Darlington Transistor Arrays Based — 3A@50v peak — Ardu-Serie#52

TB6612FNG: Dual DC Motor Driver — SparkFun Motor Driver — 3.2A@13.5v peak — Ardu-Serie#49

A4988 — Stepper Motor Driver Carrier — Allegro’s A4988 — Bipolar Stepper Motor Driver — 2A@35v peak — Ardu-Serie#53

Adafruit Motor Shield v1 & v2–4 DC Motors or 2 Stepper Motor or 2 Servos — 1.2A@25v & 3.2A@15v peak — Ardu-Serie#54

IFR 520 MOS — Module + DoRobot — Switch Heavy DC Loads — 10A@100v peak — Ardu-Serie#60

L9110 H-bridge module + DoRobot — DC Stepper Motor Driver Board — .8A@12 v peak — Ardu_Serie#62

High Current Motor Drive Applications — NovalithIC T M — 24v@43A peak — ArduSerie#64

VNH2SP30 — Monster Moto Shield — Use This Board In Extreme High-Demand Application — Full-Bridge Motor Drivers — 16v@30A peak — Ardu_Serie#63

  • Edited 06/2020 — Minor corrections & Add google drive download link:)

--

--

J3
Jungletronics

Hi, Guys o/ I am J3! I am just a hobby-dev, playing around with Python, Django, Ruby, Rails, Lego, Arduino, Raspy, PIC, AI… Welcome! Join us!