Electric Motors in Embedded Systems: DC, Servo, Stepper, BLDC and Beyond

When designing an embedded system that needs to move something—whether it’s a robotic arm, a drone, a CNC machine, or an electric vehicle—the motor you choose fundamentally shapes your hardware design, control electronics, software complexity, and system cost.

Yet many engineers select motors based on popularity or habit rather than understanding the physics, electrical characteristics, and practical trade-offs of different technologies.

This guide explains the most common motor types found in embedded systems, how they work at a practical level, when to use them, what control electronics they require, and how to select the right motor for your specific application.


Part 1: Understanding Motor Types

1. Brushed DC Motors

How it works:

A brushed DC motor is the simplest and oldest motor technology. It consists of:

  • A rotating coil (armature) wound around an iron core
  • Permanent magnets creating a static magnetic field
  • A commutator (split ring) on the motor shaft
  • Carbon brushes that make sliding contact with the commutator

When you apply DC voltage, current flows through the brushes into the commutator, which energizes the coil. The magnetic force on the current-carrying coil creates torque. The commutator automatically switches which coil segments are powered, keeping the motor spinning.

Control method:

  • Speed control: PWM voltage regulation or variable supply voltage
  • Direction control: Reverse polarity (H-bridge)
  • Open-loop or closed-loop: Works well open-loop; feedback optional

Required driver:

  • Simple: transistor/relay (for low power)
  • Standard: H-bridge driver (L298N, TB6612FNG, DRV8833)
  • High power: MOSFET H-bridge with gate driver (IR2110)

Key characteristics:

  • Speed range: 500 to 50,000 RPM (varies by design)
  • Torque: Proportional to current; stalls on blockage
  • Efficiency: 60–80% (decent, not great)
  • Noise: Mechanical noise from brushes; audible brush noise
  • Cost: Very low ($1–$20 for small motors)
  • Reliability: Brush wear limits lifespan (500–2000 hours typical)

Position control:

Limited. Can measure angular position with an encoder, but natural position control requires servo architecture or external feedback loop.

Advantages:

  • Simple control—just reverse polarity or PWM voltage
  • Cheap and widely available
  • Works with simple H-bridge drivers
  • High starting torque
  • Immediate response to control input

Disadvantages:

  • Brush wear causes maintenance and lifetime limits
  • EMI from commutator switching
  • Less efficient than BLDC
  • Brush sparking in high-current applications
  • Poor efficiency at low speeds
  • Not suitable for long-term operation in sealed environments

Common applications:

  • Toy motors and hobby robotics
  • Window motors in cars
  • Hand drills and power tools
  • Simple hobby drones (some models)
  • Gate openers and linear actuators

Example products:

  • Toy RC cars and tanks
  • Handheld power drills
  • Early cordless screwdrivers
  • Small hobby servo mechanisms (sometimes internally brushed DC with gearbox)

2. Brushless DC Motors (BLDC)

How it works:

A BLDC motor replaces mechanical commutation (brushes) with electronic commutation. The rotor contains permanent magnets; the stator contains three winding phases. An electronic controller reads rotor position (via Hall sensors or back-EMF estimation) and switches the stator windings at precise times to keep the rotor spinning.

Key insight: No brushes means less friction, less EMI, and much longer life.

Control method:

  • Speed control: PWM voltage to the electronic controller
  • Direction control: Reverse phase sequence
  • Open-loop or closed-loop: Open-loop possible with Hall sensors; closed-loop with encoder for advanced control

Required driver:

  • ESC (Electronic Speed Controller) for simple speed control
  • Dedicated BLDC driver IC (DRV8302, DRV8353, DRV8313)
  • Three-phase inverter (6 MOSFETs + gate driver for precise commutation)

Key characteristics:

  • Speed range: 500 to 100,000+ RPM (depends on pole count and voltage)
  • Torque: Higher power density than brushed DC; stalls on blockage
  • Efficiency: 85–95% (significantly better than brushed)
  • Noise: Quieter than brushed; some cogging torque
  • Cost: Higher than brushed ($5–$100+), lower than servo
  • Reliability: 10,000+ hours typical; no brush wear

