Coursify

Microprocessor

DC Motor Interfacing

1.25 hours

Learning Goals

  • Understand DC motor fundamentals: recognizing motor composed of permanent magnet stator and rotor with commutator, understanding continuous rotation (not discrete steps like stepper), recognizing speed proportional to applied voltage, understanding current requirements (0.5-2A typical)
  • Master PWM speed control: implementing Pulse Width Modulation varying duty cycle (on-time / total time) to control average voltage, achieving smooth speed control from 0% (off) to 100% (full power), managing PWM frequency (typically 1-20 kHz) above audible range
  • Analyze H-bridge driver circuits: recognizing four-switch H-bridge configuration enabling bidirectional current flow, understanding motor connection between H-bridge diagonal, implementing control logic (Q1+Q4 on = forward, Q2+Q3 on = reverse, all off = brake)
  • Apply motor direction control: implementing forward/reverse logic through control line states, managing deadtime between switching to prevent shoot-through (simultaneous Q1+Q2 or Q3+Q4 on), and recognizing smooth braking through H-bridge diagonal short
  • Understand back EMF and current limiting: recognizing back EMF (counter-voltage) from rotating motor opposing applied voltage, analyzing current equation (I = (Vapplied - Vback_emf) / Rmotor), implementing current limiting to protect port drivers
  • Master motor driver integration: utilizing L298N or similar integrated H-bridge drivers with PWM input, managing current feedback through sense resistor, implementing fault detection and overcurrent protection
  • Apply speed regulation: implementing closed-loop control using encoder feedback or back EMF estimation, maintaining constant speed through feedback adjustment, recognizing load variation effects on motor performance
  • Implement practical applications: creating fan speed control with thermal feedback, implementing servo-like position control through current/torque feedback, managing multi-motor coordination, and optimizing acceleration profiles for application requirements

DC motor interfacing is a core microprocessor application because a processor cannot usually drive a motor directly; instead, it must generate low-power control signals that are translated by a motor driver into the higher current and voltage required by the electromechanical load.2 A brushed DC motor commonly consists of a stator that provides a magnetic field, often using permanent magnets in small motors, and a rotor/armature supplied through brushes and a commutator so that torque continues in the same rotational direction as the rotor turns.2 Unlike a stepper motor, which advances in discrete angular steps, a brushed DC motor is intended for continuous rotation.2

In small embedded systems, DC motors are widely used in fans, pumps, toys, robotics, and actuators because speed is approximately related to the effective applied voltage and torque is related to armature current.2 This makes them especially suitable for PWM-based speed control and H-bridge-based direction reversal from a microprocessor.2 Practical systems must also consider motor startup current, back EMF, inductive switching behavior, current sensing, and protection against shoot-through in bridge drivers.3

A useful steady-state current relation for a brushed DC motor is:

Imotor=VappliedVback_EMFRmotorI_{motor} = \frac{V_{applied} - V_{back\_EMF}}{R_{motor}}

where Vback_EMFV_{back\_EMF} rises with speed, so current naturally falls as the motor accelerates.2 At startup, back EMF is near zero, making current potentially very high and often far beyond what a microprocessor I/O pin can source or sink. Therefore, the correct design pattern is:

In this course section, the focus is on how microprocessors interface with brushed DC motors using PWM, H-bridges, integrated drivers such as the L298 family, and feedback-based regulation suitable for application-oriented design.3

Footnotes

  1. NJIT DC Motor Principles - Lecture notes describing stator, rotor, brushes, and commutator operation in DC motors. 2 3

  2. Power Electronic Tips: Motor fundamentals and DC motors - Overview of DC motor behavior including back EMF, current, and speed relationships. 2 3 4 5 6 7

  3. MIT OpenCourseWare: 6.007 Pre-Lab 1 DC Motors - Educational explanation of rotor, stator, commutator, and continuous torque production. 2

  4. The Engineering Mindset: DC Motor Explained - Explanatory resource on motor construction, brushes, commutator, and EMF concepts. 2

  5. Onion Omega2 Maker Kit: Controlling a DC Motor using an H-Bridge - Introductory material on DC motor control, H-bridge direction control, and PWM-based speed control. 2 3

  6. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features. 2

