How motors work
Also available in: Català · Castellano
The idea
A current inside a magnetic field feels a force (the Lorentz force). A motor is a coil and a magnet arranged so that this force turns a shaft. The trick is to switch the current at just the right moment (commutation).
Two quantities: torque (how hard it pushes) and speed.
DC motor
τ = Kt · I: more current, more force.V = Ke · ω + R · I: as it turns, the motor generates an opposing voltage (back-EMF) proportional to speed.- With no load, speed follows voltage (
ω ≈ V / Ke). - When blocked (stall,
ω = 0), the current isV / R: the maximum, and the motor heats up. - H-bridge: four switches that reverse the polarity and, with it, the direction of rotation.
- PWM: you switch the voltage on and off very fast and the motor “sees” the average. The duty cycle is the percentage of time it is on.
Stepper
It moves in steps (typically 200 per turn, 1.8° each; finer with microstepping). The controller counts steps, it doesn’t measure them: ask for too much speed or load and it loses steps without anyone noticing. Great for 3D printers, risky in a robot joint.
Brushless (BLDC)
The magnets are on the rotor and the coils sit still on the stator; electronics switch them on in sequence. It needs to know where the rotor is (Hall sensors or an encoder). It is the motor in the joints of humanoids and quadruped robots. FOC (field-oriented control) makes the rotation smooth and controls torque directly.
Servo
Motor + gearbox + encoder + controller in one box. You give it a position, not a voltage; inside there is a closed loop (see PID).
In the demo
- DC: reverse the direction, switch to PWM and raise the load until it stalls: the current rises and the speed drops.
- Stepper: raise the speed or load until the real steps drift away from the commanded ones.
- BLDC: watch how the coil sequence follows the rotor.
Common questions
Why not always use a stepper, since it’s cheaper? Because it’s open loop: you don’t know whether it has lost steps. Fine for a printer; for an arm or a leg that bumps into things, you need to measure.
Interactive demo
Related concepts
Rotary encoders
An encoder tells the motor where it is. With two phase-shifted channels (A and B) you know how far it has turned and in which direction.
Closed-loop control (PID)
A PID compares what you want with what you measure and corrects using three terms: P looks at the present, I at the past and D at the future.
Gearboxes for joints
A gearbox with ratio N divides speed by N and multiplies torque by N. Planetary, harmonic drive or spur gears: each family trades off precision, robustness and how easily it can be moved from outside.