SLAAE95 March   2023 MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3105 , MSPM0G3106 , MSPM0G3107 , MSPM0G3505 , MSPM0G3506 , MSPM0G3507 , MSPM0L1105 , MSPM0L1106 , MSPM0L1303 , MSPM0L1304 , MSPM0L1305 , MSPM0L1305-Q1 , MSPM0L1306 , MSPM0L1306-Q1


  1.   Using MSPM0 MCUs to Design Trapezoidal-Based BLDC Motor Controllers

Using MSPM0 MCUs to Design Trapezoidal-Based BLDC Motor Controllers

Brushless-DC (BLDC) motors are used in a wide variety of products such as power tools, robotics, appliances, cordless vacuums, RC toys, motor modules, printers, and more. For these applications, brushless DC motors are preferred over other motor types due to their high-efficiency operation, low noise and long operational lifetimes. The trapezoidal (TRAP) algorithm, a simple software loop, is widely used in BLDC control designs due to its capability to develop large torque and a high maximum speed. MSPM0 MCUs, using TRAP, can fill this role with their low-price, board portfolio, abundant analog resources, and high-performance features.

Home appliancesPower toolsIndustrial motorsPersonal transport

What are BLDC and TRAP?

BLDC is a brushless motor that uses the force generated by the inconsistent magnetic fields of the stator and rotor to drive the motor. The rotor of this motor is a permanent magnet, and the stator is a multiple machine winding composed of coils.

Trapezoidal control means controlling the direction of the magnetic field according to the position of the rotor by changing the U, V, and W current direction. Hall encoders, or other sensors, can provide the rotor position . A sensorless version uses the sensor Back-EMF to estimate the rotor position, typically using either 120° 6-step control logic or 150° 12-step control logic.

Across BLDC related applications, users need to accurately control the motor speed, torque, and other variables to meet the requirements of the application. Therefore, the main requirements for a BLDC application are:

Sensored trapezoidal

For sensored feedback, Hall-effect sensors or other sensors can provide the immediate rotor position by detecting magnetic fields of the motor and translating them into logic-level signals. The current state of the motor (determined by the Hall input signals for phase U/V/W) determines the PWM signal pattern required to spin the motor to next state. The states of the motor phases are driven high (+), low (-), or undriven (Z) in a specific pattern to commutate the motor.

GUID-20230118-SS0I-XSGD-TDZN-MTV8S3QJ2LXS-low.png Figure 1-1 U, V, W Change Step Timing for Trapezoidal, 6 Step, 120°

Sensorless trapezoidal

Sensorless trapezoidal control uses the motor's BEMF to estimate the rotor position, typically when the "Z" periods cross a preset threshold, which determines the next motor state. The preset threshold is often called the BEMF threshold and can be used in one of two ways:

  1. Set as a comparator input from an integrated reference DAC, and compared to the BEMF voltage on the undriven winding
  2. Set in software and compared to the motor's phase voltages sampled as ADC inputs (using resistor dividers to scale down the phase voltages)
Figure 1-2 BEMF Detection using Comparator on Undriven Winding

Across BLDC-related applications, users need to accurately control the motor speed, torque, and other variables to meet the requirements of the application. Therefore, the main requirements for a BLDC application are:


  • Microcontroller (MCU): As the motor driver controller, the MCU controls analog data acquisition, executes control algorithms, monitors the motor status, and communicates with other products.
  • Pre-driver: Pre-driver for power stage
  • Power stage: 6 N-type MOSFETs
  • Analog front end: monitor motor voltage, current, speed, and more for closed loop speed/torque control or current regulation


  • Application: Task management and scheduling
  • Algorithm: Calculate the drive signal output of the motor in real-time according to the feedback of the motor and the user input signal

You can implement all of these functions using TI devices for a wide range of 3-phase BLDC motor voltages and powers.

Why is MSPM0 suitable for BLDC and trapezoidal control?

TI’s scalable M0+ MSPM0Gxx high-performance MCUs with advanced on-chip motor control peripherals provide a great low-cost solution for a variety of motor control applications. The portfolio covers from 32KB to 128KB of flash with scalable analog integration, motor control peripherals, and CAN-FD.

  • Up to 80-MHz M0+ CPU – Reduces process time for TRAP algorithms and sensing signal
  • Integrated math accelerator
    • 32-bit hardware divider (8 cycles) for fixed point and IQ format numbers
    • Square root operation in 21 cycles
    • 24-bit trigonometric calculations (sin, cos, atan) in 29 cycles
  • Two independent 4-Msps 12-bit ADC modules (up to 16 channels)
    • Up to 11 ENOB with better SNR
    • Up to 4-Msps ADC boost motor phase current sensing within 250 ns
  • Two zero-drift chopper op-amps – Accurately amplify the bus current
  • Three high-speed comparators – Detect Back-EMF and provide stable step signal (sensorless)
  • Advanced motor control timers – Flexible 6 PWM control with deadband
  • Robust IO design with glitch filter – Provides a reliable system with motor noise
  • Comprehensive communication interfaces – Includes UART, I2C, SMBus, SPI, and CAN-FD to meet all the communication requirements with the motor control system.
  • BLDC trap algorithm library – Spin a BLDC motor with Hall-sensored trap control in less than 10 minutes.
  • Scalable MCU portfolio with pin-to-pin compatible devices cross a wide range of flash memory options.
  • Low-cost and small-footprint packages provide cost-effective options for space-constrained designs.
  • Support wide operating temperature range (-40°C to 105 or 125°C) with Q100 qualified options for system stability and reliability.

