Lets start with our software and how it communicates to our drivers (I have, in my previous posts, referred to these as "motor controllers" as well). Most home users are likely going to be using either EMC2/LinuxCNC, or Mach3 running on a PC. The software has to have some way of interacting with the real world, and most commonly that is through a parallel port and breakout board. When you configure the software, you select individual pins on the parallel port, and tell the software what they are connected to (x motor, y motor, z motor, spindle motor, home switches, etc). Motors take 2 pins each, one for "step", and one for direction. "Step" is what we have been talking about in previous posts. Its the pulse that makes the motor go. One pulse (parallel port pin goes to 5v, then to 0) causes the motor to advance one step. The direction pin controls the direction of advance. Nothing to tricky here.
So what do we need a driver for? First of all, your parallel port is only going to do about 5v at a couple milli-amps, not enough to power a motor, so we need something to boost that power. Secondly of all we talk lightly about "steps", and direction, but there is a lot more going on with the motor than it seems. Let's refer to my visual aid here. This diagram shows simple stepper motor, one that turns 90 degrees per step. In the middle we see the rotor (the thing attached to the output shaft). This is basically a permanent magnet (red is north, black is south). On the outside, we have what is called the "stator" (which means stationary). This is where the coils are. There are two coils, and each coil has 2 ends. The ends of coil one are P1a and P1b, and the ends of coil two are P2a and P2b.
Now that we have that straight, lets get down to business. Recall that the north poles of magnets attract the south poles of other magnets, and repel the north poles of other magnets. Recall also, that if we run a current through the coils of wire in the stator, we are going to create an electromagnet (one pole will be north, the other, south, this switches depending on direction the current flows in the coil).
In our first diagram, we see the rotor at the zero position. Coil one is energized. When we hit our "step" pin, the driver is going to de-energize coil one, energize coil two. The rotor is now going to be attracted to coil 2, and will rotate 90 degrees. We get another step pulse, and the motor de-energizes coil two, and energizes coil one. This time, coil one is hooked up in the opposite direction of what it was in our zero position. The rotor turns. One more step. Coil 1 de-energize, coil 2 energized in reverse. One last step, and we are back to where we started. If we keep sending pulses the motor keeps advancing, if we change the value of the "direction" pin, the direction will reverse. The driver reverses the direction of the motor by going through the sequence above in reverse.
So that's the basic stuff, but what is this "half step stuff".
Half stepping is a lot like full stepping. If you look at the second picture, in the second diagram, you will notice that we have energized both coils at the same time (unlike with full stepping, where we only had one active at a time. You will also notice that the rotor is half way between it's normal, 90 degree position (hence the name, half step). Notice that the two poles are both attracting the rotor, and assuming the current flowing through them is equal, they are going to pull with approximately the same amount of force, so the rotor is exactly between them. In this case, we only move 45 degrees between steps, and it takes us 8 half steps to make a full revolution. Otherwise, everything is the same.
Now that we have covered full and half stepping, micro stepping isn't so bad. It is basically half stepping taken a little further. Imagine that we have a motor driver that can do 10 microsteps per step. Remember when talking about half stepping where I said if we power two coils, and the current in each coil is the same, the rotor goes halfway between? Well, what happens if the currents aren't equal? Basically the rotor will be somewhere between the two, but it will be closer to the pole of the coil that has the stronger current running through it.
Lets say we start in our zero position, and coil 1 has 10A going through it. If we were in half step, we would leave coil 1 active, and send 10A through coil 2. With microstepping, we are gonna take things a little slower. Instead of sending the full current to coil 2, we will send say, 1 amp through coil2, and while we are at it, we will reduce the current through coil1 to 9A. On our next pulse, coil2 goes to 2A, coil1 goes to 8A. Then 3A and 7A, then 4A and 6A, then 5A and 5A (we're in the middle), etc. Now, instead of taking 4 pulses to do one revolution, it takes us 40.
Motor drivers are pretty complicated beasts, especially when you get into microstepping, but they are really easy to use. Servo drivers can be a little trickier to use, but I'll leave that for another time.