Position control:

Possible with encoder feedback and closed-loop control, but not the primary use case.

Advantages:

  • Much higher efficiency (less wasted energy as heat)
  • Longer lifespan (no brush wear)
  • Higher power density (more torque per weight)
  • Less EMI and electrical noise
  • Better thermal performance
  • Silent operation
  • Suitable for sealed, high-temperature, or harsh environments

Disadvantages:

  • Requires electronic commutation (ESC or controller)
  • More complex driver electronics
  • Hall sensor feedback required (or sensorless back-EMF estimation)
  • Cogging torque in low-speed applications
  • More expensive than brushed DC

Common applications:

  • Drones and multirotors (ubiquitous)
  • Electric vehicles and e-bikes
  • Fans and cooling systems
  • Industrial automation
  • Gimbal motors
  • RC car and airplane racing
  • FPV drone racing

Example products:

  • DJI Phantom quad motors
  • Tesla Model 3 drive motor (PMSM variant)
  • Ceiling fan motors
  • High-performance RC helicopters
  • Marine electric propulsion

3. Stepper Motors

How it works:

A stepper motor is designed to move in discrete steps rather than continuous rotation. The rotor has permanent magnets; the stator has multiple poles arranged around the circumference. By energizing stator coils in sequence, the magnetic field rotates in steps, pulling the rotor along.

Common configurations:

  • Unipolar: Uses center-tapped coils; simpler driver, less efficient
  • Bipolar: Two independent coils per phase; more efficient, requires H-bridge per phase

Control method:

  • Speed control: Frequency of step pulses
  • Direction control: Reverse stepping sequence
  • Position control: Inherent—each pulse = known angular movement

Required driver:

  • Simple: Dedicated stepper driver IC (A4988, DRV8825, TMC2209)
  • Complex: Three-phase inverter (6 MOSFETs) for vector control or microstepping

Key characteristics:

  • Resolution: 200 steps/revolution (1.8°) standard; microstepping can achieve 1/16 steps or finer
  • Torque: Holding torque is excellent (motor locks in place when powered); running torque decreases at high speed
  • Speed range: Typically 0–3,000 RPM (depends on microstep frequency and inductance)
  • Efficiency: 50–70% (loses energy to standing current in coils)
  • Noise: Audible noise from stepping; vibration at certain speeds
  • Cost: Low to moderate ($5–$40)
  • Reliability: Very high; no brushes, solid-state control

Position control:

Excellent—inherent open-loop position feedback (assuming no missed steps).

Advantages:

  • Excellent position control without feedback
  • Simple control logic (pulse direction)
  • Holds position when powered (no external braking needed)
  • Low speed torque is excellent
  • No feedback sensor required
  • Cheap and widely available
  • Works well with simple driver ICs
  • Deterministic behavior

Disadvantages:

  • Loses torque at high speeds (reluctance of stepping)
  • Vibration at resonance speeds (problematic in precision applications)
  • Holding torque requires continuous power (energy inefficient)
  • Audible noise and vibration
  • Can miss steps if overloaded (open-loop risk)
  • Microstepping drivers are more complex and expensive

Common applications:

  • 3D printers (X/Y/Z axes standard)
  • CNC machines and laser cutters
  • Lab automation and scientific instruments
  • Camera focus systems
  • Valve actuators
  • Industrial positioning systems

Example products:

  • RepRap and Prusa 3D printer (NEMA 17 steppers)
  • Laser engraving machines
  • Robotics education kits
  • Scientific measurement stages
  • Automated telescope mounts

4. Servo Motors

How it works:

A servo motor is not a motor type—it’s a motor plus feedback plus control system packaged together. Typically, a servo contains:

  • A brushed DC or BLDC motor
  • A gearbox (high reduction ratio, typically 100:1 to 300:1)
  • A feedback sensor (potentiometer for position sensing)
  • Control electronics (comparator or microcontroller)

The servo’s internal controller continuously compares the desired position (from the input pulse width) to the actual position (from feedback), and drives the motor to close the gap.

Control method:

  • Position control: Pulse-width modulation (PWM) encoding desired position
    • 1.0 ms pulse = minimum position (0°)
    • 1.5 ms pulse = center position (90°)
    • 2.0 ms pulse = maximum position (180°)
  • Repetition rate: 50 Hz (20 ms period) standard

Required driver:

  • PWM signal generator (any microcontroller with PWM timer)
  • Power supply (5V for small servos, up to 24V for industrial)
  • Signal line (single wire per servo)

Key characteristics:

  • Positioning: ±5° to ±1° accuracy (depends on feedback resolution)
  • Speed: Slow (0.1–0.2 seconds per 60° typical)
  • Torque: Moderate (typically 1–5 kg-cm for hobby servos)
  • Holding: Excellent (servo holds position against external force)
  • Efficiency: Moderate (30–60%, due to gearbox friction and servo electronics)
  • Cost: Low to moderate ($5–$50 for standard servos; industrial up to thousands)
  • Noise: Quiet; some gear noise

Advantages:

  • Simple control (single PWM signal)
  • Built-in feedback and control
  • Position holding is inherent
  • Widely available and standardized (plug-and-play)
  • Predictable, reliable behavior
  • Good for hobby robotics and automation

Disadvantages:

  • Limited position range (typically 0–180° or 0–270°)
  • Slow response compared to direct motor control
  • Feedback range limited by pot resolution (8–10 bits typical)
  • Gearbox can have backlash
  • Not suitable for high-speed applications
  • Power efficiency is poor (continuous holding current)
  • Torque limited by internal gearbox

Common applications:

  • Robotic arms and grippers
  • RC model aircraft (control surfaces)
  • Humanoid robots
  • Pan/tilt camera mounts
  • Animatronics and art installations
  • Industrial machinery positioning

Example products:

  • Futaba S3003 (hobby standard)
  • MG996R (high-torque servo)
  • Dynamixel XL430 (multi-turn, networked servo)
  • Industrial collaborative robot arm joints (Baxter, Rethink Robotics)

5. Permanent Magnet Synchronous Motors (PMSM)

How it works:

A PMSM is similar to a BLDC in that it has permanent magnets on the rotor and windings on the stator. The key difference is control philosophy: while a BLDC uses simple 120° commutation, a PMSM uses vector control (Field-Oriented Control, or FOC) to achieve finer torque and speed control by independently controlling torque-producing and flux-producing current components.

Control method:

  • Speed control: Closed-loop feedback with FOC algorithm
  • Torque control: Direct current control via flux vector decomposition
  • Open/closed-loop: Closed-loop required for optimal efficiency and smoothness

Required driver:

  • Three-phase inverter with microcontroller running FOC algorithm
  • Encoder or resolver feedback
  • Gate driver for MOSFETs (IR2110 or similar)

Key characteristics:

  • Efficiency: 90–97% (best-in-class)
  • Torque density: Highest among electric motors
  • Speed range: Wide range achievable with FOC
  • Control complexity: High (requires FOC algorithms and fast control loops)
  • Cost: Moderate to high (depends on control electronics)

Advantages:

  • Excellent efficiency and power density
  • Smooth torque delivery across speed range
  • Suitable for variable-speed drive applications
  • High reliability (no brushes)

Disadvantages:

  • Requires sophisticated control algorithm (FOC)
  • More expensive than BLDC controllers
  • Requires high-resolution feedback (encoder or resolver)
  • Complex tuning and commissioning

Common applications:

  • Electric vehicle propulsion (Tesla, Nissan Leaf)
  • Industrial servo drives
  • High-performance automation
  • Marine electric propulsion

Example products:

  • Tesla Model 3 motor
  • Baldor vector-controlled industrial motors
  • ABB marine propulsion systems

6. AC Induction Motors

How it works:

An AC induction motor uses a rotating magnetic field created by multi-phase AC voltage (typically three-phase) applied to stator windings. The rotating field induces current in the rotor conductors, creating torque.

Control method:

  • Fixed speed: Direct AC connection (no control)
  • Variable speed: VFD (Variable Frequency Drive) controlling voltage and frequency

Required driver:

  • VFD (Variable Frequency Drive) for speed control
  • Three-phase AC power supply