What can MSPM0 do in BLDC and trap control?

In a BLDC application, the MSPM0 monitors the motor status and runs the trapezoidal control algorithm with a suitable 3-phase gate driver or motor driver. Additionally, the MCU or driver can integrate many features to optimize the solution and reduce overall form factor. MCU selection for BLDC motor control can vary based on low-power or high-performance requirements, and driver selection can vary based on analog integration and motor drive specifications. To account for these different system designs, the MSPM0 portfolio offers a variety of MCUs optimized for low-power or high-compute performance with optional analog integration as shown in Table 1-1.

Table 1-1 MSPM0 Selection Based on MCU Performance and Motor Driver Analog Topology
Low Power High Compute Performance
Motor driver with integrated current sense amplifiers MSPM0L110x (32 MHz) MSPM0Gx1xx (80 MHz)
Motor driver without current sense amplifiers MSPM0L130x (32 MHz with analog) MSPM0Gx5xx (80 MHz with analog)

For low-power BLDC sensored trap applications, MSPM0Lxxx devices provide as small as 1µA standby current while providing sufficient performance for sensored and sensorless trapezoidal control. MSPM0Lxxx devices come in small packages (as small as SOT-16) and can be powered from a 3.3V LDO or Buck integrated in the motor driver to reduce system form factor and BOM cost. This topology is suited for low-power, mid-performance BLDC trap applications such as BLDC motor modules, robotics, small appliances, RC toys, and HVAC motors.

For high-compute BLDC sensored trap applications, MSPM0Gxxx devices provide 80 MHz CPU performance with a hardware math accelerator for data logging and processing while providing sufficient performance for sensored and sensorless trapezoidal control. MSPM0Gxxx devices come in small packages (as small as VSSOP-20), provide optional CAN-FD interface, and can be powered from a 3.3V LDO or Buck integrated in the motor driver to reduce system form factor and BOM cost. This topology is suited for high-performance BLDC sensored trap applications such as power tools, garden tools, cordless vacuum cleaners, medical equipment, drones, e-mobility, and servo drives.

The MSPM0 portfolio offers optional analog integration which can be used for calculating motor phase currents and detecting low side overcurrent, and pairs well with basic motor drivers without integrated current sense amplifiers (CSAs). Conversely, MSPM0 devices without analog integration pair well with integrated motor drivers that include up to 3 low-side CSAs for phase current feedback. #FIG_PJQ_SHK_DWB and #FIG_J3D_JLL_PWB show the supported topologies for Hall-sensored and sensorless trapezoidal control using MSPM0.

Figure 1-3 MSPM0 Block Diagram for Hall-Sensored Trapezoidal Control
Figure 1-4 MSPM0 Block Diagram for Sensorless Trapezoidal Control

Solution details

  • Code Examples
  • Timer
    • Generate PWM (TIMx)
      • Configure the cross trigger between TIMG instances to generate 6 PWMs without deadband insertion
      • Generate 6 PWMs from TIMA0 with deadband insertion
      • PWM: Complementary PWM signals with adjustable duty cycle
      Figure 1-5 PWM Sequence for 120° 6-Step TRAP
    • QEI (TIMG)
      • Quadrature encoder interface (QEI) for positioning and movement sensing
  • OPA and ADC
    Figure 1-6 MSPM0Gx OPA Block Diagram for Current Sensing
    • 6-MHz GBW in standard (STD) mode
    • 4-V/µs slew rate in STD mode
    • 6-µV/°C Input offset voltage temperature drift in STD mode
  • COMP – High-speed mode
    Figure 1-7 MSPM0 COMP Block Diagram for BEMF Detection
    • The 8-bit DAC inside COMP sets the Back-EMF threshold
      • DAC settling time: 1 µs in static mode
      • COMP response time: 40 ns in high-speed mode


Order an MSPM0 LaunchPad™ development kit and a DRV83xxEVM today to start evaluating MSPM0 for your motor control system. Jumpstart your motor control design with MSPM0 code examples and interactive online training. You can also find other resources at these links: