UM2572 User manual
How to use the six-step brushless motor driver evaluation board for applications based on the STSPIN3204 BLDC controller
Introduction
The STEVAL-SPIN3204 three-phase brushless DC motor driver board is based on the STSPIN3204 3-phase BLDC controller with triple half-bridge gate driver, single shunt resistor current sensing topology, and programmable overcurrent protection. The motor controller system-in-package includes an STM32F031C6 microcontroller ready to execute 6-step, field oriented control (FOC), and other advanced driving algorithms in the firmware, which can be downloaded onto the chip flash memory via the board USB port.
The board is designed to help you test and develop motor control designs for applications such as power tools, home appliances, fans, and pumps, with a flexible evaluation platform that even allows you to toggle between external sensor and sensorless position feedback data methods.
Figure 1. STEVAL-SPIN3204 evaluation board: A photograph of the evaluation board, displaying various components, connectors, and silkscreen labels.
Solution overview
The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based on position feedback data from one of the following sources: external quadrature encoders or Hall Effect sensors, or on-board circuitry that senses the back electromotive force (BEMF) generated by the load motor.
Figure 2. STEVAL-SPIN3204 motor control block diagram: A block diagram illustrating the main components of the evaluation board, including MCUs, power stage, gate driver, and interfaces.
The power stage on the board delivers 15 ARMS DC current from three STD140N6F7 MOSFETs in half-bridge configuration, managed by the triple half-bridge gate driver on the BLDC controller. The board senses the current flowing into the motor phases through a shunt resistor, and the resulting signal is amplified, filtered, and forwarded to the STSPIN3204 BLDC controller MCU and control logic gate driver for monitoring and peak current limitation or overcurrent protection. Voltage sensing is implemented through a voltage divider from the motor supply voltage (VBUS) and sent to the BLDC controller MCU for monitoring purposes.
The board also features an embedded ST-LINK/V2-1 programmer/debugger to help you load, test, and modify the motor controller firmware.
Features
- Input voltage from 7 to 45 V
- Output current up to 15 ARMS
- Power stage based on STD140N6F7 MOSFET
- Embedded 3.3 V buck regulator
- Embedded 12 V LDO regulator
- Single shunt current sensing
- Digital Hall sensors and encoder input
- Overcurrent comparator
- Bus voltage sensing
- Embedded ST-LINK/V2-1
- Easy user interface with buttons and trimmer
- RoHS and WEEE compliant
Hardware user interface
The STEVAL-SPIN3204 motor control evaluation board has the following interfaces:
- User button 1 (SW2): can be assigned to start motor operation, connected to PF0 GPIO of the STSPIN32F0B. User LED 1 (DL3) signals SW2 is closed or the PF0 GPIO is forced low.
- User button 2 (SW3): can be assigned to stop motor operation, connected to PF1 GPIO of the STSPIN32F0B. User LED 2 (DL4) signals SW3 is closed or the PF1 GPIO is forced low.
- A reset switch (SW1) to reset the board and the motor controller.
- A potentiometer (R6) to adjust the target rotation speed.
- Output voltage can be sensed through PA3 GPIO of the STSPIN32F0B (channel 3 of the ADC).
- Red LED (DL1) to indicate logic power supply (VDD).
- Red LED (DL2) to indicate power connection (VM).
- A USB port and embedded ST-LINK/V2 programmer/debugger to allow you to program and debug the board firmware directly from your PC. The red-green LED (LD1) signals programming activity.
STSPIN32F0B advanced single shunt BLDC controller with embedded STM32 MCU
BLDC motor controller description
The STSPIN32F0B is a System-In-Package providing an integrated solution suitable for driving three-phase brushless motors using different driving modes. It embeds a triple half-bridge gate driver able to drive power MOSFETs with a current capability of 600 mA (sink and source). An integrated interlocking function prevents simultaneous high-side and low-side switching in the same half-bridge. An internal DC/DC buck converter provides the 3.3 V supply for the MCU and external components, while an internal LDO linear regulator supplies the gate drivers. The integrated operational amplifier is available for signal conditioning, such as current sensing across the shunt resistor. A comparator with a programmable threshold performs overcurrent protection. The integrated MCU (STM32F031C6) supports field-oriented control, 6-step sensorless, and other advanced driving algorithms. It includes write/read protection for its Flash memory and a bootloader for firmware updates. The device also features overtemperature and undervoltage lockout protections and a standby mode for reduced power consumption. It offers 20 general-purpose I/O ports (GPIO) with 5 V tolerance, a 12-bit ADC with up to 9 channels, 5 general-purpose timers, and a Serial Wire Debug (SWD) interface.
STSPIN32F0B block diagrams
Figure 3. STSPIN32F0B System-In-Package block diagram: A detailed block diagram of the STSPIN32F0B chip, showing its internal architecture, including MCUs, gate drivers, and peripherals.
Overcurrent protection
When jumper J11 is closed in the 1-2 position, the board uses current sensing for overcurrent protection. Load current is forwarded to a comparator input according to the formula: VOCCOMP = Iload × Rshunt × GOPAMP
. The VOCCOMPth is set via the PF6 and PF7 GPIOs.
Table 1. Overcurrent thresholds:
PF6 | PF7 | Internal comp. threshold | OC threshold |
---|---|---|---|
0 | 1 | 100 mV | 3.2 A |
1 | 0 | 250 mV | 8 A |
1 | 1 | 500 mV | 16 A |
The protection can be implemented using the circuitry integrated in the analog section of the STSPIN32F0B SiP (enabled by setting OC_SEL input high) or using the TIM1_BKIN input.
Current mode driving (current limiter)
When jumper J11 is closed in the 2-3 position, the board uses current sensing to implement an adjustable current limiter. The target of the current limiter depends on the duty-cycle (DC) of the PWM on PA6 GPIO and the comparator internal threshold (VOCCOMPth).
The formula for the current limiter is: Ilimit = (VOCCOMPth - VDD × DC × GREF) / (Rshunt × GOPAMP)
. The VOCCOMPth is set through the PF6 and PF7 GPIOs.
Table 2. VOCCOMPth settings:
PF6 | PF7 | Internal comp. threshold |
---|---|---|
0 | 1 | 100 mV |
1 | 0 | 250 mV |
1 | 1 | 500 mV |
Figure 5. Current limiter peak value: A line graph showing the relationship between Duty Cycle and current limit (Ilimit) for different internal comparator thresholds.
The current limiter can be implemented using the protection circuitry integrated into the analog part of the STSPIN3204 SiP (enabled by setting OC_SEL input high) or using the TIM1_ETR input.
Hall effect sensors and Quadrature encoder
The STEVAL-SPIN3204 evaluation board supports digital Hall sensors and quadrature encoder motor position feedback. The sensors can be connected to the STSPIN3204 by closing jumpers JP5, JP6, and JP7. When these jumpers are closed, jumpers JP8, JP9, and JP10 for BEMF sensing must be open. The Hall sensors/encoder should be connected to J4.
Table 3. Hall based sensors/Quadrature encoder connector (J4):
Name | Pin | Description |
---|---|---|
Hall1/A+ | 1 | Hall sensor 1/encoder out A+ |
Hall2/B+ | 2 | Hall sensor 2/encoder out B+ |
Hall3/Z+ | 3 | Hall sensor 3/encoder zero feedback |
VDD sensor | 4 | Sensor supply voltage |
GND | 5 | Ground |
A protection series resistor of 1 kΩ is mounted in series with connector inputs. For sensors requiring an external pull-up, three 10 kΩ resistors are already mounted on the output lines and connected to the VDD voltage. A footprint for pull-down resistors is also available (R59, R60, R61). Jumper JP3 selects the supply line for the sensor: jumper between 1-2 pins powers sensors by VUSB (5 V); jumper between 2-3 pins powers sensors by VDD (3.3 V).
Programming and debugging the STSPIN3204 motor controller
The STEVAL-SPIN3204 evaluation board embeds an ST-LINK/V2-1 debugger/programmer with the following features: USB software re-enumeration, Virtual COM port interface on USB connected to PB6/PB7 pins of the STSPIN3204 (UART1), and Mass storage interface on USB. The power supply for the ST-LINK is provided by the host PC through the USB cable.
The red-green LED LD1 provides ST-LINK communication status information:
- Red LED flashing slowly: at power-on before USB initialization.
- Red LED flashing quickly: following first correct communication between the PC and ST-LINK/V2-1 (enumeration).
- Red LED ON: initialization between the PC and ST-LINK/V2-1 is complete.
- Green LED ON: successful target communication initialization.
- Red/green LED flashing: during communication with target.
- Green ON: communication finished and successful.
The reset function is disconnected from the ST-LINK by removing the jumper J8.
Get started with the board
Safety information
Caution: Some of the components mounted on the board may reach hazardous temperatures during operation. While using the board:
- Do not touch the components.
- Do not cover the board.
- Do not put the board in contact with flammable materials or materials releasing smoke when heated.
- After operation, allow the board to cool down before touching it.
How to set up and use the board
Using the STEVAL-SPIN3204 evaluation board requires the following items to set up a functional system: A Windows PC (XP, Vista 7, Windows 8, Windows 10) to install the software package; a mini-B USB cable to connect the STEVAL-SPIN3204 board to the PC; a firmware package based on STM32 Motor Control SDK (X-CUBE-MCSDK-Y); a three-phase brushless DC motor with compatible voltage and current ratings; and an external DC power supply.
Step 1. Check the jumpers according to the target configurations.
Figure 6. J11 gate driving modes: Images showing the jumper J11 in two positions: "Voltage mode" (J11 closed 1-2) and "Current mode" (J11 closed 2-3).
Step 2. Connect the motor to the connector J3. Be sure to connect the phase wires correctly.
Figure 7. J3 phase wire connections: A diagram illustrating how to connect the motor phases (U, V, W) to connector J3.
Step 3. Supply the board through the input 1 and 2 of connector J2. Red LEDs DL1 and DL2 will turn on.
Figure 8. J2 motor power supply: A diagram showing the connection of the external DC power supply to connector J2 (VM and GND).
Step 4. Connect the board to the PC through the USB cable.
Figure 9. J5 USB connection: A diagram showing the USB connection to connector J5.
Step 5. Develop your application using the STM32 Motor Control SDK.
Hardware description and configuration
Figure 10. Jumper and connector positions: A top-down view of the STEVAL-SPIN3204 board with numbered labels pointing to various jumpers and connectors.
Table 4. Hardware setting jumpers:
Jumper | Permitted configurations | Default |
---|---|---|
JP1 | Connects VREG to VM and limits the supply voltage of the board to 15 V. | OPEN |
JP2 | Connects the supply voltage of the power stage to the STSPIN3204 main supply (VM). | CLOSED |
JP3 | Selects Hall encoder supply between 5 V USB (1-2) and 3.3 V VDD (2-3). | 1-2 |
JP4 | Resets the ST-LINK microcontroller (U4). | OPEN |
JP5, JP6, JP7 | Connects PA0/PA1/PA2 to the inputs of J4 connector (Hall-effect sensors and encoder for motor position feedback). | OPEN |
JP8, JP9, JP10 | Connects PA0/PA1/PA2 to the BEMF sensing circuitry (sensorless operation). | CLOSED |
J8 | Connects the STSPIN3204 reset input to the ST-LINK. | CLOSED |
J9 | Pulls-up the BOOTO input enabling bootstrap mode. | OPEN |
J11 | Selects between voltage mode (1-2) and current mode (2-3) operation. | 1-2 |
Table 5. Connectors and test points description:
Name | Pin | Label | Description |
---|---|---|---|
J1 | 1-8 | PB8 GPIO to Ground | Various GPIO pins and Ground |
J2 | 1-2 | 8-45 V, GND | Motor supply voltage (VM) and ground |
J3 | 1-2-3 | U, V, W | Motor phase connections |
J4 | 1-5 | HALL1/A+ to GND | Hall effect sensor and encoder connections |
J5 | 1-2 | Mini-B USB input | USB connection |
J6 | 1-4 | 3V3, CLK, GND, DIO | ST-LINK interface signals |
J7 | 1-2 | RX, TX | Virtual COM port lines |
J10 | 1-2 | RX, CLK | Bootloader UART lines |
TP1-TP16 | - | Various | Test points for voltage, signals, and outputs |
Schematic diagrams
Figure 11. STEVAL-SPIN3204 schematic - motor controller MCU and interfaces: A schematic diagram of the MCU and its associated interfaces on the evaluation board.
Figure 12. STEVAL-SPIN3204 schematic - power stage and external sensor inputs: A schematic diagram of the power stage components and external sensor input connections.
Figure 13. STEVAL-SPIN3204 schematic - current and voltage feedback, and BEMF sensing circuits: A schematic diagram illustrating the current sensing, voltage feedback, and BEMF sensing circuits.
Figure 14. STEVAL-SPIN3204 schematic - ST-LINK: A schematic diagram of the ST-LINK debugger/programmer circuitry.
Bill of materials
Table 6. STEVAL-SPIN3204 bill of materials: Lists all components used on the evaluation board, including reference designators, quantities, part values, descriptions, manufacturers, and order codes.
Table 7. Document revision history: Details the changes made to the document across different versions.
Revision history
Table 7. Document revision history:
Date | Version | Changes |
---|---|---|
06-May-2019 | 1 | Initial release. |
19-Jul-2021 | 2 | Updated Section 1 Solution overview and Section 2.2 How to set up and use the board. |
Important notice
STMicroelectronics NV and its subsidiaries ("ST") reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST's terms and conditions of sale in place at the time of order acknowledgement.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers' products.
No license, express or implied, to any intellectual property right is granted by ST herein. Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. For additional information about ST trademarks, please refer to www.st.com/trademarks. All other product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document. © 2021 STMicroelectronics - All rights reserved.