Key characteristics:

  • Efficiency: 90–97%
  • Robustness: Extremely rugged; industrial standard
  • Control: Simple (VFD handles complexity)
  • Cost: Moderate (motor cheap; VFD expensive)

Common applications:

  • Industrial machinery (pumps, compressors, conveyors)
  • Large HVAC systems
  • Heavy industrial drives

7. Stepper Motors (Advanced: Vector Drive)

How it works:

When steppers are driven with microstepping, the motor operates in a quasi-synchronous manner, reducing vibration and increasing smoothness. Advanced drivers use FOC-like algorithms to shape current waveforms.

Control method:

  • Microstepping PWM (16× to 256× subdivision)
  • Closed-loop stepper (feedback improves torque and smoothness)

Common applications:

  • High-precision 3D printers (Prusa MK4)
  • CNC machines (closed-loop steppers)
  • Laboratory instrumentation

8. Linear Motors

How it works:

A linear motor is essentially an “unrolled” rotary motor, producing linear force instead of rotational torque. Permanent magnets and coils are arranged linearly, creating a pushing or pulling force along a rail.

Control method:

  • Similar to BLDC: electronic commutation or FOC
  • Position feedback from linear encoder

Advantages:

  • Direct linear motion (no gearbox needed)
  • High efficiency
  • High precision positioning
  • Smooth motion

Disadvantages:

  • Expensive
  • Requires precision rails and bearings
  • Complex control electronics

Common applications:

  • Precision positioning stages (lab equipment)
  • Inkjet printers (print head drive)
  • Semiconductor manufacturing equipment
  • High-speed rail transport systems

9. Voice Coil Actuators

How it works:

A voice coil actuator (VCA) is a simple linear motor used for fast, short-distance actuation. A coil is suspended in a magnetic gap, and current through the coil produces linear force proportional to current (F = BIL).

Control method:

  • Direct proportional control: force proportional to current
  • PWM voltage control
  • Closed-loop with linear position sensor

Advantages:

  • Very fast response (no friction, low mass)
  • Simple, linear relationship between input and output
  • No mechanical backlash
  • Precise positioning possible

Disadvantages:

  • Limited stroke distance
  • Requires external spring for return
  • Cannot hold position without power
  • Heat dissipation in coil

Common applications:

  • Camera autofocus mechanisms
  • Haptic feedback devices
  • Laser beam positioning
  • Hard disk head actuators (legacy)

10. Coreless Motors

How it works:

A coreless motor removes the iron core from the armature, using only wire coil in the magnetic field. This reduces inertia and improves responsiveness.

Characteristics:

  • Very fast acceleration
  • Minimal cogging torque
  • Lower efficiency than cored motors
  • Lighter weight
  • Better for high-speed applications

Common applications:

  • Gimbal motors in drones
  • High-speed hand tools
  • Racing quadcopters

11. Geared Motors

How it works:

A geared motor combines a motor with an internal gearbox, trading speed for torque (or vice versa).

Typical configurations:

  • High-speed, low-torque motor + high-reduction gear → high torque, low speed
  • Common ratios: 10:1 to 1000:1

Advantages:

  • Compact integration
  • Simplified assembly
  • Predictable performance

Disadvantages:

  • Backlash from gears
  • Lower efficiency (gearbox friction)
  • Limited customization

Common applications:

  • Robot arms and grippers
  • Industrial conveyor drives
  • Window and door actuators
  • Valve operators

Part 2: Motor Comparison Table

CharacteristicBrushed DCBLDCStepperServoPMSMAC InductionLinearVoice Coil
Control ComplexitySimpleModerateModerateVery SimpleVery HighModerateHighSimple
CostVery LowLowLowLow-ModModerateModerateHighHigh
Torque (Continuous)GoodExcellentFairGoodExcellentExcellentGoodFair
PrecisionFairGoodExcellentExcellentExcellentGoodExcellentExcellent
Efficiency60–80%85–95%50–70%30–60%90–97%90–97%90%+Moderate
Noise LevelLoudQuietAudibleQuietQuietQuietSilentSilent
Speed RangeWideWideLimitedVery LimitedWideFixed/LimitedModerateLimited
Position FeedbackOptionalOptionalInherentBuilt-inRequiredNot TypicalRequiredOptional
Typical ApplicationsToys, ToolsDrones, EV3D Printers, CNCRobotics, ServosIndustrial, EVIndustrialPrecision LabsFocus, Haptics
Lifespan (Hours)500–200010,000+20,000+5,000+15,000+30,000+50,000+20,000+