Arduino DC Motor Control Tutorial - L298N | H-Bridge | PWM

Key Distinction

A brushed DC motor is a continuous-rotation actuator, not a discrete-step actuator like a stepper motor.2 That distinction matters because the microprocessor typically controls a DC motor through voltage, PWM duty cycle, and bridge polarity rather than by issuing step sequences.

Footnotes

  1. NJIT DC Motor Principles - Lecture notes describing stator, rotor, brushes, and commutator operation in DC motors.

  2. MIT OpenCourseWare: 6.007 Pre-Lab 1 DC Motors - Educational explanation of rotor, stator, commutator, and continuous torque production.

1. DC motor fundamentals for microprocessor interfacing

A simple brushed DC motor contains two permanent magnets or a field structure forming the stator, and a rotating wound element forming the rotor or armature.2 The commutator periodically reverses current in the rotor windings via the brushes so that the electromagnetic torque remains unidirectional.2 Without commutation, the rotor would align with the magnetic field and stop.

From an interfacing perspective, the most important electrical and mechanical facts are:

Motor propertyPractical meaning for interfacing
Continuous rotationUse PWM and polarity reversal, not step sequencing
Speed depends on effective voltagePWM is the standard digital control method2
Startup current can be largeNever drive directly from an I/O pin
Inductive loadFlyback paths and safe switching are required2
Back EMF increases with speedCurrent drops as speed rises2

For many educational and hobby-scale motors, operating current is often in the sub-amp to a few ampere range, and commonly used modules such as L298N are marketed for roughly up to 2 A per channel in module form, though thermal limits and voltage drops are significant design constraints.2 In practice, even a motor that “normally” runs at 0.5–2 A may draw a much larger stall current, so driver selection must be based on stall or surge conditions rather than only nominal running current.2

The electrical behavior is summarized by the motor voltage equation:

Vapplied=Eb+IaRaV_{applied} = E_b + I_aR_a

where EbE_b is back EMF and IaRaI_aR_a is the armature resistive drop.2 Because EbωE_b \propto \omega, the motor tends to self-regulate somewhat: when load increases and speed falls, back EMF drops, so current rises and torque increases.2

This interplay is why speed control, current limiting, and feedback design are all linked in a real motor interface.2

Footnotes

  1. NJIT DC Motor Principles - Lecture notes describing stator, rotor, brushes, and commutator operation in DC motors. 2 3

  2. MIT OpenCourseWare: 6.007 Pre-Lab 1 DC Motors - Educational explanation of rotor, stator, commutator, and continuous torque production. 2

  3. Power Electronic Tips: Motor fundamentals and DC motors - Overview of DC motor behavior including back EMF, current, and speed relationships. 2 3 4 5 6 7 8

  4. Onion Omega2 Maker Kit: Controlling a DC Motor using an H-Bridge - Introductory material on DC motor control, H-bridge direction control, and PWM-based speed control.

  5. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features. 2 3

  6. The Engineering Mindset: DC Motor Explained - Explanatory resource on motor construction, brushes, commutator, and EMF concepts. 2 3 4

  7. Handson Technology L298N Motor Driver User Guide - Practical module documentation covering L298N board-level interfacing, logic states, and typical current ratings.

Do Not Power a Motor from a Microprocessor Pin

Microprocessor and microcontroller I/O pins are designed for logic-level signaling, not motor current.2 A motor is an inductive load with startup and stall currents that can exceed pin limits by orders of magnitude, risking latch-up, overheating, or permanent device damage.

Footnotes

  1. Power Electronic Tips: Motor fundamentals and DC motors - Overview of DC motor behavior including back EMF, current, and speed relationships.

  2. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features.

2. PWM speed control

Pulse Width Modulation (PWM) controls motor speed by switching the supply on and off rapidly while varying the fraction of time the signal remains high.2 The duty cycle is

D=TonTtotal×100%D = \frac{T_{on}}{T_{total}} \times 100\%

