SGD | USD

Quickly Implement Motor Control Designs Using a Drive IC with Integrated Microcontroller

By Jacob Beningo

Contributed By Digi-Key's North American Editors

The use of motors is steadily increasing in applications such as automobiles, robotics, industrial control and aerial vehicles. However, motor electronics are traditionally heavy, bulky, inefficient, and difficult to work with due to the high drive voltages that are involved. With designers facing an increasing demand for lower BOM costs, higher efficiency and smaller footprint electronics, as well as greater flexibility and faster time to market, a higher degree of integration and ease of use is needed.

This article will introduce STMicroelectronics’ STSPIN32F32F060x family of system-in-package (SiP) 3-phase motor controllers with a built-in microcontroller, and show how they can be used to achieve these design, cost, and time-to-market market challenges.

How to drive a 3-phase motor

In order to successfully drive a 3-phase motor, there are several hardware blocks that must be built into the design:

  • A microcontroller
  • A motor drive IC
  • High-voltage MOSFETs or IGBTs (that perform the actual switching)

In a traditional motor controller design, a developer will usually have a section of the pc board that is dedicated to all three blocks. Typically, the microcontroller sends pulse width modulated (PWM) signals to the motor drive IC, which carefully monitors these signals along with the output current and voltage that are generated at the motor controller’s output, to drive the MOSFETs. The microcontroller often also communicates with the motor drive IC through either an I2C or SPI bus to enable custom features and functionalities, or it may use a half dozen or so discrete GPIO signals to control the bridge’s behavior.

The challenge with an external bridge driver IC in today’s development cycle is that they add additional cost and complexity and use up precious pc board space, not to mention input and output (I/O) signals on the microcontroller that might otherwise be used for something else. This is where a new class of integrated microcontrollers and bridge circuits is simplifying motor control applications, while simultaneously decreasing BOM costs and minimizing pc board surface area.

Why use the STSPIN32F060x

This class is represented by the STMicroelectronics STSPIN32F060x SiP series of components that embeds an STM32F031x6x7 Arm® Cortex®-M0 microcontroller with a 600 volt triple half-bridge gate driver (Figure 1). Each half-bridge can be used to drive a MOSFET or IGBT on each phase of a brushless DC (BLDC) motor.

Diagram of STMicroelectronics STM32F060x integrates an STM32F031 Arm Cortex-M0 (click to enlarge)Figure 1: The STM32F060x integrates an STM32F031 Arm Cortex-M0 with a 600 volt triple half-bridge gate driver to save cost, pc board space, and package pins. (Image source: STMicroelectronics)

The series provides some very interesting features and protections. For example, the parts include:

  • A comparator with an advanced smart shutdown (smartSD) function that ensures fast and effective protection against overload and overcurrent
  • Integrated high-voltage bootstrap diodes
  • Anti-cross-conduction protection
  • Deadtime protection
  • UVLO protection

The built-in microcontroller operates at 48 megahertz (MHz) and includes 32 kilobytes (Kbytes) of flash with 4 Kbytes of RAM, which is perfect for implementing field-oriented control (FOC).

The STM32F060x currently includes two parts in the family, the STSPIN32F0601 and the STSPIN32F0602. The primary difference between the two is that the 0601 supports gate drive currents up to 0.35 amperes (A), while the 0602 can support gate drive currents up to 1.0 A.

Notice that internal to the IC, the STM32F031 microcontroller is connected to the gate driver through several GPIO lines that are internal to the package. GPIO PA11 is used to enable the gate driver, and GPIO PB12 is used to detect if there is a fault with the bridge. GPIOs PA8 – PA10 are used for the gate driver’s high side inputs, while GPIOs PB13 – 15 are used for the gate driver’s low side inputs. This saves developers from having to use external GPIO pins to control a gate driver, while also avoiding the need for pc board space to run traces to a separate IC. Integrating both components simplifies the hardware and design complexity and can significantly reduce BOM costs.

Accelerate development with the EVSPIN32F0601S1 dev board

The STSPIN32F060x is supported by the EVSPIN32F0601S1 development board, a complete 3-phase inverter starter kit that includes all the necessary electronics to get a BLDC motor up and running using the STSPIN32F0601 controller (Figure 2). The EVSPIN32F0601S1 is broken up into five primary sections:

  • The STSPIN32F0601
  • A detachable STLINK debugger
  • A feedback network
  • A power stage
  • A power supply

Image of STMicroelectronics EVSPIN32F0601S1 development boardFigure 2: The EVSPIN32F0601S1 development board provides all the necessary electronics to get a BLDC motor up and running using the STSPIN32F0601 controller. (Image source: STMicroelectronics)

The pcb STLINK-debugger can be removed from the development board if desired, allowing developers to shrink the board size so that it can be used in prototypes and proof-of-concept (PoC) enclosures. Developers can still connect an external STLINK-V3SET (Figure 3) by connecting it to the SWD headers on the development board.

Image of STMicroelectronics STLINK-V3SET debuggerFigure 3: The STLINK-V3SET debugger is an external debugger that can be used to program and debug applications that are written using an STM32 microcontroller. (Image source: STMicroelectronics)

The development board also includes a feedback network that can be used for motor control algorithms that require sensors to provide the voltage and current feedback. In many modern designs, these feedback networks can be removed and an FOC algorithm can be used. This is a sensorless motor control algorithm that can further reduce the BOM costs and the size of the resultant pc board.

The power stage provides developers with high and low side MOSFETs or IGBTs that are used to switch the voltage across the various motor windings. What’s interesting about the board design is that the footprints are for either DPAK or PowerFlat packages, allowing developers to modify the development board if they so choose to use their own MOSFET or IGBT.

Finally, the power supply can provide an input ranging from 50 volts up to 280 volts DC/AC. The onboard flyback transformer can also generate +15 and +3.3 volts for use in the application.

In order to experiment with the development board, one needs to connect a BLDC like the QBL4208-41-04-006 from Trinamic Motion Control GmbH (Figure 4). Each phase of the BLDC motor is connected to the EVSPIN32F0601S1 through the appropriate output screw terminals.

Image of Trinamic Motion Control GmbH QBL4208-41-04-006 BLDC motorFigure 4: The QBL4208-41-04-006 BLDC motor runs at 4000 RPM and can be used with the EVSPIN32F0601S1 dev board to develop a wide variety of applications. (Image source: Trinamic Motion Control GmbH)

While the EVSPIN32F0601S1 development board has all the hardware necessary to drive a BLDC motor, a 3-phase motor also requires software. To drive a motor successfully, developers can leverage STMicroelectronics’ X-CUBE-MCSDK motor control software development kit. This library can be used with software packages like the ST32CubeIDE and ST32CubeMx to easily configure a motor control solution.

Driving a BLDC motor with software

The X-CUBE-MCSDK software package includes two high-level applications: the MotorControl Workbench and the Motor Profiler. The motor control workbench allows a developer to create a motor control project to easily run a motor. Various motor algorithms can be used to drive the motor, including FOC, as well as various feedback topologies such as:

  • One shunt resistor
  • Three shunt resistors
  • Two isolated current sensors

The Motor Profiler allows a developer to enter their general motor parameters and then completely profile the motor. This profiling provides the general motor parameters required by algorithms such as FOC to successfully drive the motor.

Creating a project within the Motor Control Workbench is simple. A developer needs to open Motor Control Workbench and select new project. They can then enter their parameters as shown in Figure 5:

  • Application type
  • The number of motors that will be controlled
  • Their control and power configurations
  • The motor parameters such as poles, speed, voltage, and nominal current

Imaeg of Motor Control Workbench ProjectFigure 5: The Motor Control Workbench Project configuration allows a developer to customize their project settings for their hardware. (Image source: Beningo Embedded Group)

Once the information for the project has been selected, developers can click OK which then brings them to the Motor Control Workbench (Figure 6). From the workbench, developers can customize how their application behaves. This includes the ability to configure:

  • Firmware settings like the start-up profile, drive settings and sensing options
  • Digital I/O settings like the encoder interface, hall sensors, serial communication, and start and stop buttons
  • Digital-to-analog converter (DAC) functionality
  • Analog input and protection settings for feedback from phase current, bus voltage, temperature, and the PFC stage.

Image of Motor Control WorkbenchFigure 6: The Motor Control Workbench provides a developer with the ability to customize their firmware, adjust MCU and clock frequencies along with the digital I/O, DAC, and analog input protection. (Image source: Beningo Embedded Group)

Developers even have the ability to enable and disable settings with the click of a checkbox such as:

  • Bus voltage sensing
  • Temperature sensing
  • Current sensing with over current protection
  • Speed sensing

A developer doesn’t even need to see a single API or line of code to completely configure their motor control application.

Conclusion

Developers and motor control system designers face increasing pressure for lower costs, higher efficiency and smaller footprint electronics. As shown, the STSPIN32F060x SiP for 3-phase BLDC motor controller applications not only decreases BOM costs, but also pc board space and system complexity. It also comes with an effective ecosystem, including a development board and software designed to get developers up and running with motor control applications quickly and easily.

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of Digi-Key Electronics or official policies of Digi-Key Electronics.

About this author

Jacob Beningo

Jacob Beningo is an embedded software consultant. He has published more than 200 articles on embedded software development techniques, is a sought-after speaker and technical trainer, and holds three degrees, including a Masters of Engineering from the University of Michigan.

About this publisher

Digi-Key's North American Editors