Part 3: Drivers and Control Electronics

H-Bridge Motor Drivers

An H-bridge is the standard circuit for controlling brushed DC motors. It allows you to:

  • Switch the motor on/off
  • Reverse rotation direction
  • Control speed via PWM

Circuit topology:

graph TD
    A["Supply +V"] -->|Q1| B["Motor"]
    A -->|Q3| B
    C["Ground"] -->|Q2| B
    C -->|Q4| B
    D["Control Logic<br/>PWM, Direction"] --> E["Gate Drivers<br/>or Transistor Drivers"]
    E --> Q1
    E --> Q2
    E --> Q3
    E --> Q4

Common H-bridge ICs:

  • L298N: 2A, simple, common in education
  • TB6612FNG: 1.2A, logic-level compatible, compact
  • DRV8833: Dual-motor driver, compact
  • BTS7960: 43A high-power driver
  • Custom MOSFET bridge: For high currents (IR2110 gate driver)

Stepper Drivers

Stepper motor drivers energize the motor phases in sequence. Modern drivers support microstepping.

Common stepper driver ICs:

  • A4988: Budget option, simple but capable
  • DRV8825: Improved over A4988, lower noise
  • TMC2209: Silent stepper with advanced features (StallGuard, SPI control)
  • TMC5160: Very advanced, motion control on-chip

Microstepping:

Microstepping divides each full step into smaller substeps by PWM-controlling current. Benefits:

  • Reduced vibration
  • Smoother motion
  • Improved torque at low speeds
  • Higher effective resolution

Trade-off: More complex driver and slower speed capability.

BLDC/PMSM Drivers

BLDC motors require electronic commutation—precise timing of phase switching based on rotor position.

ESC (Electronic Speed Controller):

For simple speed control (drones, RC vehicles), an ESC reads PWM input and commutates the motor automatically.

Example ESCs:

  • DYS XM20A (for 200W motors)
  • Hobbywing XRotor series (industrial-grade)
  • Maytech ESC (marine applications)

Dedicated BLDC Driver ICs:

For precise control, use a driver IC with feedback interface:

  • DRV8302: 3-phase gate driver, FOC capable
  • DRV8353: 3-phase gate driver with advanced current sensing
  • DRV8313: Simplified BLDC driver
  • ON Semi NCP5623: Gate driver + power stage integration

Servo Control Electronics

Standard hobby servos have internal control electronics. You only provide:

  • 5V power supply
  • PWM signal (50 Hz, 1–2 ms pulse width)
  • Ground

Part 4: Feedback Systems

Encoder Feedback

Rotary encoders measure shaft rotation:

  • Incremental: Count pulses to determine rotation; accumulates error
  • Absolute: Every position has unique code; no initialization needed
  • Resolution: 100 to 10,000 CPR (counts per revolution) typical

Common types: optical disk, magnetic, capacitive.

Use when: High precision positioning, closed-loop control, velocity feedback required.

Hall Sensors

Hall sensors detect magnetic field, commonly used in BLDC motors for commutation.

  • Three sensors per motor (typically)
  • Provide rotor position feedback every 60 electrical degrees
  • Simple digital output

Use when: BLDC commutation, low-cost speed control.

Resolvers

Resolvers are synchro-like devices providing absolute angular position with high accuracy and reliability.

  • Inherently absolute (no initialization)
  • High precision (0.1° typical)
  • Industrial standard (aerospace, military)

Use when: High reliability required, aerospace/automotive certification needed.

Potentiometers

Simple variable resistor; resistance changes with rotation.

  • Cheap and simple
  • Limited to single-turn (unless used with gears)
  • Analog readout (8–10 bit equivalent)
  • Used in servo motor feedback

