Motors

Introduction

Motors are a very common type of component which are found in a wide range of equipment; printers, washing machines, computers (for cooling), drills, and game controllers (for rumble effect), to name but a few. An early 1800's invention, motors in the most basic form are made up of an electromagnet and, a north and south permanent magnet. The electromagnet also has a north and south pole and when current flows through the electromagnet it will turn since like poles repel. To get the motor shaft to turn again the electromagnet field must be flipped. This is achieved through the use of brushes (made from metal or carbon) that make contact with the motor winding of the electromagnet.

New: Update: Stepper motor (01/06/2014)

L293D bidirectional DC motor control (2/9/13)

PFUP1097ZA-A Stepper Motor Driver board

You can email me at james.boshikoopa@gmail.com

To return to the main Electronics page click here.

The simple type of motor described above has been expanded on over the years and on this page you will be able to read about a number of different types of motors as well as circuits that use them. In general, motors are controlled by a microcontroller or more complicated IC but because these chips cannot directly drive motors (since motors typically require a higher voltage and current than what the IC can give) some form of drive circuit is used. As well as letting the weak output from an IC control a motor, driver circuits also protect the chip from the back current (back e.m.f.) that flows when a motor is switched off.

Traditional Motors

The traditional type of motor was detailed in the Introduction section and is used when you need a motor that will continually turn while power is connected. The small type of motor, such as the one shown in the photo below on the left, was obtained from a computer CD drive. The more heavy duty motors like the ones in the middle of the image below are more likely to be found in printers and scanners.

These motors usually have just two connections and reversing the polarity will cause the motor's shaft to turn the other way (for DC motors).

Servomotors

If you need a way to monitor the turning of the motor's shaft then you can use a servomotor which has a built in means to track the shaft rotation (and with some, speed too). A servomotor typically consists of a traditional motor that continually turns unless the feedback mechanism tells it to stop. In this way you could, for example, get the motor to turn to a certain point.

In the photo above you can see a couple of servomotors of which I have opened up so that you can see the feedback mechanism. With the large motor on the left it uses an optical sensor (a slotted opto switch) which detects the rotation of the motor's shaft using the disc attached to the shaft. The motor on the right, however, not only uses a set of gears but also has a switch mechanism (fixed to the circuit board) that lets it sense when certain positions are reached (that is, when the motor's shaft has rotated to a certain point).

Stepper motor

A stepper motor (a.k.a step motor and stepping motor) is different to other types of motors because its shaft turns in fixed steps (e.g. 7.5°) by energising a number of different coils in turn. Stepper motors therefore have great precision and the shaft can either be made to turn to a certain rotation or to continually rotate at one of many different speeds (the speed is determined by the delay between the turning on and off the coils).

Stepper motors are often used with sensors to make sure the motor or a mechanism driven by the motor is operating correctly. For example, in a slot machine an optical sensor (usually a slotted opto switch) is used which detects every time a wheel has turned 360°. This allows the wheels to start up in a known state and makes sure they are synchronised (since it is known how many turns of the stepper motor's shaft should result in one revolution which would result in a pulse from the sensor).

There are two main types of stepper motors which are bipolar and unipolar. Unipolar stepper motors are easier to use than bipolar stepper motors since they only require current to be passed through each coil in one direction. Bipolar stepper motors, however, are more difficult to use as the polarity of the coils must be reversed but the advantage of bipolar stepper motors is that they are more powerful than unipolar stepper motors of equal weight.

From the photo below you can see that stepper motors come in a range of different shapes and sizes. Different stepper motors have a different number of coils and arrangement of those coils in the way they are connected, so some stepper motors have more wires attached than others.

In some ways stepper motors are like servomotors but the key difference is that the stepper motor's shaft turns a set amount each time but the motor in a servomotor turns continuously until it's told to stop by the feedback circuit.

Key characteristics of stepper motors include the voltage, current, coil resistance, step angle and number of coils. Unfortunately these details aren't usually stamped on the stepper motor except perhaps the coil resistance and voltage. Therefore when working with unknown stepper motors we have to work out that informations ourselves. For voltage, it's always best to play safe and start low, using the size of the motor as a rough indication of the voltage; typically stepper motors run on 12 or 24V DC.

Using a multimeter set to resistance we can find the resistance of each coil and typically there will be two centre-tapped coils, making effectively four coils. To determine the pinout of the stepper motor use your multimeter to measure the resistance between pairs of connections, making a note of the values as you do so. Where you have a resistance value half of the higher readings you have found a common wire. For example, if you get 50 ohms between two of the connections and 100 ohms between another pair of connections then one of the wires involved in the 50 ohm reading is a common wire but the connections that resulted in the 100 ohm reading are not common wires.

This is illustrated below:

The picture also shows two stepper motor symbols although representations of stepper motors vary greatly. The one on the left, which I have used elsewhere on this page, if acceptable but does not clearly show the arrangement of the coils but is fine when using a known pinout. The symbol on the right better shows the coils and is a more common type of stepper motor symbol. Note that as indicated by the dotted line some stepper motors have the two common wires internally connected.

The required coil current can be calculated using Ohm's law using the voltage and coil resistance, i.e. I=V/R. As for step angle, we can count the number of turns that are needed for the stepper motor's shaft to turn 360° and divide that by 360. For e.g., if it takes 48 turns then the step angle is 7.5° (360/48 = 7.5).

Stepper motors do give off substantial heat when in use so be careful when touching an active stepper motor as its surface can give off a lot of heat. However, a stepper motor giving off too much heat can be an indication that it is taking too much current.

L293D bidirectional DC motor control

A common need is to be able to control a motor so that the shaft can turn in either direction, such as in a toy car so that it can move forward or back. This is usually done by using an H-bridge, which gets its name from the arrangement of components that form an 'H'. The L293D IC contains 4 half H-bridges which are capable of driving inductive loads such as motors.

Below you can find a test circuit for bidirectional control of a DC motor which uses one half of an L293D:

If SW1 (Enable) is open then the motor is stopped regardless of whether SW2 or SW3 is pressed. If SW1 is closed, pressing SW2 turns the motor shaft left and pressing SW3 turns the shaft right; pressing SW2 and SW3 at the same time stops the motor. If the motor shaft turns the wrong way then the motor connections will need to be swapped.

The circuit is powered by 5V but the L293D can be run on anything from 4.5V to 36V and can supply 600mA per channel (1.2A peak per channel). VCC1 of the L293D is for the logic part of the chip and VCC2 is for the output stage. While in the circuit above VCC1 and VCC2 are connected together as the motor runs on a low voltage, for higher power motors VCC2 can be separate from VCC1 and connected to a higher voltage (maximum of 36V). As the inputs to the L293D are TTL compatible, if VCC2 is connected to a higher voltage then the (separated) VCC1 would be connected to a 5V supply.

A handy feature of the L293D is that it includes clamp diodes in output stages unlike the L293 which requires them to be added externally. The L293, however, has the advantage that it can supply higher current (1A per channel/peak 2A per channel) than the L293D.

PFUP1097ZA-A Stepper Motor Driver board

I can't remember exactly where I got this stepper motor driver board from but it was most likely a scanner or something like that. It drives two stepper motors independently as well as an LED array used with an image sensing device (a charge-coupled device).

Have a look at the stepper motor driver board below:

The connectors are for the stepper motors, CCD LED, control and power. To better understand how the circuit works please see the circuit diagram that follows:

Two TD62003 7 channel darlington sink driver IC's control the stepper motors and CCD LED, allowing a microcontroller, for example, to be able to switch the high voltage, and high current motors and LED. Transistors Q401 and Q402 act like a master switch which lets you easily disable or enable stepper motor 1 and stepper motor 2.

This stepper motor board is very handy for when starting out with using stepper motors since it provides the driving and interface that is often needed for working with motors. I have been building a plotter that draws using a pen by making use of this stepper motor driver board.

All content of this and related pages is copyright (c) James S. 2013-2014