Skip to main content

How a Motor Works

Easydifficulty

PID, feedforward, and motion profiling all answer the same question in the end: what voltage should the motor get right now? It's worth knowing what the motor does with that voltage first, so this lesson starts with the hardware.

The mechanism that's fast empty and useless under load​

A team gears a lift for a lot of speed. With nothing on it, it races to the top. Hang a game element on it and it slows almost to a stop, gets too hot to touch, and two matches later causes a brownout (a voltage drop that resets the robot) halfway up. Nothing is broken. The motor is doing what motors do.

The team assumed voltage sets speed. It doesn't, quite. A motor trades speed for torque, draws more current the harder you load it, and turns the difference into heat. Picking a gear ratio, choosing a controller, and reading a current spike all depend on understanding why.

Bicycle gears on a hill. In your highest gear you fly along on flat ground but slow to a stop the moment the road tilts up — and your legs burn doing it. Drop to a low gear and you climb easily, just slowly. The pedals (the motor) didn't change; the load did. There is no gear that is fast and strong at once.

Build it from the parts up​

What's inside​

Take a brushed DC motor apart and you find six parts that together turn electric current into a twisting force on a shaft.

output shaft+−rear endcap + leadsbrushes (carbon, sprung)commutator (segments)armature (rotor): iron + windingsNSmagnets in the steel can (stator)field Bfront endcap + bearingcurrent
Inside a brushed DC motor — The parts pulled apart along the shaft, with the current path in amber: in through a lead, through a spring-loaded carbon brush, across the spinning commutator into the armature windings — where the magnets' field turns it into torque — and back out the other brush. In the assembled motor the armature spins inside the magnet can.
  • Magnets (the stator). Permanent magnets line the inside of the housing and never move. They set up a fixed magnetic field across the middle of the motor. The stator is the part that stays still.
  • Armature (the rotor). An iron core wrapped in copper coils, mounted on the shaft. When current flows through the coils inside the magnets' field, each wire gets pushed sideways, and because the coils are arranged around the shaft, those pushes add up to rotation. The rotor is the part that spins.
  • Commutator. A copper ring split into segments, riding on the shaft. As the rotor spins it swaps which coil the current flows through, so the push is always in the direction that keeps it turning. A motor without this would just twitch to one position and stop.
  • Brushes. Two spring-loaded carbon blocks pressed against the commutator. They feed current into the spinning rotor by rubbing against it, which is where the name comes from, and why they wear out.
  • Housing, bearings, shaft. The steel can holds the magnets and closes the magnetic loop; the bearings let the shaft spin freely; the shaft carries the torque out to your gearbox.

Here are the same parts in a permanent-magnet DC motor that has been cut in half lengthwise, with the cut faces painted red:

A Siemens permanent-magnet DC motor sectioned lengthwise, showing the shaft and bearing at
left, the armature with its copper windings and laminated iron core in the centre, the
segmented copper commutator and the brushes to its right, and the magnets bonded inside the
steel housing

A DC motor cut in half. Left to right: the output shaft and its bearing, then the armature — copper windings threaded through a laminated iron core — then the segmented copper commutator with the brushes pressed against it, all inside the steel housing whose dark inner arcs are the permanent magnets. The nameplate reads Perm.-Magn.-Mot., so the field here comes from magnets rather than a wound coil, exactly like the motors on your robot. (The extra assembly on the far right is a tachometer, not part of the motor.) Photo by Oliver Wallscheid, CC BY 4.0.

Following the current: it comes in the leads, through a brush, across the commutator, and into a rotor coil, where the magnets' field turns it into a force. As the shaft turns, the commutator switches to the next coil so the force keeps pushing the same way.

How does an Electric Motor work? (DC Motor) -

Jared Owen animates the same teardown in 3D. The commutator is much easier to understand when you can watch it switch coils.

Open video

Brushed vs. brushless​

Brushes and a commutator work, but carbon rubbing on copper wears out, sparks, and adds friction. Brushless motors make torque the same way, but they turn the motor inside out and switch the current electronically.

