How to Control a Stepper Motor from a PC

 
 
 

   Stepper motors are quite different from ordinary DC electric motors in that they do not rotate in a continuous fashion, but, as the name suggests, move in discrete steps. Sometimes these steps are so small that the overall rotation of a stepper motor is indistinguishable from that of a conventional one. Stepper motors have a number of advantages over conventional motors in automation and control systems. Once they have moved to their new position, they can hold it against any Stepper motor control from a PCapplied torque from a load (within their load limits). They also offer very precise control over position by allowing their control system to specify how many steps to move in a specified direction and at what speed. Either on their own or coupled to a belt and pulley drive system, this makes stepper motors a very powerful and flexible device in the automation engineer’s design repertoire.
    In this guide we will be using a StepperBee USB adaptor board to rotate a stepper motor a given number of steps, in a specified direction at a specified speed using a PC.
    The stepper motor used in this example is the type most commonly used in the majority of medium torque applications. It is a 12 volt, 4-phase, Unipolar stepper motor with a 1.8 degree step size (i.e. it will do one complete rotation in 200 steps).

Connecting the Stepper Motor to StepperBee
  The stepper motor has 6 wires attached, which are colour coded according to the following table
 

   
   

Phase A    brown
Phase /A   red
Phase B    orange
Phase /B   yellow
+12v          black
+12v          white

   
   


    The StepperBee can drive 2 independent stepper motors and, for our purposes, we will use the control connections for motor 1. These are connected as shown below

Simple method for connecting a stepper motor to a PC running Windows XP

    Here we are using a standard 12v DC power supply rated at 500mA which is more than adequate for our purposes.
    One final connection is required and that is simply to connect the StepperBee to a free USB socket on the PC using a standard USB lead. As soon as you connect this lead the PC will automatically configure the drivers to use with it. These drivers are already part of Windows (WinXP or later)  so there is no need for any separate installation of third party drivers
making a USB connection to the PC.

Software
    Having connected the stepper motor we are now ready to control it from the PC. For this you will need to install the AutoStep software that comes with the StepperBee. Insert the installation disk and follow the , all too familiar , installation sequence.
Run AutoStep and you will have the display as shown below.

Software for driving a stepper motor from a PC
            click on image for higher resolution in new window

    Although AutoStep has facilities for a wide range of control functions we just want to make the stepper motor move a specified number of steps in a specified direction at a specified speed. To do this we will use the “manual Control” section to the top left of the screen.

Manual control of a stepper motor using a PC and some software

    Enter 200 in the number of steps box. Enter 20 in the interval box.
Click on the “Run” button.

    If everything is okay you should now see the stepper motor do one complete rotation clockwise in about half a second

 

   
         
         
   

!!!  You now have a stepper motor under PC control  !!!

   
                   
   

 

   
                   
     
                   
 

.        .

 
 

© Copyright pc-control.co.uk 2008