Use when: Simple positioning, low cost, limited resolution acceptable.

Sensorless Control

For BLDC motors, commutation can be inferred from back-EMF without Hall sensors or encoders.

  • Back-EMF sensing: Motor generates voltage proportional to speed
  • Requires DSP/microcontroller running estimation algorithm
  • Works at moderate to high speeds
  • Difficult at low speeds

Use when: Cost reduction critical, high-speed operation expected.


Part 5: PWM Control Fundamentals

PWM (Pulse-Width Modulation) is the dominant control method for motors in embedded systems.

How it works:

Instead of varying supply voltage (inefficient), PWM switches the motor on and off rapidly. The duty cycle (on-time / total time) controls average power.

Duty = 25%:    |___|___
Duty = 50%:    |_|_|_|_
Duty = 75%:    |__|_|__|_
Duty = 100%:   |_____

Advantages:

  • Highly efficient (MOSFETs switch, no linear loss)
  • Simple to implement (any microcontroller PWM timer)
  • Allows proportional control

Typical PWM frequencies:

  • DC motors: 1–20 kHz (audible noise reduction)
  • BLDC: 16–20 kHz (commutation at higher frequency)
  • Stepper microstepping: 20–100 kHz (phase current shaping)

Part 6: Motor Selection Decision Tree

graph TD
    A["What motion do you need?"] -->|Precise Position| B["Position Control Required"]
    A -->|Continuous Rotation| C["Speed Control Needed"]
    A -->|Simple Back-and-Forth| D["Linear Actuation"]
    
    B -->|Small Robot| E["Servo Motor<br/>Simple, Cheap, Ready-to-Use"]
    B -->|Large Precision| F["Stepper Motor<br/>Open-Loop, Accurate, Deterministic"]
    B -->|Sub-mm Precision| G["Closed-Loop BLDC or PMSM<br/>Encoder Feedback"]
    
    C -->|Small Power| H["Brushed DC<br/>Simple, Ultra-Cheap"]
    C -->|Moderate Power| I["BLDC + ESC<br/>Better Efficiency, No Brushes"]
    C -->|High Power Industrial| J["PMSM + VFD<br/>Maximum Efficiency"]
    C -->|Fixed Speed Industrial| K["AC Induction<br/>Rugged, Standard"]
    
    D -->|Short Distance| L["Voice Coil<br/>Fast, Simple, Proportional"]
    D -->|Long Distance| M["Linear Motor<br/>Expensive but Precise"]
    D -->|Rotary to Linear| N["Geared Motor<br/>Simple, Compact"]
    
    E --> O["TowerPro SG90 or MG996R"]
    F --> P["NEMA 17 or NEMA 23 Stepper"]
    G --> Q["Custom FOC Loop with Encoder"]
    H --> R["DC-28 or Similar Hobby Motor"]
    I --> S["3S LiPo BLDC with SimonK ESC"]
    J --> T["ABB or Baldor PMSM + Drive"]
    K --> U["3-Phase 400V Motor + VFD"]
    L --> V["AudioTechnica Voice Coil"]
    M --> W["Linear Actuator Stage"]
    N --> X["Maxon EC 22 with Gearbox"]

Decision factors:

NeedBest ChoiceWhy
Cheapest solutionBrushed DCNo control electronics, simple
Longest lifespanBLDC or StepperNo brushes, proven 10,000+ hours
Best efficiencyPMSM with FOC95%+ efficiency, less heat/power loss
Easiest to useServo motorBuilt-in feedback and control
Most precise positioningStepper or Encoder-basedDeterministic step or closed-loop feedback
Silent operationBLDC or Stepper (microstepping)No brushes, smooth commutation
Fastest responseVoice coil or coreless BLDCLow inertia, direct drive
Most reliable (industrial)AC induction or PMSMProven designs, extensive standards
Best for battery operationBLDC or PMSMHigh efficiency = longer runtime
Lowest total system costBrushed DC + simple H-bridgeMotor + driver = $5

Part 7: Real-World Examples

Drones (Quadrotors)

Motors: BLDC outrunner motors (KV 1000–2300)

