HOME

 

       
Sorry, english translation is in progress. Come back soon!
Alternately try free on-line automatic translation tools (like Google language tools) for a computer-generated translation from italian

Discover stepper motors mysteries following simple rules

Driving stepper-motors

Fundamentals | Stepper motors | Stepper drivers | Schematic diagram | Truth tables | Half stepping | Half stepping table

Fundamentals

To operate succesfully a stepper motor you must understand the basics, otherwise you will unavoidably stop on the first difficulties. Although all stepper motors work according to the same principle, there are so many kinds of stepper motors on the market that it is almos impossible to list them all. Once you feel comfortable with the theory, you must get a driver stage capble to supply the power required by the motor, which can vary from a few milliamps to several amperes at voltages ranging from 3Vdc to 80Vdc

All stepper motors work spinning a permanent magnet (the rotor) by means of two or more solenoids placed on motor's case. In this respect they are not much different from many other kinds of motor; e.g. most DC motors used on toys may look similar, except they have a spinning solenoid and a couple of permanent magnets on the case. But a more subtle difference is in the way the solenoid is energised. A stepper motor has no sliding contacts nor any other means for interrupting or changing the polarity of the current directed to the solenoids. In fact, solenoid windings are brought externally (the can have from 4 to 6 wires and more): a special circuit, the stepper mnotor driver, will provide both energy and the special activation sequence to the different windings in order to move it gracefully. Energizing continuously one or more solenoids does'nt move the motor. Energizing the solenoid following the wrong sequence does not spin the motor (however it will produce some heat and noise).

So, why stepper motors require to follow a sequence for powering its windings? Let's take a look to one of the simplest stepper motors conceivable, a 4 step-per-revolution motor with 4 solenoids grouped as 2 windings (se figure below). Commercial motors can easily have 100 or 2000 steps for revolution, but burk according to the same principle. By contrast, a 4-step-per-revolution motor is easier to understand and can be built with 4 solenoids and a permanent magnet made free to spin

 

1

The first step begins with the upper and lower solenoids. They are electrically connected in series, such that when the positive pole of the battery is connected to the top solenoid, it produces a magnetic field with the south pole towardsthe permenent magnet. The lower magnet is laid out in order to face its north pole to the magnet. The magnet will move in order to face its north pole to the upper solenoid, and ith south pole to the lower. This is because of the attraction between opposite poles. Note the the remining solenoids are ininfluent because they are not connected to the battery.

2

On the second step the battery is connected to the left and right solenoids. This solenoids to are connected in serires, and wired in such a way that the left solenoid faces it magnetic north pole to the magnet and the right solenoid faces its south pole. As soon as the magnet feels the new magnetic field, it will rotate a quarter of turn clockwise to assume the position depicted here. It can't spin counterclockwise because doing so the north pole would face the north pole from the left magnet, and it is known that magnets with same polarity are rejected. On the other hand, moving clockwise the magnet moves accordingly to the magnetic attraction and finds quickly the position in this figure.

3

On the third step connect again the battery as in step 1, expect you must reverse the electric polarity. This change has the effet of reversing the magnetic polarity of upper and lower solenoids. Therefoere, the magnet will spin for another quarter of turn clockwise. The situation is a sort of simmetry of the first step, as if someone is observing the scene reflected in a mirror.

4

Can you imagine the fourth and last step? Well, we are going to connect the left-right solenoids pair, and again the only difference with respecto to step 2 is that the battery polarity is reversed. Therefore the magnet will align with its north pole to the left (facing the south pole coming from the left solenoid) and its south pole to the right (facing the north pole on the right magnet). This makes the magnet to rotater for another quarter of turn clockwise.

We are almost finished. So far we the magnet rotated for 3/4 of a turn. You can now continue repeating from step 1: as soon as the battery gets connected as in step 1, the magnet will complete its turn, and it will be ready for spinning again. The faster you perform the steps, the fater the rotation (but be careful not to go too fast, because you must allow the magnet enogh time to move from position to position).

Stepper motors specified for a different number of steps per revolutions work in exactly the same way, except you must repeat the sequence many times to get a full revolution, e.g. a 100 step/revolution motor requires the above sequence repeated 25 times to get a full revolution.
To change the speed of a stepper motor you can vary the time of every step. The shorter the steps, the faster the spins. It should be clear that for getting reasonable speeds, you cannot resort to manual switching to change solenoid's power and polarities, but an equivalent electronic circuit is mandatory!

To stop a stepper motor you can use two diffeterent techniques:


Stepper motors

 