and the average voltage applied to the motor is approximately

VavgDVsupplyV_{avg} \approx D \cdot V_{supply}

for simple low-frequency averaging models.2 Thus:

  • 0% duty cycle \rightarrow motor off
  • 50% duty cycle \rightarrow about half average voltage
  • 100% duty cycle \rightarrow full supply continuously applied2

Because the motor has electrical inductance and mechanical inertia, it does not fully stop during each PWM off interval; instead, it responds to the average effect, producing smooth speed variation over an appropriate frequency range.2

PWM frequency selection

PWM frequency is a design tradeoff.3

  • Too low: audible whining, higher torque ripple, potentially rough motion
  • Moderate to high: smoother current and less audible noise
  • Too high: increased switching loss, measurement difficulty, and driver heating2

For many microprocessor-based DC motor systems, a practical range is about 1 kHz to 20 kHz, with designers often preferring frequencies above the audible band to reduce audible noise.2

Footnotes

  1. Onion Omega2 Maker Kit: Controlling a DC Motor using an H-Bridge - Introductory material on DC motor control, H-bridge direction control, and PWM-based speed control. 2 3 4 5

  2. Adafruit: Improve Brushed DC Motor Performance - Discussion of brushed DC motor PWM characteristics including duty cycle and frequency effects. 2 3 4 5 6 7

  3. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through. 2 3

Typical PWM Frequency Tradeoff

Illustrative design zones for brushed DC motor control.[^8][^9]

Implementing PWM speed control from a microprocessor

  1. 1
    Step 1

    Use a hardware timer/counter to generate a stable PWM waveform instead of software delays, because timer-based PWM gives predictable period and duty cycle control.

    Footnotes

    1. Onion Omega2 Maker Kit: Controlling a DC Motor using an H-Bridge - Introductory material on DC motor control, H-bridge direction control, and PWM-based speed control.

  2. 2
    Step 2

    Select a frequency suitable for the driver and application, commonly in the 1–20 kHz range for educational brushed DC systems, while balancing audible noise and switching loss.2

    Footnotes

    1. Adafruit: Improve Brushed DC Motor Performance - Discussion of brushed DC motor PWM characteristics including duty cycle and frequency effects.

    2. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through.

  3. 3
    Step 3

    Translate the commanded speed into a duty ratio from 0% to 100%; the motor responds primarily to the average applied voltage.2

    Footnotes

    1. Onion Omega2 Maker Kit: Controlling a DC Motor using an H-Bridge - Introductory material on DC motor control, H-bridge direction control, and PWM-based speed control.

    2. Adafruit: Improve Brushed DC Motor Performance - Discussion of brushed DC motor PWM characteristics including duty cycle and frequency effects.

  4. 4
    Step 4

    Send the PWM signal to the driver enable input or PWM input rather than directly to the motor from the processor pin.2

    Footnotes

    1. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features.

    2. Handson Technology L298N Motor Driver User Guide - Practical module documentation covering L298N board-level interfacing, logic states, and typical current ratings.

  5. 5
    Step 5

    Check startup current, driver heating, and motor behavior under load because real current can rise sharply during acceleration or stall.2

    Footnotes

    1. Power Electronic Tips: Motor fundamentals and DC motors - Overview of DC motor behavior including back EMF, current, and speed relationships.

    2. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features.

  6. 6
    Step 6

    Use encoder feedback, Hall sensing, or back-EMF estimation when the application needs constant speed despite load variation.2

    Footnotes

    1. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through.

    2. Texas Instruments: Brushed DC Motor Control Using the SimpleLink CC2340R5 MCU With Zigbee - Application note showing PWM-based control, acceleration, sensing, and feedback-oriented motor control concepts.

3. H-bridge driver circuits and bidirectional current flow

To reverse a DC motor, the current through the motor terminals must be reversed. The standard circuit is the H-bridge, formed by four controlled switches around the motor.2

A more explicit control interpretation is:

Switch stateMotor behavior
Q1 + Q4 ONForward rotation
Q2 + Q3 ONReverse rotation
All OFFCoast or high-impedance stop, depending on driver2
Both low-side or both high-side conduction patterns in some driversBrake behavior may be available depending on implementation2

The motor is connected between the two bridge midpoints. Turning on one diagonal applies one polarity; turning on the opposite diagonal reverses polarity.2

Shoot-through and deadtime

The dangerous condition in an H-bridge is shoot-through, where both high-side and low-side devices on the same leg conduct simultaneously, effectively shorting the supply. To prevent this, designers insert deadtime: a brief interval in which both devices in a leg are off before the complementary switch turns on. Modern drivers may insert this automatically.

Braking is also important. In a coast condition, the motor is disconnected and slows naturally. In a brake condition, the motor terminals are shorted through the bridge path, causing current recirculation and faster deceleration.2

Footnotes

  1. Onion Omega2 Maker Kit: Controlling a DC Motor using an H-Bridge - Introductory material on DC motor control, H-bridge direction control, and PWM-based speed control. 2 3 4 5 6 7

  2. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features. 2 3

  3. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through. 2 3 4 5

Shoot-Through Hazard

Never command both switches on the same half-bridge leg to conduct at the same time. For example, turning on Q1 and Q2 together or Q3 and Q4 together can short the supply directly through the bridge, causing excessive current and possible device failure.

Footnotes

  1. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through.

Direction and braking logic in an H-bridge

  1. 1
    Step 1

    Choose one diagonal pair for forward rotation and the opposite diagonal pair for reverse rotation.2

    Footnotes

    1. Onion Omega2 Maker Kit: Controlling a DC Motor using an H-Bridge - Introductory material on DC motor control, H-bridge direction control, and PWM-based speed control.

    2. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features.

  2. 2
    Step 2

    Before changing from one conduction path to the opposite one, briefly turn both affected switches off to avoid shoot-through.

    Footnotes

    1. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through.

  3. 3
    Step 3

    Modulate either the enable input or one bridge side according to the driver architecture and datasheet recommendations.2

    Footnotes

    1. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features.

    2. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through.

  4. 4
    Step 4

    Use high-impedance output for free-running deceleration or a bridge shorting mode for stronger braking when the application requires faster stopping.2

    Footnotes

    1. Onion Omega2 Maker Kit: Controlling a DC Motor using an H-Bridge - Introductory material on DC motor control, H-bridge direction control, and PWM-based speed control.

    2. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through.

  5. 5
    Step 5

    Direction reversals and braking produce elevated current stress, so check driver thermal limits and sense signals if available.2

    Footnotes

    1. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features.

    2. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through.

4. Back EMF, startup current, and current limiting

A rotating DC motor behaves partly like a generator and produces back electromotive force that opposes the applied voltage.2 This is central to understanding why startup is stressful:

  • At standstill: ω0Eb0\omega \approx 0 \Rightarrow E_b \approx 0
  • So current is approximately: IstartVRmotorI_{start} \approx \frac{V}{R_{motor}}
  • Since winding resistance is often low, startup/stall current can be large.2

As the motor accelerates, EbE_b rises and current decreases.2 Therefore, the driver must be sized for stall current, not only no-load or nominal current.

Why current limiting matters

Current limiting is needed to protect:

  1. The driver IC or transistor bridge2
  2. The power supply
  3. PCB traces and connectors
  4. The motor itself under jam or stall conditions

Some integrated drivers provide sense pins or internal current regulation. The L298 architecture exposes current sense connections that can be used with external resistors for monitoring load current.2 However, because the L298 is an older bipolar driver with notable voltage drop and heat dissipation, modern MOSFET-based drivers often offer more efficient current control and protection features.2

Footnotes

  1. Power Electronic Tips: Motor fundamentals and DC motors - Overview of DC motor behavior including back EMF, current, and speed relationships. 2 3 4 5

  2. The Engineering Mindset: DC Motor Explained - Explanatory resource on motor construction, brushes, commutator, and EMF concepts. 2 3

  3. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features. 2 3 4

  4. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through. 2

  5. Handson Technology L298N Motor Driver User Guide - Practical module documentation covering L298N board-level interfacing, logic states, and typical current ratings.

For a brushed DC motor, the armature current can be approximated by:

I=VappliedVback_EMFRmotorI = \frac{V_{applied} - V_{back\_EMF}}{R_{motor}}

As speed rises, Vback_EMFV_{back\_EMF} rises, reducing current.2

Footnotes

  1. Power Electronic Tips: Motor fundamentals and DC motors - Overview of DC motor behavior including back EMF, current, and speed relationships.

  2. The Engineering Mindset: DC Motor Explained - Explanatory resource on motor construction, brushes, commutator, and EMF concepts.

5. Integrated motor driver interfacing: L298N and similar devices

The L298 is a dual full-bridge motor driver designed for inductive loads such as DC and stepper motors. It accepts TTL-compatible logic inputs and provides enable pins that can be used for PWM-based speed control. Datasheet-level features include operation up to 46 V, total DC current capability up to 4 A for the device, and overtemperature protection, though actual usable current depends strongly on package, heatsinking, voltage drop, and module implementation.

For educational interfacing, the L298N module is common because it makes these concepts visible:

  • Logic inputs set direction
  • Enable pins accept PWM
  • Output pins drive the motor
  • Sense pins can support current monitoring2

A typical microprocessor connection pattern is:

Typical logic truth table for one motor channel

ENA/PWMIN1IN2Result
0XXDisabled / coast2
110Forward
101Reverse
100Brake or stop depending on board/driver behavior
111Brake or stop depending on board/driver behavior

Limitations of older integrated drivers

The L298 is historically important but not ideal for high-efficiency designs because it uses bipolar transistor stages rather than low-resistance MOSFET switches, leading to higher voltage drop and heat. In modern embedded products, designers often choose newer MOSFET-based drivers with:

  • lower conduction loss
  • integrated current regulation
  • automatic deadtime
  • overcurrent protection
  • fault reporting

Still, the L298N remains pedagogically useful for understanding the architecture of driver integration.2

Footnotes

  1. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features. 2 3 4 5 6 7

  2. Handson Technology L298N Motor Driver User Guide - Practical module documentation covering L298N board-level interfacing, logic states, and typical current ratings. 2 3 4 5 6 7

  3. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through.

Best Educational Use of L298N

Use the L298N to learn direction control, PWM interfacing, and sense-pin concepts.2 For performance-oriented designs, prefer modern MOSFET-based brushed DC drivers because they waste less voltage and power.

Footnotes

  1. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features.

  2. Handson Technology L298N Motor Driver User Guide - Practical module documentation covering L298N board-level interfacing, logic states, and typical current ratings.

  3. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through.

6. Closed-loop speed regulation

Open-loop PWM control sets an approximate speed, but actual speed changes with load, supply voltage, friction, and motor variation.2 To maintain constant speed, the microprocessor should close the loop using measured feedback.

Common feedback options include:

  1. Encoder feedback
    Measure shaft speed directly using pulses per revolution.

  2. Hall-effect sensing
    Some brushed motor systems include Hall-based rotational sensing.

  3. Back-EMF estimation
    Estimate speed indirectly from motor voltage/current behavior during suitable sampling intervals.2

Basic control principle

Let

e(t)=ωrefωmease(t) = \omega_{ref} - \omega_{meas}

Then a controller adjusts PWM duty cycle according to error. A proportional or PI controller is common:

u(t)=Kpe(t)+Kie(t)dtu(t) = K_p e(t) + K_i \int e(t)\,dt

where u(t)u(t) maps to PWM duty cycle.

If load increases:

  • speed falls
  • back EMF falls
  • current rises
  • controller raises duty cycle
  • speed recovers2

This is the basis of constant-speed fan control, conveyor drives, mobile robots, and compact actuator systems.

Footnotes

  1. Power Electronic Tips: Motor fundamentals and DC motors - Overview of DC motor behavior including back EMF, current, and speed relationships. 2 3

  2. Texas Instruments: Brushed DC Motor Control Using the SimpleLink CC2340R5 MCU With Zigbee - Application note showing PWM-based control, acceleration, sensing, and feedback-oriented motor control concepts. 2 3 4 5 6