Control: Three-phase ESC with 6-DOF IMU stabilization

Why BLDC?

  • High efficiency (battery flight time critical)
  • High power density (weight critical)
  • Silent operation
  • Wide speed range with ESC

Example: DJI Phantom 4 uses 1435S BLDC motors, 40A ESCs, onboard flight controller.


Electric Vehicles

Motors: PMSM or AC induction (Tesla uses AC induction; Nissan Leaf uses PMSM)

Control: VFD-like inverter with onboard torque vectoring

Why PMSM/AC induction?

  • Highest efficiency (400W of motor loss = huge heat generation at kW power levels)
  • High power density
  • Proven, scalable technology
  • Integration with energy recovery (regenerative braking)

Example: Tesla Model 3 drive unit: 250 kW PMSM motor, integrated inverter, 360 Nm torque.


3D Printers

Motors: NEMA 17 stepper motors (X, Y, Z axes); sometimes BLDC extruder drive

Control: Stepper drivers (A4988 or TMC2209), microcontroller timing

Why stepper?

  • Open-loop position control (no feedback needed)
  • Excellent holding torque (Z-axis gravity)
  • Predictable motion (deterministic positioning)
  • Low cost

Example: Prusa MK4: Four NEMA 17 steppers, TMC2209 drivers, Einsy Rambo control board.


Industrial Robot Arm

Motors: BLDC or PMSM per joint with gearbox

Control: Closed-loop with encoder feedback, PID velocity/torque control

Why BLDC/PMSM?

  • High power density (compact joints)
  • Smooth motion (sensorless commutation)
  • Encoder feedback enables precise motion
  • Long-term reliability

Example: ABB IRB 6700: Six joints, each with servo motor + harmonic gearbox + encoder feedback.


Marine Propulsion

Motors: BLDC outrunner (small boats); AC induction or PMSM (large vessels)

Control: ESC (small); VFD (large)

Why BLDC/PMSM?

  • High efficiency (operational cost critical for large vessels)
  • Salt-water resistance (sealed bearings)
  • Integration with renewable energy (solar, wind)

Example: Torqeedo electric outboard: 5–10 kW BLDC motor, integrated ESC, LiFePO4 battery management.


CNC Machining Center

Motors: Stepper (budget machines); BLDC/PMSM with encoder (precision machines)

Control: Step/direction (stepper) or networked motion control (BLDC/PMSM)

Why?

  • Stepper: Open-loop positioning, low cost, good repeatability
  • BLDC: Better speed range, load detection, dynamic performance

Example: Shapeoko 3: Three NEMA 23 steppers (X, Y, Z) + Makita spindle motor.


Part 8: Embedded Software Considerations

PWM Generation

Most microcontrollers have PWM timers (STM32, Arduino, ESP32, etc.).

// Pseudocode: PWM generation on STM32
void motor_init(void) {
    // Configure PWM timer
    // Set frequency: 1 kHz
    // Set duty cycle: 0–100%
}

void motor_set_speed(uint8_t speed) {
    // speed: 0–255
    // Set PWM duty cycle proportional to speed
    PWM_DUTY = (speed / 255) * PWM_PERIOD;
}

PID Control Loop

For velocity or position control, PID (Proportional-Integral-Derivative) feedback is standard:

typedef struct {
    float kp, ki, kd;      // PID coefficients
    float target;          // Desired velocity/position
    float error, prev_err; // Error tracking
    float integral;        // Accumulated error
} PID_Controller;

float pid_update(PID_Controller *pid, float feedback) {
    pid->error = pid->target - feedback;
    pid->integral += pid->error;
    float derivative = pid->error - pid->prev_err;
    
    float output = (pid->kp * pid->error) + 
                   (pid->ki * pid->integral) + 
                   (pid->kd * derivative);
    
    pid->prev_err = pid->error;
    return output;
}

Current Limiting

High-current draws cause heating and component stress. Implement current limiting:

// Monitor motor current via ADC
if (current_ma > MAX_CURRENT_MA) {
    motor_set_speed(motor_speed - 5); // Reduce speed
}