The example above is the quintessence of stepper motors. Real stepper motors have at least 4 wires, matching the horizontal and vertical solenoid pairs. Some have 5 or 6 wires, trading power and efficiency for a somewhat simplified driving circuit (we will not cover 5 and 6-wire motors here for simplicity's sake, but you can imagine the extra windings as a connection to the wire that connects the above solenoid pairs in series), but also this kind of motors works according to the same principle.

The figure shows the symbol of a stepper motor. The vertical and horizontal solenoids pair are clearly recognizable. A+ and A- are the connection to the vertical solenoid pair, B+ and B- the connection for the horizontal pair. This kind of 4-wires stepper motors are referred to as bipolar stepper motors, because to drive the it is necessary to revert the polarity of the power on A and B (this was simulated by reversing the battery polarity in steps 1, 3 and 2, 4).
Tips:

  • Bipolar steppers have 4 wires
  • With a multimeter we can always separate the windings A and B checking the continuity. However we cannot identify which one is A or B.
  • Reversing the A+ and A-, or B+ and B-, or swapping A with B does not harm excepts the motor spins on the opposite direction.

 

Stepper motor driver circuit

A specil driver stage is required to control the power stepper motor's windings. The driver must withstand the voltage (V) and current (A) required by the motor. For a bipolar stepper, you need a drivers stage for each wire that comes from the motor: therefore, 4 identical driver stages are required in total. The schematic below is a typical stage for 1 wire, it can be used for motors specified from 5 to 12V and up to 1,5A. Each of the 4 stages required are connected to a Nutchip's output and a motor wire, respectively.

Each driver stage is composed by TWO darlington transistros, Q1 and Q2, type TIP122. Note that the schematic symbol for darlington is similar to a couple of transistors, therefore the actual circuit is simpler than it looks. Here is its operation:
  • when Nutchip's OUT is at logic level 0, the driver acts as a switch connecting the MOTOR wire to the positive power rail (Vmotor)

  • when Nutchip's OUT is at logic level 1, the driver acts as a switch connecting the MOTOR wire to the negative power rail (GND, dashed arrow symbol)

"+Vmotor" is the power source for the motor. Typical stepper motors require 5, 9, or 12V. This is a separate power source from the logic power source (Nutchip), which still requires its 5V power supply. The negative supply (GND) is in common between logic power supply and motor power supply.

 

Let's analyze drivers operation when connected to a stepper motor. A 9V battery supplies motor's power. We examine only the couple of drivers controlling the upper and lower solenoids (vertical). The same applies to the horizonatl solenoids pair (left-right), which are not detailed for clarity.

To implement the first step of the sequence previously described, the Nutchip drives the upper driver with a zero and the lower driver with a 1.

  • a logic zero for the upper driver connects motor upper winding to the positive power
  • a logic one to the lower driver connects motor lower winding to the negative power

Note that, from the motor's observation point, this is undistinguishable from the step 1 above.

Now for the third step from the sequence above, requiring the reversal of winding polarity. This is accomplished inverting the logic levels generated by the Nutchip, leaving everything else untouched.

  • a logic one to the upper driver connects motor upper winding to the negative power
  • a logic zero for the lower driver connects motor lower winding to the positive power

Note that, from the motor's observation point, this is undistinguishable from the step 3 above.

Per lasciare i solenoidi verticali inattivi (come nel passo 2 e 4), il NUTCHIP fornisce ai driver una coppia di 1.

  • sia il driver in alto che quello in basso collegano il motore al polo negativo. Siccome entrambi i fili sono allo stesso potenziale, la corrente non circola ed il magnete è libero di muoversi.

Si ottiene lo stesso risultato anche pilotando i driver con una coppia di 0.
In tal caso, entrambi i fili del motore si portano al polo positivo, ma essendo ancora entrambi allo stesso potenziale, la corrente non circola lo stesso.

 

 

Schema elettrico

 

Per semplicità, in questo schema ogni statio driver è disegnato come un blocchetto. Se il vostro motore è a 5 volt, potete collegare la +Vmot alla +5V senza problemi. Altrimenti vi serve un secondo alimentatore per fornire la tensione positiva al motore (il cui polo negativo va collegato assieme al negativo che alimenta il NUTCHIP).
Serve una buona dose di pazienza per montare tutti gli 8 transistor darlington e i 12 diodi necessari. Inoltre bisogna scoprire quali sono i fili A e B del motore passo passo.

Potete limitarvi a separare i fili in due coppie usando l'ohmetro. Il circuito infatti funziona ugualmente:

In tutti questi casi il motore girerà ugualmente, anche se al contrario. Se invece commettete altri errori (ad esempio, scambiate A+ con B+) il motore non girerà.

 

Tavola degli stati, pilotaggio a 4 passi

Se la spiegazione del circuito è stata lunga, la tavola degli stati che aziona un motore passo passo è sorprendentemente semplice: basta generare quattro stati, uno per ogni passo della sequenza illustrata sopra. Il file relativo è stepper.nut. Lo stato 1 genera il passo 1, lo stato 2 il passo 2 e così via. Il timeout fa cambiare automaticamente stato, saltando al passo successivo. Il tempo che si imposta come timeout determina la velocità del motore.

Tavola della verità per azionare uno stepper motor

 

Mezzi passi

C'è un'altra sequenza idonea a fare ruotare un motore passo passo: la cosiddetta half step (mezzo passo). Si ottiene dalla sequenza precedente, in cui fra ogni passo ed il successivo si aggiunge un passo creato unendo gli altri due.

Ad esempio, fra il primo ed il secondo passo si inserisce:

1

-

2

Passo 1 e mezzo:


In questo passo si collegano gli avvoglimenti sia del primo passo, sia del secondo.
La calamita ruota di un ottavo di giro, per avvicinare portare il proprio polo N in una posizione intermedia fra i due poli S che ora si trovano in sia alto e sia a destra.

La sequenza half step è quindi composta da 8 passi anzichè 4. Ogni passo aggiunto è la "somma" del passo precedente con quello seguente.

Tavola degli stati, pilotaggio "half step"

Il file stepper_half.nut pilota il motore con la tecnica del mezzo passo.

L'half stepping ha vantaggi e svantaggi:

  • dà molta forza alla rotazione (per metà del tempo si attivano 2 avvolgimenti anzichè 1)

  • attenzione però a non surriscaldare il motore (che deve dissipare l'energia di 2 avvolgimenti al posto di uno solo)

  • la velocità massima si dimezza (è raddoppiato il numero di passi)

  • la precisione di movimento raddoppia (facciamo due passi dove altrimenti se ne faceva uno).

Tavola della verità per azionare uno stepper motor con la tecnica "half step"