Let me start with quoting an incredible and wise robotics professor I met at a conference (which for obvious reasons, I won't mention):

Steppers are like smartphones: everybody uses them without knowing how they work. And, just like the smartphones, most of the people use them in stupid ways.

This is the starting point of this guide. Steppers are popular, steppers are everywhere, steppers are apparently easy to use. From a procedural point of view, indeed steppers are the easiest thing to use to provide motion. This is why, soon after RC servos, they are so popular among makers and software engineers.

So you may say: why to provide another guide to steppers? Well, the reason is simple: there is a huge, enormous, tremendous difference between providing motion and providing a good and precise motion control. In fact, this is a critic to software engineers, if steppers work well with computers, it does not mean that they work well, from a mechanical point of view, in every application. There are many limitations with steppers, but, since they provide simple motion control, I see them applied everywhere, even in those applications where a DC motor (brushed or brushless) is the only good choice from a mechanical point of view (such as speed control).

When working with steppers, everything should start and end with the functional definition of steppers:

Steppers motors are designed to provide discrete motion. The motion provided by steppers is discrete both in time and space.

Hence this guide will first describe in details the physical principle of stepper motors, hence you will be able to understand the mechanical charachteristics of motion. Then I will explain you how to control steppers: both by looking how to select and hookup the hardware and how to design a simple control software with Matlab and Labview.

How it works

I won't steal your time into describing the components and the design of stepper motors, since you can find exhaustive explanations throughout the Internet ( check Wikipedia). Conversely, I will focus on the description of the working principle and the mathematical model of stepper motors.


Layout of a stepper motor: you can see the rotor and the motor case. The two are coupled by an electromagnetic field that creates a multi-stable mechanical system.

A game of stability and instability

The physical principle of steppers is to exploit the behavior of electromagnetic field to create a mechanical system (the rotor) which rotates around several stable positions (the steps). However each stable position is characterized by a limited level of stability, hence a perturbation in the magnetic field is able to push the rotor from a stable position to the next one. In fact the process of stepping is achieved throughout the following scheme: stable position-perturbation-instability-new stable position.

At this point most of the readers might be confused: what is a stable position? Why motion happens within stable positions? And, furthermore, how is it possible to provide discrete motion within a stable-unstable system?

In order to understand the stepper, we need to call its purely mechanical counterpart: the buckled beam. As a desk-experiment, pick a plastic ruler and apply compression at its tips until buckling appears. Then apply a small force right in the middle of the ruler and soon you will find that the buckle flips upside down.

The ruler experiment is the classic buckling instability phenomenon described in the following figure. As you can see, the mechanical system has two stable positions (stable configurations). Each configuration is characterized by a low level of stability, hence even a small force can cause instability. Consequently, due to the instability, the system moves really fast until the other stable position is reached.

Discrete motion of a buckling beam throughout the stability-instability-stability scheme

The scheme here described is the key to understand discrete motion. In fact the position of the beam center can be only one between the two stable one. Every other position cannot be reached by the system due to the fact that they are not stable position. In addition, the existence of several unstable position guarantees that the switch from a stable position to another is almost instantaneous and, in any case, not controllable.

In the case of bistable (or multistable) systems motion is discrete in terms of:

  • space, since the only configuration available are those which are stable
  • time, since the the way the systems moves from a stable position to another is not controllable due to the unstable motion

Coming back to steppers, these motors are designed so that the system rotor-electromagnets generates a n-stable mechanical system (where n is the number of steps for each revolution). In this configuration the motion of the rotor is not truly controllable. In fact we can only choose in which position the rotor will be, but not how the rotor will travel from one position to another.

Once you have understood the bi-stability thing, you know almost everything you need to know about the application of stepper motors. As we will see, the field of application of those systems is strongly limited (or at least, it should be strongly limited) by the multi-stable behavior.