An ordinary electric motor is based on a simple bit of magnet science we all learn at school: unlike poles attract, like poles repel. Here's how a basic motor works. You take a ring-shaped magnet, put a coil of wire inside it, and feed electricitythrough the wire. The wire becomes a temporary magnet powered by electricity—an electromagnet, in other words—and the magnetic field it creates repels the field from the permanent magnet that surrounds it. By switching the current on and off with a clever little device called a commutator, and some electrical contacts called brushes, you can make the wire rotate in the same direction indefinitely. Feed electricity (electrical energy) into it and you get motion (mechanical energy) back out. That's the essence of an ordinary motor that uses DC (direct current) electricity. If you're less than sure how a motor like this works, you might want to check out our introductory article about electric motors.
We can also make motors that work using AC (alternating current) instead of DC. Although they're engineered in a radically different way, they're still based on "like poles repel, unlike poles attract": the electricity that powers the motor creates magnetic attraction and repulsion, and a force that makes the motor spin. You'll find more about AC motors—which are also called induction motors—in our article on AC induction motors.
Whether they're powered by DC or AC, ordinary motors are the hidden electric muscles that power modern life: you'll find them in all kinds of gadgets and gizmos in the world around you, from food blenders and refrigerators to vacuum cleaners and electric trains. But in all these machines, the rotors of their motors spin continuously. When you vacuum a carpet or commute to work by subway, the motors that are working for you turn around an arbitrary number of times: there's no precise control over how many times they rotate and what angle they spin through—and it really doesn't matter.
Now suppose you want to make an electric-powered robot arm that turns through an exact angle (an exact number of degrees) so it can successfully grab a cup of coffee off your desk. You could fit an electric motor onto a wooden or plastic lever to make it turn when you switch on the power, and you could flick the power on very briefly so the arm sweeps through a certain angle and then stops. The trouble is, there's no way of knowing how much of an angle the motor (or the arm) will move: it depends on everything from the power of the motor and the electric current driving it to the weight of the arm and even which way the wind is blowing. A motor that moves in such an arbitrary way is no use whatever in robotics: your coffee will surely end up on the floor! That's where a stepper motor comes in: it's a special kind of DC motor designed so you can make it rotate through a precise angle, instead of spinning round by a random amount.