BrushedNSrotor spinsswitched mechanically:brushes scrape the commutatorwindings spin · magnets fixedBrushlessABCABCABCrotor spinscontroller (ESC)magnets spin · no brushes to wear
Brushed vs. brushless — Both turn current into torque with magnets and coils — they differ in what spins and how the current is switched to the right coil at the right moment. Brushed: the wound rotor spins inside fixed magnets, switched mechanically by brushes scraping the commutator. Brushless: a magnet rotor spins inside fixed windings, switched electronically by the controller energizing the three phases in sequence.
BrushedBrushless
What spinsthe windings (rotor)the magnets (rotor)
What's fixedthe magnetsthe windings (stator)
Switching ("commutation")mechanical — brushes + commutatorelectronic — a controller (ESC) energizes coils in turn
Trade-offscheap, simple to drive; brushes wear & sparkefficient, long-lived, more torque/size; needs a smart controller
Note
FTC runs brushed motors.

The goBILDA Yellow Jacket, REV HD Hex, and friends are all brushed DC motors — the Control Hub just sets a voltage across two leads, no fancy controller required. So the rest of this module assumes the brushed model. (Brushless is common in FRC and on hobby drones, where the controller lives in the speed controller.)

The two effects that make it a motor​

Almost everything the motor does comes from two effects.

Torque comes from current. Current II, in amps, is how much charge flows through the coils each second. A wire carrying current through a magnetic field gets pushed sideways, and added up around the rotor, those pushes become a twisting force, the torque τ\tau, in newton-metres. Double the current and you double the torque:

τ=kt I\tau = k_t\,I

ktk_t, the torque constant, is how many newton-metres you get per amp. It depends on the magnets and the number of turns of wire. Since torque is proportional to current, controlling current means controlling torque, which is what current control below relies on.

Speed creates a voltage that pushes back. A spinning motor is also a generator. As the coils sweep through the magnets' field they produce their own voltage, and it points against the supply. This is the back-EMF. It grows with the shaft speed ω\omega, measured in radians per second (one turn is 2π2\pi rad, so ω=RPM×2π/60\omega = \text{RPM}\times 2\pi/60):

Vemf=ke ωV_\text{emf} = k_e\,\omega

torque τ = kt·I  ·  back-EMF V_emf = ke·ω

kek_e, the back-EMF constant, is volts per rad/s. It comes from the same magnets and windings as ktk_t, and in SI units the two are the same number. The faster the motor spins, the more of the supply its back-EMF cancels, and the less is left to push current. That's why a motor stops speeding up.

Putting them together. Go around the circuit. The voltage VV you apply has two jobs: push current through the resistance RR of the windings, and overcome the back-EMF:

V=I R⏟across the windings+ke ω⏟back-EMFV = \underbrace{I\,R}_{\text{across the windings}} + \underbrace{k_e\,\omega}_{\text{back-EMF}}

That equation is the whole electrical model of the motor, and the torque–speed curve comes straight out of it.

The torque–speed line​

Solve the voltage equation for current, then turn current into torque with τ=ktI\tau = k_t I:

I=V−ke ωR,τ(ω)=ktR(V−ke ω)=ktVR⏟stall torque−ktkeR⏟slope ωI = \frac{V - k_e\,\omega}{R}, \qquad \tau(\omega) = \frac{k_t}{R}\big(V - k_e\,\omega\big) = \underbrace{\frac{k_t V}{R}}_{\text{stall torque}} - \underbrace{\frac{k_t k_e}{R}}_{\text{slope}}\,\omega

It's a straight line: the most torque at zero speed and no torque at top speed. In the demo, set the voltage and the load, and the green dot shows where the motor settles, which is where its line meets the load. Watch the current, efficiency, and heat as you push toward stall. (The demo only covers positive voltage and forward rotation. Braking and running backwards aren't modeled.)

