st - logolife.augmented
UM2154

User manual

STEVE-SPIN3201: advanced BLDC controller with embedded STM32 MCU evaluation board

Introduction

The STEVAL-SPIN3201 board is a 3-phase brushless DC motor driver board based on the STSPIN32F0, a 3-phase controller with an integrated STM32 MCU, and implements 3-shunt resistors as current reading topology.
It provides an easy-to-use solution for the evaluation of the device in different applications such as the home appliance, fans, drones, and power tools.
The board is designed for the sensored or sensorless field-oriented control algorithm with 3-shunt sensing.

Figure 1. STEVE-SPIN3201 evaluation board

UM2154 STEVAL-SPIN3201 Advanced BLDC Controller with Embedded STM32 MCU Evaluation Board - evaluation board

Hardware and software requirements

Using the STEVAL-SPIN3201 evaluation board requires the following software and hardware:

  • A Windows ® PC (XP, Vista 7, Windows 8, Windows 10) to install the software package
  • A mini-B USB cable to connect the STEVAL-SPIN3201 board to the PC
  • The STM32 Motor Control Software Development Kit Rev Y (X-CUBE-MCSDK-Y)
  • A 3-phase brushless DC motor with a compatible voltage and current ratings
  •  An external DC power supply.

Getting started

The maximum ratings of the board are the following:

  • Power stage supply voltage (VS) from 8 V to 45 V
  • Motor phase current up to 15 Arms

To start your project with the board:

Step 1. Check the jumper position according to the target configuration (see Section 4.3 Overcurrent detection
Step 2. Connect the motor to the connector J3 taking care of the sequence of the motor phases.
Step 3. Supply the board through the input 1 and 2 of the connector J2. The DL1 (red) LED will turn on.
Step 4. Develop your application using the STM32 Motor Control Software Development Kit Rev Y (X-CUBEMCSDK-Y).

Hardware description and configuration

Figure 2. Main components and connectors’ positions show the position of the main components and connectors on the board.
Figure 2. Main components and connectors positions

UM2154 STEVAL-SPIN3201 Advanced BLDC Controller with Embedded STM32 MCU Evaluation Board - fig1

Table 1. Hardware setting jumpers provide the detailed pinout of the connectors.
Table 1. Hardware setting jumpers

JumperPermitted configurationsDefault condition
JP1Selection of VREG connected to V motorOPEN
JP2Selection motor power supply connected to DC power supplyCLOSED
JP3Selection Hall encoder supply to USB (1) / VDD (3) power supply1 – 2 CLOSED
JP4Selection reset of ST-LINK (U4)OPEN
JP5Selection PA2 connected to Hall 3CLOSED
JP6Selection PA1 connected to Hall 2CLOSED
JP7Selection PA0 connected to Hall 1CLOSED

Table 2. Other connectors, jumper, and test points description

Name

PinLabel

Description

J11 – 2J1Motor power supply
J21 – 2J2Device main power supply (VM)
J31 – 2 – 3U, V, W3-phase BLDC motor phases connection
J41 – 2 – 3J4Hall/encoder sensors connector
4 – 5J4Hall sensors/encoder supply
J5J5USB input ST-LINK
J613V3ST-LINK power supply
2CLKSWCLK of ST-LINK
3GNDGND
4DIOSWDIO of ST-LINK
J71 – 2J7CART
J81 – 2J8ST-LINK reset
TP1GREG12 V voltage regulator output
TP2GNDGND
TP3VDDVDD
TP4SPEEDSpeed potentiometer output
TP5PA3PA3 GPIO (output op-amp sense 1)
TP6VBUSVBus feedback
TP7OUT_UOutput U
TP8PA4PA4 GPIO (output op-amp sense 2)
TP9PA5PA5 GPIO (output op-amp sense 3)
TP10GNDGND
TP11OUT_VOutput V
TP12PA7PA7_3FG
TP13OUT_WOutput W
TP143V33V3 ST-LINK
TP155VUSB voltage
TP16I/OSWD_IO
TP17CLKSWD_CLK

Circuit description

The STEVAL-SPIN3201 provides a complete 3-shunt FOC solution composed of a STSPIN32F0 – advanced BLDC controller with an embedded STM32 MCU – and a triple half-bridge power stage with the NMOS STD140N6F7.
The STSPIN32F0 autonomously generates all the required supply voltages: the internal DC/DC buck converter provides 3V3 and an internal linear regulator provides 12 V for the gate drivers.
The current feedback signal conditioning is performed through three of the operational amplifiers embedded into the device and an internal comparator performs overcurrent protection from shunt resistors.
Two user buttons, two LEDs, and a trimmer are available to implement simple user interfaces (e.g., starting/ stopping the motor and setting target speed).
The STEVAL-SPIN3201 board supports the quadrature encoder and digital Hall sensors as motor position feedback.
The board includes an ST-LINK-V2 allowing the user to debug and download firmware without any extra hardware tool.

4.1 Hall/encoder motor speed sensor
The STEVAL-SPIN3201 evaluation board supports the digital Hall and quadrature encoder sensors as motor position feedback.
The sensors can be connected to the STSPIN32F0 through the J4 connector is listed in

Table 3. Hall/encoder connector (J4). 

NamePinDescription
Hall1/A+1Hall sensor 1/encoder out A+
Hall2/B+2Hall sensor 2/encoder out B+
Hall3/Z+3Hall sensor 3/encoder zero feedback
VDD sensor4Sensor supply voltage
GND5Ground

A protection series resistor of 1 kΩ is mounted in a series with sensor outputs.
For sensors requiring an external pull-up, three 10 kΩ resistors are already mounted on the output lines and connected to the VDD voltage. On the same lines, a footprint for pull-down resistors is also available.

The jumper JP3 selects the power supply for the sensor supply voltage:

  • Jumper between the pin 1 – pin 2: Hall sensors powered by VUSB (5 V)
  • Jumper between the pin 1 – pin 2: Hall sensors powered by VDD (3.3 V)
    The user can disconnect sensor outputs from the MCU GPIO opening jumpers JP5, JP6, and JP7.

4.2 Current sensing

In the STEVAL-SPIN3201 board, the current sensing signal conditioning is performed through three of the operational amplifiers embedded into the STSPIN32F0 device.
In a typical FOC application, the currents in the three half-bridges are sensed using a shunt resistor on the source of each low side power switch. The sense voltage signals are provided to an analog-to-digital converter in order to perform the matrix calculation related to a certain control technique. Those sense signals are usually shifted and amplified by dedicated op-amps in order to exploit the full range of the ADC (refer to Figure 3. Current sensing scheme example).

Figure 3. Current sensing scheme example

UM2154 STEVAL-SPIN3201 Advanced BLDC Controller with Embedded STM32 MCU Evaluation Board - fig2

The sense signals have to be shifted and centered on VDD/2 voltage (about 1.65 V) and amplified again which provides the matching between the maximum value of the sensed signal and the full-scale range of the ADC.
The voltage shifting stage introduces attenuation (1/Gp) of the feedback signal which, together with the gain of the non-inverting configuration (Gn, fixed by Rn and Rf), contributes to the overall gain (G). As already mentioned, the goal is to establish the overall amplification network gain (G) so that the voltage on the shunt resistor corresponding to the maximum motor allowed current (ISmax peak value of motor rated current) fits the range of voltages readable by the ADC.

UM2154 STEVAL-SPIN3201 Advanced BLDC Controller with Embedded STM32 MCU Evaluation Board - fig4

Note that, once G is fixed, it is better to configure it by lowering the initial attenuation 1/Gp as much as possible and, therefore the gain Gn. This is important not only to maximize the signal by the noise ratio but also to reduce the effect of the op-amp intrinsic offset on the output (proportional to Gn).

UM2154 STEVAL-SPIN3201 Advanced BLDC Controller with Embedded STM32 MCU Evaluation Board - fig3

The gain and the polarization voltage (VOPout, pol) determine the operative range of the current sensing circuitry:

UM2154 STEVAL-SPIN3201 Advanced BLDC Controller with Embedded STM32 MCU Evaluation Board - fig5Where:

  • IS- = maximum sourced current
  • IS+ = maximum sunk current that can be sensed by the circuitry.

Table 4. STEVE-SPIN3201 op-amps polarization network

Parameter

Part referenceRev. 1

Rev. 3

RpR14, R24, R33560 Ω1.78 kΩ
RaR12, R20, R298.2 kΩ27.4 kΩ
RbR15, R25, R34560 Ω27.4 kΩ
RnR13, R21, R301 kΩ1.78 kΩ
RfR9, R19, R2815 kΩ13.7 kΩ
CfC15, C19, C20100 pFN. M.
G7.747.70
VOPout, pol1.74 V1.65 V

4.3 Overcurrent detection

The STEVAL-SPIN3201 evaluation board implements overcurrent protection based on the STSPIN32F0 integrated OC  comparator. Shunt resistors measure the load current of each phase. The resistors R50, R51, and R52 bring the voltage signals associated with each load current to the OC_COMP pin. When the peak current flowing in one of the three phases exceeds the selected threshold, the integrated comparator is triggered and all the high side power switches are disabled. High-side power switches are enabled again when the current falls below the threshold, thus implementing overcurrent protection.
Current thresholds for the STEVAL-SPIN3201 evaluation board are listed in

Table 5. Overcurrent thresholds.

PF6PF7Internal comp. thresholdOC threshold
01100 mV20 A
10250 mV65 A
11500 mV140 A

These thresholds can be modified by changing the R43 bias resistor. It is recommended to choose R43 higher than 30 kΩ. In order to calculate the value of the R43 for a target current limit IOC, the following formula can be used:

UM2154 STEVAL-SPIN3201 Advanced BLDC Controller with Embedded STM32 MCU Evaluation Board - fig6

where OC_COMPth is the voltage threshold of the internal comparator (selected by the PF6 and PF7), and VDD is the 3.3 V digital supply voltage provided by the internal DCDC buck converter.
Removing the R43, the current threshold formula is simplified as follows:

UM2154 STEVAL-SPIN3201 Advanced BLDC Controller with Embedded STM32 MCU Evaluation Board - fig7

4.4 Bus voltage circuit

The STEVAL-SPIN3201 evaluation board provides the bus voltage sensing. This signal is sent through a voltage divider from the motor supply voltage (VBUS) (R10 and R16) and sent to the PB1 GPIO (channel 9 of the ADC) of the embedded MCU. The signal is also available on the TP6.

4.5 Hardware user interface

The board includes the following hardware user interface items:

  • Potentiometer R6: sets the target speed, for example
  • Switch SW1: resets STSPIN32F0 MCU and ST-LINK V2
  • Switch SW2: user button 1
  • Switch SW3: user button 2
  • LED DL3: user LED 1 (also turns on when user 1 button is pressed)
  • LED DL4: user LED 2 (also turns on when user 2 buttons are pressed)

4.6 Debug

The STEVAL-SPIN3201 evaluation board embeds an ST-LINK/V2-1 debugger/programmer. The features supported on the ST-LINK are:

  • USB software re-enumeration
  • Virtual com port interface on USB connected to PB6/PB7 pins of the STSPIN32F0 (UART1)
  • Mass storage interface on USB
    The power supply for the ST-LINK is provided by the host PC through the USB cable connected to the J5.
    The LED LD2 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 the target
  • Green ON: communication finished and successful
    The reset function is disconnected from the ST-LINK by removing the jumper J8.

Revision history

Table 6. Document revision history

DateRevisionChanges
12-Dec-201611Initial release.
23-Nov-20172Added Section 4.2: Current sensing on page 7.
27-Feb-20183Minor modifications throughout the document.
18-Aug-20214Minor template correction.

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 acknowledgment. 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. 

IMPORTANT NOTICE – PLEASE READ CAREFULLY

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

Documents / Resources

ST UM2154 STEVAL-SPIN3201 Advanced BLDC Controller with Embedded STM32 MCU Evaluation Board [pdf] User Manual
UM2154, STEVAL-SPIN3201 Advanced BLDC Controller with Embedded STM32 MCU Evaluation Board

References

Leave a comment

Your email address will not be published. Required fields are marked *