Fault Detection

  • Over-current: Compare current to threshold
  • Over-temperature: Monitor motor thermal sensor
  • Stall detection: BLDC back-EMF drops to zero
  • Encoder loss: Check encoder timeout
if (motor_current > STALL_CURRENT && speed_command > 50) {
    // Motor is stalled
    motor_stop();
    error_flag = STALL_ERROR;
}

RTOS Considerations

Motor control often runs in dedicated task:

// FreeRTOS example
void motor_control_task(void *pvParameters) {
    while (1) {
        // Read encoder/feedback
        // Update PID loop
        // Write PWM output
        // Check faults
        vTaskDelay(pdMS_TO_TICKS(10)); // 100 Hz control loop
    }
}

Key considerations:

  • Control loop frequency: 100–1000 Hz typical (balance responsiveness with computational load)
  • Priority: Should be high-priority real-time task
  • Determinism: Avoid unpredictable delays in control loop

Part 9: Practical Embedded Motor Control Example

Here’s a minimal BLDC motor driver using PWM and Hall sensor feedback:

#include <stdint.h>

#define PWM_MAX 1000
#define HALL_A 0
#define HALL_B 1
#define HALL_C 2

typedef struct {
    uint16_t pwm_u, pwm_v, pwm_w;  // Phase PWM values
    uint8_t hall_state;             // Current Hall sensor state
    uint16_t speed_rpm;
} BLDC_Motor;

// Commutation table: Hall state -> (U, V, W) PWM levels
// 6 valid commutation states
void bldc_commutate(BLDC_Motor *motor, uint16_t pwm) {
    static const uint8_t commutation[8][3] = {
        {0, 0, 0},      // Invalid
        {pwm, 0, 0},    // Hall = 001: U high
        {pwm, pwm, 0},  // Hall = 010: U and V
        {0, pwm, 0},    // Hall = 011: V high
        {0, pwm, pwm},  // Hall = 100: V and W
        {pwm, 0, pwm},  // Hall = 101: U and W
        {0, 0, pwm},    // Hall = 110: W high
        {0, 0, 0}       // Invalid
    };
    
    motor->pwm_u = commutation[motor->hall_state][0];
    motor->pwm_v = commutation[motor->hall_state][1];
    motor->pwm_w = commutation[motor->hall_state][2];
    
    // Update hardware PWM outputs
    set_pwm_u(motor->pwm_u);
    set_pwm_v(motor->pwm_v);
    set_pwm_w(motor->pwm_w);
}

// Hall sensor interrupt (triggered every 60 electrical degrees)
void hall_sensor_isr(void) {
    motor.hall_state = read_hall_sensors();
    bldc_commutate(&motor, 500); // 50% PWM
}

Conclusion

Selecting the right motor for an embedded system requires understanding:

  1. Application requirements: Speed, torque, positioning accuracy, size, cost
  2. Motor physics: How different technologies trade off efficiency, control complexity, and cost
  3. Control electronics: What drivers and feedback systems are needed
  4. Software integration: PID loops, fault detection, PWM generation

Summary decision matrix:

  • Absolute beginner? → Start with servo motors (plug-and-play control)
  • Building a 3D printer? → NEMA 17 steppers (proven, cheap, deterministic)
  • Designing a drone or electric vehicle? → BLDC with ESC (efficiency, power density)
  • Industrial automation? → Closed-loop BLDC or PMSM (reliability, precision)
  • Toy or learning project? → Brushed DC with H-bridge (cheapest, simplest)

The best motor is never the one that’s “coolest” or most powerful—it’s the one that meets your application requirements at the lowest cost, smallest size, and with acceptable efficiency and reliability.


Further Reading:

  • Texas Instruments: “BLDC Motor Fundamentals” (SLVA1093)
  • NXP: “Stepper Motor Control” application notes
  • ESA: “Motor Selection Guide for Robotics” resources
  • NEMA: Standards for motor rating and operation

Practical Resources:

  • Arduino motor control libraries: TimerOne, PID
  • STM32CubeMX: Automated PWM and timer configuration
  • Marlin 3D printer firmware: Reference implementation for stepper control
  • SimpleFOC: Open-source BLDC/PMSM field-oriented control library