Closed-Loop Response Concept

Illustrative speed regulation under a sudden load increase.[^2][^10]

Designing a simple closed-loop motor speed controller

  1. 1
    Step 1

    Use an encoder, Hall sensor, or a suitable speed-estimation technique to obtain a measurable speed signal.

    Footnotes

    1. Texas Instruments: Brushed DC Motor Control Using the SimpleLink CC2340R5 MCU With Zigbee - Application note showing PWM-based control, acceleration, sensing, and feedback-oriented motor control concepts.

  2. 2
    Step 2

    Set the desired operating speed as the target value for regulation.

  3. 3
    Step 3

    Subtract measured speed from reference speed to determine whether the motor is too slow or too fast.

    Footnotes

    1. Texas Instruments: Brushed DC Motor Control Using the SimpleLink CC2340R5 MCU With Zigbee - Application note showing PWM-based control, acceleration, sensing, and feedback-oriented motor control concepts.

  4. 4
    Step 4

    Increase duty cycle if the motor is below target speed and reduce it if the measured speed is above target; PI control is commonly used for smoother regulation.

    Footnotes

    1. Texas Instruments: Brushed DC Motor Control Using the SimpleLink CC2340R5 MCU With Zigbee - Application note showing PWM-based control, acceleration, sensing, and feedback-oriented motor control concepts.

  5. 5
    Step 5

    Constrain duty-cycle steps or commanded current to avoid excessive inrush, abrupt torque, and thermal stress.2

    Footnotes

    1. Power Electronic Tips: Motor fundamentals and DC motors - Overview of DC motor behavior including back EMF, current, and speed relationships.

    2. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through.

  6. 6
    Step 6

    Stop or derate the motor when overcurrent, overheating, or stalled-rotor conditions are detected.2

    Footnotes

    1. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features.

    2. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through.

7. Practical applications in a microprocessor course context

Fan speed control with thermal feedback

A temperature sensor is read by the microprocessor, and PWM duty cycle is adjusted to maintain airflow and temperature targets.2 This is a canonical application because it combines ADC input, control logic, timer PWM, and actuator driving.

Servo-like position control using a DC motor

A standard brushed DC motor is not inherently positional, but when paired with an encoder or position sensor, the microprocessor can implement a position loop, making the system behave in a servo-like manner. Current or torque limiting improves safety and smoothness.

Multi-motor coordination

Robotic platforms often require two or more DC motors operating with matched speed or differential steering. This demands per-motor PWM channels, independent current-aware drivers, and synchronization logic in software.2

Acceleration profile optimization

Instead of instantly jumping from 0% to high duty cycle, the controller ramps duty cycle to reduce mechanical shock, supply droop, wheel slip, and peak current.2

A practical embedded motor system therefore combines:

  • timer-generated PWM
  • digital direction control
  • bridge driver hardware
  • current/thermal protection
  • speed or position feedback
  • software state handling3

Footnotes

  1. Onion Omega2 Maker Kit: Controlling a DC Motor using an H-Bridge - Introductory material on DC motor control, H-bridge direction control, and PWM-based speed control.

  2. Texas Instruments: Brushed DC Motor Control Using the SimpleLink CC2340R5 MCU With Zigbee - Application note showing PWM-based control, acceleration, sensing, and feedback-oriented motor control concepts. 2 3 4 5

  3. STMicroelectronics L298 Datasheet - Datasheet for dual full-bridge driver, including enable inputs, inductive load support, current capability, and protection features. 2

  4. Power Electronic Tips: Motor fundamentals and DC motors - Overview of DC motor behavior including back EMF, current, and speed relationships.

  5. Texas Instruments DRV8870 Datasheet - Modern brushed DC motor driver reference discussing PWM control and automatic deadtime to prevent shoot-through.

Common design questions and edge cases

Knowledge Check

Question 1 of 5
Q1Single choice

What is the primary function of the commutator in a brushed DC motor?