Live demoOne-quadrant motoring curve — goBILDA 5000-0002-0117 (MATRIX), 12 V
motor line (applied voltage)motor line at full 12 Vload (resisting torque)operating point (live)
Lower voltage slides the whole line inward — same slope.
Past the stall torque, the motor can't move it — watch the temperature.
ChallengeFind an operating point that delivers ≥ 16 W of output at ≥ 72 % efficiency, and hold it for one second. (Hint: it's a narrow band — nowhere near stall.)not yet
Speed: —Current: —Power out: —Efficiency: —Heat (I²R): —Winding temp: —Status: —

The two ends of the line are usually the only points a datasheet lists:

Operating pointSpeedTorqueCurrentWhat's happening
Stall (ω=0\omega = 0)0max, τstall=ktVR=\tau_\text{stall} = \frac{k_t V}{R} = 0.19 N·mmax, Istall=VR=I_\text{stall} = \frac{V}{R} = 11 Ano back-EMF, so current — and heat — peak
Free run (external load τload≈0\tau_\text{load} \approx 0)max, ωfree≈Vke=\omega_\text{free} \approx \frac{V}{k_e} = 5900 RPMload torque ≈ 0≈ 0.3 Aback-EMF nearly cancels the supply; the small current covers internal friction

Two things follow from the algebra. First, changing the voltage slides the line without tilting it. Stall torque and free speed both scale with VV, but the slope −ktke/R-k_t k_e/R doesn't contain VV. Setting power to 0.5 applies about half the voltage and moves the motor onto a lower, parallel line. (The faint line in the demo is full 12 V.)

Second, the motor puts out the most power at half its free speed. Output power Pout=τωP_\text{out}=\tau\omega is zero at both ends of the line, so it peaks in the middle. For this motor that's 29 W at about 2950 RPM, half of 5900.

out P = τ·ω  ·  in P = V·I  ·  heat P = I²·R

Note
Where the numbers come from

The demo is the real goBILDA 5000-0002-0117 (MATRIX) motor at 12 V: free speed 5900 RPM, stall torque 0.19 N·m, stall current 11 A, free current ≈ 0.3 A, peak 29 W. From those three published numbers you get the constants: R=12/11=1.09 ΩR = 12/11 = 1.09\,\Omega, kt=0.19/11=0.0173k_t = 0.19/11 = 0.0173 N·m/A, and ke=12/(5900⋅2π/60)=0.0194k_e = 12/(5900\cdot 2\pi/60) = 0.0194 V·s/rad. These are endpoint estimates: free current and internal friction mean ktk_t and kek_e will not match perfectly even though, in ideal SI motor units, they describe the same electromechanical coupling. (Data: gm0's motor guide.)

Working out one operating point​

Say this motor runs at 12 V against a steady 0.05 N·m load at its shaft. Where does it settle?

ω=V−τR/ktke=12−(0.05)(1.09)/0.01730.0194≈455 rad/s=4350 RPM\omega = \frac{V - \tau R / k_t}{k_e} = \frac{12 - (0.05)(1.09)/0.0173}{0.0194} \approx 455\ \text{rad/s} = \mathbf{4350\ RPM}

The current it pulls, and the power bookkeeping:

I=V−keωR=12−(0.0194)(455)1.09≈2.9 AI = \frac{V - k_e\omega}{R} = \frac{12 - (0.0194)(455)}{1.09} \approx \mathbf{2.9\ A}Pout=τω≈22.8 W,Pin=VI≈34.7 W,η=PoutPin≈66%,Pheat=I2R≈9 WP_\text{out} = \tau\omega \approx \mathbf{22.8\ W}, \quad P_\text{in} = VI \approx 34.7\ \text{W}, \quad \eta = \frac{P_\text{out}}{P_\text{in}} \approx \mathbf{66\%}, \quad P_\text{heat} = I^2 R \approx 9\ \text{W}

If you add it up, it doesn't quite balance: 22.8+9.0=31.8 W22.8 + 9.0 = 31.8\ \mathrm{W}, about 3 W3\ \mathrm{W} short of the 34.7 W34.7\ \mathrm{W} going in. That isn't an arithmetic mistake. An ideal motor has kt=kek_t = k_e exactly, but these constants were estimated from the two ends of the datasheet, and friction lowers the measured free speed enough that they come out 11% apart. The missing 3 W is roughly that friction, so the 66% efficiency includes a loss the simple model doesn't have a term for.

Notice that heat is I2RI^2R. It grows with the square of the current, which is why a stalled motor heats up so fast.

This is a healthy operating point: fast, efficient, and a modest current. Now raise the load to stall, 0.19 N·m. Speed drops to zero, current climbs to 11 A, output power falls to zero, and all 130 W going in becomes heat. That's the lift that works fine empty. Set the demo's load slider to 0.05 and then 0.19 to see these numbers.

Feedback and current control​

You never command torque or current directly. You command voltage. The Control Hub does it with PWM, switching 12 V on and off very quickly, so setPower(0.5) gives about 6 V on average. There are three levels of control built on the model above:

  1. Open loop — setPower. You pick a voltage and live with wherever the load puts you on the line. Simple, but speed sags with load and the battery.
  2. Velocity feedback, RUN_USING_ENCODER. A loop measures speed and adjusts the voltage to hold a target as the load changes. It still can't go faster than free speed or push harder than stall.
  3. Torque or current control. Since τ=ktI\tau = k_t I, commanding a current is the same as commanding a torque. Rearranging the voltage equation, the voltage that drives a chosen current I∗I^* at the present speed ω\omega is:
Vcmd=ke ω+I∗ RV_\text{cmd} = k_e\,\omega + I^*\,R

Read ω\omega from the encoder, predict the back-EMF, add enough voltage to push the current you want through RR, and send it. Strictly speaking this is open-loop current control, a current feedforward. It trusts kek_e and RR and never checks the actual current, so any model error, like the higher resistance of a warm motor, shows up directly as current error.

Closed-loop current control measures the current every loop (getCurrent()) and runs feedback on the error. Dedicated motor controllers do this internally. The FTC hub doesn't offer a fast current loop, so the model-based version is what you can do, optionally backed up by the measured-current limiter further down.

Limiting current this way is how good drivetrains avoid wheel slip, keep motors from overheating, and survive defense. In a pushing match the wheels are stalled (ω=0\omega = 0), so full power draws about V/RV/R, tens of amps, and can trip the breaker. A current limit lowers the voltage to whatever gives a safe current.

Idea
The same equation shows up again

V=keω+IRV = k_e\omega + IR comes back in several later lessons. Feedforward solves it for the voltage a target speed needs, and its kSk_S, kVk_V, kAk_A terms come from it. System identification measures those lumped gains on your mechanism. (Measuring kek_e, ktk_t, and RR separately takes electrical and dynamometer tests.) Current control solves it for the voltage that gives a target torque.

Gearing, current limits, and code​

A gearbox moves the useful part of the curve to where your mechanism needs it. A reduction GG divides output speed by GG and multiplies output torque by GG, minus losses:

output speed = ω_free / G  ·  output torque = τ_stall · G · η

FTCMotor specs -> geared output (use your datasheet numbers)
// The three numbers every brushed DC motor publishes at 12 V.
double freeSpeedRpm; // RPM with nothing attached
double stallTorqueNm; // torque at zero speed
double stallCurrentA; // current at zero speed: this is your heat budget

// A reduction G, with efficiency eta.
double gearedFreeSpeed = freeSpeedRpm / G; // speed divides DOWN
double gearedStallTorque = stallTorqueNm * G * eta; // torque multiplies UP
ExerciseWhere the missing power went

Speed divides by G and torque multiplies by it. Speed times torque is power, and gears can't create power, so why does this work? And what is eta doing in the second line?

Show solution

The output turns GG times slower with GG times the torque, so the product, power, stays the same in an ideal gearbox. Real gears lose some to friction, and eta accounts for that. It's typically 0.8 to 0.95 per stage and it multiplies, so a three-stage gearbox can end up under 0.7. The lost power becomes heat in the gearbox.

ExerciseThe number gearing cannot change

One of the three datasheet numbers doesn't change with G. Which one, and why does that matter for a heavily geared mechanism?

Show solution

Stall current. Gears change speed and torque at the output, but the motor still draws what it draws. Stall current depends on the winding resistance and the battery voltage, not on what's bolted to the shaft. That's how a heavily geared mechanism can overheat a motor while barely moving: the output is slow and strong, and the current is just as high as an ungeared stall.

At runtime, a motor sitting near stall is the fastest way to overheat something and brown out the robot. The hub can read current, so you can guard against it, or command current directly with the model:

FTCModel-based current command
// OPEN loop. Never reads actual current.
void setCurrent(DcMotorEx motor, double targetAmps) {
double omega = motor.getVelocity(AngleUnit.RADIANS);
double vCmd = KE * omega + targetAmps * R; // back-EMF, plus I*R
motor.setPower(vCmd / batteryVoltage());
}

The middle line is V=keω+IRV = k_e\omega + IR solved for VV, so it's only as accurate as your KE and R. It sends the voltage that should produce targetAmps and never checks. To actually close the loop, run a controller on measured current, or at least cap it:

FTCMeasured-current limiter
// CLOSED loop. This one reads the sensor.
void driveSafely(DcMotorEx motor, double command, double maxAmps) {
double current = motor.getCurrent(CurrentUnit.AMPS);
if (current > maxAmps) {
command *= maxAmps / current; // scale back proportionally
}
motor.setPower(command);
}
ExerciseDerive the voltage command

A spinning motor makes a back-EMF proportional to its speed, and the applied voltage has to overcome that and also push current through the winding resistance. Write that as an equation and solve for VV.

Show solution

The back-EMF keωk_e\omega opposes the applied voltage, and what's left drives current through the resistance: V−keω=IRV - k_e\omega = IR, so V=keω+IRV = k_e\omega + IR. At stall ω=0\omega = 0 and the whole battery voltage goes into IRIR, which is why stall current is V/RV/R and why stalling mostly makes heat.

ExerciseWhy the limiter scales instead of stepping down

Why is the correction a ratio instead of a fixed step down? At 1.5 times the budget, how much of the command is left? And what does the limiter do when the current is well under budget?

Show solution

At 1.5 times the budget, maxAmps / current is 0.67, so two-thirds of the command is left. A fixed step would take more loops for a big overshoot than a small one. The ratio scales with how far over you are. Under budget it does nothing, because it has a ceiling but no target. That makes it a safety net, not a controller.

It only lands exactly on the budget at stall, which is the case it's mostly for: a pushing match, where ω≈0\omega \approx 0, there's no back-EMF, and current really is proportional to voltage. At speed it undershoots, because I=(V−keω)/RI = (V - k_e\omega)/R has an offset. Scaling VV by ss gives

Inew=sV−keωR=s I−(1−s)keωR  <  s I=Imax.I_\text{new} = \frac{sV - k_e\omega}{R} = s\,I - (1-s)\frac{k_e\omega}{R} \;<\; s\,I = I_\text{max}.

On this lesson's motor at ω=300 rad/s\omega = 300\ \mathrm{rad/s}, a command scaled by 0.67 lands near 2 A2\ \mathrm{A} against a 3.77 A3.77\ \mathrm{A} cap, about half the budget. Being low is the safe way to be wrong, but the limiter will hunt: next loop the current reads under the cap, the full command comes back, and it cuts again. A better version runs feedback on the measured current instead.

Warn
A stalled motor is a heater

A motor held near stall draws stall current the whole time, and almost all of it becomes heat. That can damage the windings and pull the battery down until the hub browns out. Don't gear a mechanism so its normal load sits near stall, and don't hold a pushing match at full power. Limit the current instead.

In practice: take your motor's three datasheet numbers, pick GG so the mechanism's normal load sits in the fast, efficient part of the line rather than near stall, and limit current so a jam can't overheat anything. The next lesson, Voltage Compensation, deals with the fact that the battery voltage feeding all of this isn't constant.

Where the ideal model is off

Real motors have friction (so free current isn't zero and free speed is a little lower), winding inductance, and gearbox losses, so the straight line is slightly curved. It's still close enough to design with. Measuring the real constants for your motor is covered in system identification.

Sources & references
  • Motor data: goBILDA 5000-0002-0117 (MATRIX) 12 V curve and the FTC motor table, from gm0 · Motor Power.
  • Torque / current control: Vikramaditya Nishant, Introducing Torque-Current Control for FTC (Medium), for the V=keω+IRV = k_e\omega + IR current-command and the current-limiting-during-defense argument.
  • Cutaway photograph: Oliver Wallscheid, DC motor with permanent magnet excitation (Wikimedia Commons), CC BY 4.0. Resized and flattened onto white; not otherwise altered.