how to use the six-step brushless motor driver …...1 solution overview the steval-spin3204 motor...

23
Introduction The STEVAL-SPIN3204 three-phase brushless DC motor driver board is based on the STSPIN32F0B 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 How to use the six-step brushless motor driver evaluation board for applications based on the STSPIN32F0B BLDC controller UM2572 User manual UM2572 - Rev 1 - May 2019 For further information contact your local STMicroelectronics sales office. www.st.com

Upload: others

Post on 01-Apr-2020

77 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

IntroductionThe STEVAL-SPIN3204 three-phase brushless DC motor driver board is based on the STSPIN32F0B 3-phase BLDC controllerwith 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 orientedcontrol (FOC) and other advanced driving algorithms in the firmware, which can be downloaded onto the chip flash memory viathe board USB port.

The board is designed to help you test and develop motor control designs for applications such as power tools, homeappliances, fans and pumps, with a flexible evaluation platform that even allows you to toggle between external sensor andsensorless position feedback data methods.

Figure 1. STEVAL-SPIN3204 evaluation board

How to use the six-step brushless motor driver evaluation board for applications based on the STSPIN32F0B BLDC controller

UM2572

User manual

UM2572 - Rev 1 - May 2019For further information contact your local STMicroelectronics sales office.

www.st.com

Page 2: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

1 Solution overview

The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motorbased on position feedback data from one of the following sources:• external quadrature encoders or Hall Effect sensors• on-board circuitry that senses the back electromotive force (BEMF) generated by the load motor.

Figure 2. STEVAL-SPIN3204 motor control block diagram

OC compthresholdselect

DC/DC Buck conv

Seria

l Wire

Deb

ugSWVM

STM32F031 MCU

OC_SEL

control

OC

_CO

MP

Gate Driver Control Logic

12V VREG

VREG12

VM

3.3V

RHS

OUT

LS

VBOOT

3x Power Half-bridge

GH

R

VBUS

GL

HS

LS

BEMFcircuit

VDD

GPIO_BEMF

STSW-SPIN3204motor control

Firmware

STM32F103CBLDO regulator

LD3985

ESD protection

USBLC6-23V3_STLINK

USB Type B Mini MCU

STSPIN32F0BBLDC

controller

ST-LINK/V2-1programming interface

THREE-PHASEBLDC MOTOR

← Hall or encoder →

STEVAL-SPIN3204evaluation board

OPAMP

The power stage on the board delivers 15 ARMS DC current from three STD140N6F7 MOSFETs in half-bridgeconfiguration 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 isamplified, filtered and forwarded to the STSPIN32F0B BLDC controller MCU and control logic gate driver formonitoring and peak current limitation or overcurrent protection, depending on the driving method implemented inthe firmware (voltage mode or current mode, respectively). Voltage sensing is implemented through a voltagedivider 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 themotor controller firmware.

1.1 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

UM2572Solution overview

UM2572 - Rev 1 page 2/23

Page 3: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

• 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

1.2 Hardware user interfaceSTEVAL-SPIN3204 motor control evaluation board has the following interfaces:• User button 1 (SW2), which can, for example, 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), which can, for example 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, for example, 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.– red-green LED (LD1) signals programming activity

UM2572Hardware user interface

UM2572 - Rev 1 page 3/23

Page 4: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

1.3 STSPIN32F0B advanced single shunt BLDC controller with embedded STM32MCU

1.3.1 BLDC motor controller descriptionThe STSPIN32F0B is a System-In-Package providing an integrated solution suitable for driving three-phasebrushless 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 (sinkand source). The high- and low-side switches of same half-bridge cannot be simultaneously driven high thanks toan integrated interlocking function.An internal DC/DC buck converter provides the 3.3 V voltage suitable to supply both the MCU and externalcomponents. An internal LDO linear regulator provides the supply voltage for gate drivers.The integrated operational amplifier is available for the signal conditioning, e.g. the current sensing across theshunt resistor.A comparator with a programmable threshold is integrated to perform the overcurrent protection.The integrated MCU (STM32F031C6 with extended temperature range, suffix 7 version) allows performing field-oriented control, the 6-step sensorless and other advanced driving algorithms. It has the write-protection andread-protection feature for the embedded Flash memory to protect against unwanted writing and/or reading. It ispossible to download the firmware on-the-field through the serial interface thanks to the embedded bootloader.The STSPIN32F0B device also features overtemperature and undervoltage lockout protections and can be put inthe standby mode to reduce the power consumption. The device provides 20 general-purpose I/O ports (GPIO)with the 5 V tolerant capability, one 12-bit analog-to-digital converter with up to 9 channels performingconversions in a single-shot or scan modes, 5 synchronizable general-purpose timers and supports an easy touse debugging serial interface (SWD).

UM2572STSPIN32F0B advanced single shunt BLDC controller with embedded STM32 MCU

UM2572 - Rev 1 page 4/23

Page 5: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

1.3.2 STSPIN32F0B block diagrams

Figure 3. STSPIN32F0B System-In-Package block diagram

STM

32F0

31

PC13

PC14

PC15

PF0

PF1

NRST

PA2

PA3

VSSA

PA0

PA1

VDDA

PF7

PF6

PA13

PA12

PA11

PA10

PB12PA

9PA

8

PB14

PB13

PB15

VBATVDD

VSSPB9

PB4

PB8BOOT0

PB6PB5

PA15PA14

PB7

PB3

HS LS HS LSHS LSGate Driver

Control LogicADJ REF

6

3.3V

PF0

PC15

PC14

PF1

NR

ST PA2

PA3

VDD

APA

0PA

1

PA5

TEST MODE

PA4

PB1

PA6PA7

OP1P

OP1OOP1N

OC_COMP

GND

OC_S

EL

OC co

mp

thre

shol

d se

lectco

ntro

l

DC/D

C Bu

ck co

nv

3.3V

VM

12V

VREG

VM

VREG

12VR

EG12

VREG

12

VREG

12

VREG

12

VREG

12

VREG

12

2

HSU

OU

TU

LSU

HSV

OU

TV

LSV

HSW

OU

TW

LSW

VBO

OTU

VBO

OTV

VBO

OTW

PB7

PB9PB8

PA14_SWD_CLK

VDD

PB6

PA15

BOOT0

PA13_SWD_IO

RESERVED

VM

SW

VREG 12VCOMP

OPAMP

PA4PA5PA6PA7PB0PB1

PB10PB11

PB2

VSSVDD

connected to EPAD

to VDDA

RESERVED

RESERVED

UM2572STSPIN32F0B advanced single shunt BLDC controller with embedded STM32 MCU

UM2572 - Rev 1 page 5/23

Page 6: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

Figure 4. Analog IC block diagram

VDD

OC_COMP_INT1

HS3HS2HS1

LS2LS3

LS1

OC_TH_STBY1OC_TH_STBY2

OC_COMP_INT2

SWDIO_INT

OC_SEL

VRESERVED

DD_3V3

TEST MODE

OP1P

OP1OOP1N

OC Comp

GND

HSU

OUTU

LSU

HSV

OUTV

LSV

HSW

OUTW

LSW

VBOOTU

VBOOTV

VBOOTW

PA13_SWD_IO VM SW

VREG 12V

HS

LS

HS

LS

HS

LS

Gate Driver Control Logic

ADJ REF

6

3.3V

OC_SEL

OC comp threshold select

control

DC/DC Buck conv

3.3V VM

12V VREG

VM

2

COMP

OPAMP

VREG12 VREG12

VREG12

VREG12

VREG12

VREG12

VREG12

RESERVEDRESERVED

1.4 Overcurrent protectionWhen the jumper J11 is closed in the 1-2 position, the board is set to use the current sensing for implementing theovercurrent protection.Load current is forwarded to comparator input according to following formula:VOCCOMP = Iload × Rsℎunt × GOPAMP = Iload × 10mΩ × 3.125 (1)

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 in one of the following ways:• Using the protection circuitry integrated in the analog section of the STSPIN32F0B SiP; this feature is

enabled by setting the OC_SEL input (PA11) high.• Using the TIM1_BKIN input.

UM2572Overcurrent protection

UM2572 - Rev 1 page 6/23

Page 7: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

1.5 Current mode driving (current limiter)When the jumper J11 is closed in the 2-3 position, the board is set to use the current sensing to implement anadjustable current limiter.The target of the current limiter depends on the duty-cycle (DC) of the PWM on PA6 GPIO and the comparatorinternal comparator threshold (VOCCOMPth):Ilimit = VOCCOMPtℎ− VDD × DC × GREFRsℎunt × GOPAMP = VOCCOMPtℎ− 3.3V × DC × 0.15610mΩ × 3.125 (2)

The VOCCOMPth is set through the PF6 and PF7 GPIOs of the embedded MCU.

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

0

2

4

6

8

10

12

14

16

18

0% 10% 20% 30% 40% 60% 70% 80% 90% 100%50%

I

500 mV

limit

[A]

Duty Cycle

250 mV 100 mV

The current limiter can be implemented in two ways:• Using the protection circuitry integrated into the analog part of the STSPIN32F0B SiP; this feature is enabled

setting the OC_SEL input (PA11) high.• Using the TIM1_ETR input.

1.6 Hall effect sensors and Quadrature encoderThe STEVAL-SPIN3204 evaluation board supports digital Hall sensors and quadrature encoder motor positionfeedback. The sensors can be connected to the STSPIN32F0B by closing jumpers JP5, JP6 and JP7.

Note: When JP5, JP6 and JP7 for Hall/encoder sensing are closed, ensure that JP8, JP9 and JP10 for BEMF sensingare open.The Hall sensors/encoder should be connected to J4 as shown in the following table.

UM2572Current mode driving (current limiter)

UM2572 - Rev 1 page 7/23

Page 8: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

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 andconnected to the VDD voltage. On the same lines, a footprint for pull-down resistors is also available (R59, R60and R61).The jumper JP3 selects the supply line for the sensor:• Jumper between 1-2 pins: sensors powered by VUSB (5 V)• Jumper between 2-3 pins: sensors powered by VDD (3.3 V)

1.7 Programming and debugging the STSPIN32F0B motor controllerThe STEVAL-SPIN3204 evaluation board embeds an ST-LINK/V2-1 debugger/programmer, with the followingfeatures:• USB software re-enumeration• Virtual com port interface on USB connected to PB6/PB7 pins of the STSPIN32F0B (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 board.The red-green LED LD1 provides the following 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.

UM2572Programming and debugging the STSPIN32F0B motor controller

UM2572 - Rev 1 page 8/23

Page 9: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

2 Get started with the board

2.1 Safety informationCaution: 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 with materials releasing smoke when heated.• After operation, allow the board to cool down before touching it.

2.2 How to set up and use the boardUsing the STEVAL-SPIN3204 evaluation board requires the following items in order 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.• The STSW-SPIN3204 firmware.• A three phase brushless DC motor with compatible voltage and current ratings• An external DC power supply

Step 1. Check the jumpers according to the target configurations.

Figure 6. J11 gate driving modes

Current modeJ11 closed 2-3J11 closed 1-2

Voltage mode

Step 2. Connect the motor to the connector J3.Be sure to connect the phase wires correctly.

UM2572Get started with the board

UM2572 - Rev 1 page 9/23

Page 10: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

Figure 7. J3 phase wire connections

U

V

W

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

VM

GND

Step 4. Connect the board to the PC through the USB cable.

Figure 9. J5 USB connection

USB

Step 5. Develop your application using the code examples provided.The STSW-SPIN3204 firmware example also provides pre-compiled binaries that are ready to be used.

UM2572How to set up and use the board

UM2572 - Rev 1 page 10/23

Page 11: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

RELATED LINKS 3 Hardware description and configuration on page 12

UM2572How to set up and use the board

UM2572 - Rev 1 page 11/23

Page 12: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

3 Hardware description and configuration

Figure 10. Jumper and connector positions1. RESET button2. USER 2 button and LED3. USER 1 button and LED4. Boot mode jumper5. Motor connector6. Power supply connector7. Current limiter/Overcurrent selector8. BEMF sensing/Sensor feedback jumpers9. VM LED10. Potentiometer11. VDD LED12. Hall effect sensor and encoder connector13. ST-LINK LED14. USB connector

1 2 3

4

5

6

78

910

11

12

13

14

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 STSPIN32F0B 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, JP7Connects PA0/PA1/PA2 to the inputs of J4 connector (Hall-effect sensors and encoder for motorposition feedback).

When these jumpers are closed, jumpers JP8/JP9/JP10 must be open.OPEN

UM2572Hardware description and configuration

UM2572 - Rev 1 page 12/23

Page 13: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

Jumper Permitted configurations Default

JP8, JP9, JP10Connects PA0/PA1/PA2 to the BEMF sensing circuitry (sensorless operation).

When these jumpers are closed, jumpers JP5/JP6/JP7 ones must be open.CLOSED

J8 Connects the STSPIN32F0B reset input to the ST-LINK. CLOSED

J9 Pulls-up the BOOT0 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 PB8 GPIO

2 PB9 GPIO

3 PC14 GPIO

4 PC15 GPIO

5 PB1 GPIO

6 PA5 GPIO

7 PA3 GPIO

8 Ground

J21 8-45 V Motor supply voltage (VM)

2 GND Motor supply ground

J3 1 - 2 - 3 U, V, W Motor phase connections

J4

1 HALL1/A+Hall effect sensor 1 signal

Quadrature encoder A signal

2 HALL2/B+Hall effect sensor 2 signal

Quadrature encoder B signal

3 HALL3/Z+Hall effect sensor 3 signal

Quadrature encoder index/zero signal

4 VDD Hall sensors/encoder supply

5 GND Ground

J5 - J5 Mini-B USB input

J6

1 3V3 ST-LINK supply voltage

2 CLK SWCLK of ST-LINK MCU (for recovery only)

3 GND GND

4 DIO SWDIO of ST-LINK MCU (for recovery only)

J71 RX Virtual COM RX line

2 TX Virtual COM TX line

J101 I/O Bootloader UART RX

2 CLK Bootloader UART TX

TP1 - VREG 12 V linear voltage regulator output of STSPIN32F0B

TP2 - GND GND

TP3 - VDD 3.3 V buck converter output of STSPIN32F0B

TP4 - SPEED Speed potentiometer output

UM2572Hardware description and configuration

UM2572 - Rev 1 page 13/23

Page 14: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

Name Pin Label Description

TP5 - 5V USB supply voltage

TP6 - VBUS Bus voltage feedback

TP7 - OUT_U Power stage output U

TP8 - TP8 Low pass filtered PB1 GPIO

TP9 - TP9 SWCLK of STSPIN32F0B

TP10 - GND GND

TP11 - OUT_V Power stage output V

TP12 - TP12 GPIO BEMF

TP13 - OUT_W Power stage output W

TP14 - 3V3 ST-LINK supply voltage (3.3 V)

TP15 - TP15 Current sensing OPAMP output

TP16 - TP16 SWCLK of STSPIN32F0B

UM2572Hardware description and configuration

UM2572 - Rev 1 page 14/23

Page 15: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

4 Schematic diagrams

Figure 11. STEVAL-SPIN3204 schematic - motor controller MCU and interfaces

EPAD

PF1

45

33

3

3

1

OPEN

JP1

OUTW

VREG126

LSU

PA5

PA3

VM

9

PB6

L122uH

C1

100 nF50VX7R

27

OP1

P

VDD

21 23

1

SWD

_CLK

PB9

PA6

15

PA13

6

4

TP3S1751-46R VBOOTV

PB7

1

48

PA6

1

PB1

3

TP4S1751-46R

PA2

R2010 K

PA4

VREG

16

2

2

C63.3 nF

PB8

PA5

2

LSV 31

VDDA

1

PA3C10

47 uF6.3VX5R

7

J1061300211121

GN

D

2

SW2

430483025816

R6100K

PA5

R5120 R

PB1

DL3YELLOW

HSU

LSW

C191 nF50VX7R

14

PB1

TP8S1751-46R

19

PB9

TP2S1751-46R

PA32

241

1

3

24

C3220 nF

100VX7R

OC

CO

MP

PC15

PC14

8

C121 nF

44

13

PF1

RESERVED

PA2

C222 uF63V

3

PA1

VDD

20

PC14

R1910 K

1

R139 K

VDD

TEST

MO

DE

C5100 nF50VX7R

OP1

N

26

UAR

T1_T

X

3

OUTV

4

OUTW

J1

61300811121

OP1

O

PC14

LSW

+

28

LSV

TP1S1751-46R

12

29

PF0

34

VDD

1PC15

OUTU

PB1

HSV

PA7

8

VDD

SW3

430483025816

25

18

+ 42

VM

C4

10 uF25V

1

BOO

T0

PA15

301

SWD

_IO

VBOOTW

PA15

1

PA1D1STPS0560Z

PA0

HSV

46

NRST

LSU

OUTU

RESET

USER1

43

PA4

R14

0 R

2

SW

DL1RED

22

OUTV

5

VDD

40 38

UAR

T1_R

X

PA14

39

NRST

C8100 nF

11PA0

J9

61300211121

HSW

C144.7 nF

R2

100 R

PF0

DL4YELLOW

2

U1STSPIN32F0B

BOURNS3386G-1-104LF

GPI

O_B

EMF

SPEED

HSU

2

PB9

PA3

32

R7

100 R

VDD

C11100 nF50VX7R

OP1

P

C7 100 nF

37SW

D_C

LK

4

R4120 R

SW1

430483025816

R3330 R

PB8

RES

ERVE

DPF0

4

C9100 nF

VBOOTU

4

1

RES

ERVE

D

C131 nF

35

10

5

47

HSW

1

PB8

JUMPER3

PA15

R34

10 K

OC

CO

MP

OP1

O

PC15

VDD

36

17 1

VDD

7

OP1

N

NRST

PF1

R1310 K

R8

100 R

USER2

UM

2572 - Rev 1

page 15/23

UM

2572Schem

atic diagrams

Page 16: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

Figure 12. STEVAL-SPIN3204 schematic - power stage and external sensor inputs

C16

220 uF

R35

10 R

R260.02 R

1

63V

J3

691213510003

2

00000

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0 M6

OPTICAL_TARGET

R270.02 R

C22

10 pF

R60NP

D3

1N4148WS

R581 K

C38

NP

R49

680 ROUTU

1R42

62 R

2

M8

GZ_rev2

R57 1 K

M1

HOLE_3.2MM_6

63V

1

1

2

0000

0 0 0 0

0 0 0 0

0 0 0 0

D6

1N4148WS

NP

VBUS

N2

D7

1N4148WS

LSV

R5410 K

JUMPER1

+

2

DL2RED

2

CLOSE

JP2

0000

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

1

000

0 0 0

0 0 0

000

3

2

2

R5310 K

2

J2

691213510002

0000

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

VBUS

R56 1 K

R39

10 R

TP13S1751-46R

3

C24

10 pF 1

000

0 0 0

0 0 0

000

R18

62 R

3

1

PA2

00000

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

1

TP7S1751-46R

3

LSU

PA0

00000

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

D8

1N4148WS

1

1

HSW

2

R5510 K

2

N1R23

62 R

J4

61300511121

R22

10 R

2

R36

62 R

+

1

C39

TP10S1751-46R

VBUS

C25220 nF100VX7R

OPENJP5

VM

Q3N-MOS

OUTW

R48

680 R

R31

10 R

1

Q5N-MOS

C40220 nF

100VX7R

Q2N-MOS

Q4N-MOS

Q1N-MOS

PA1

R59NP

OPENJP7

TH Mounting option12.50 mm dia - 5 mm pitch

VBUS

1

1

1

M3

HOLE_3.2MM_6

D5

1N4148WS

3

VDD

OUTV

M5

OPTICAL_TARGET

R40

62 R

HSU

3

SENSEP

1

M7

OPTICAL_TARGET

R61NP

1

TP11S1751-46R

3

SENSEN

VUSB

Digital Hall/Encoder

C41220 nF100VX7R

00000

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

2

R41

10 R

3

LSW

R17

10 R

M4

HOLE_3.2MM_6

1

VDD

3

4

JP361300311121

C17

220 uF

R32

62 R

OPENJP6

2

+

0000

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

Q6N-MOS

D4

1N4148WS

JUMPER Connected between JP3-1 & JP3-2

HALL1/A+HALL2/B+HALL3/Z+

VDDGND

00000

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

R11680 R

+

2

M2

HOLE_3.2MM_6

HSV

C23

10 pF

5

UM

2572 - Rev 1

page 16/23

UM

2572Schem

atic diagrams

Page 17: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

Figure 13. STEVAL-SPIN3204 schematic - current and voltage feedback, and BEMF sensing circuits

1

C4268 pF

R12

D11BAT30KFILM

D12BAT30KFILM

R29

2.4 K

OC Comp

1PA0

JUMPER4

9.31 K

7.5 K

R46

10 K

2

J1161300311121

2

VDD

R44

4.7 K

TP15TPSMD-1MM

R33

2.4 K

R9

0 R

SENSEP

R1515 K

TP12TPSMD-1MM

PA6

D2BAT30KFILM

1

3

VBUSFeedback

D10BAT30KFILM

+

C45220 nF

-

+

C4468 pF

D14BAT30KFILM

VDD

2

VDD

R282.2 K

100 pFR751 K

OCCOMP

C21100 pF

PA5

VBUS

1

VDD

BEMF

R252.2 K

R47

10 K

PA1

-

OCOP1P

D13BAT30KFILM

1

_

OUTU

JP10

C15

R242.2 KC43

68 pFR16

OCREF

CLOSE

GPIO

PA2

OP1N

TP6TPSMD-1MM

R2115 K

PA4

D9BAT30KFILM

R10169K

R45

10 K

JP8

OUTV

SENSEN

OUTW

2

JP9

1OP1O

C184.7 nF

CLOSE

R74

2.2 K

CLOSE

1

UM

2572 - Rev 1

page 17/23

UM

2572Schem

atic diagrams

Page 18: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

Figure 14. STEVAL-SPIN3204 schematic - ST-LINK

18TP9

PA4

12

PC13-TAMPER-RTC

I/O1#1

U3

LD3985M33R

C26100 nF

PA214

R71 10 K

PB2/BOOT1

9

VUSB

24

U2

USBLC6-2SC6

35

PB7

STLINK_TX

6

39

C34

100 nF

FM_SWCLK

PA6

FM_SWDIO

PB10

44

A2

1

1

PB15

26

GNDC33

100 nF

NRST

SHELL

PA3

USB_VCC

PA10

C29100 nF

31

R64

1.5 K

TP5S1751-46R

VUSB

R67

100 R

4

OSCOUT/PD1

48

C20100 nF

U4

STM32F103CBT6

STLINK_RX

3V3_STLINK

INHIBIT

TP14S1751-46R

SHELL

R51

0 R

TP16

7OUT

7

BYPASS

19

A1

PB14

8

PA11

J5

65100516121

2T_NRST

VDD_1

3V3_STLINK

32

K1

36 VSS_1

3 USB_DP

17

5

VDD

PB4/JNTRST

3

R6636 K

40

PB9

2

PB11

I/O2#4I/O2#3

UART1_RX

Q7NPN

46

R50

0 R

ID

J861300211121

4

PB12

62

VBUS

1

R52

0 R

2

4

3V3_STLINK

PA15

USB_DM

2

3V3_STLINK PA7

T_JTMS

PA1

21

3738

NRST

43

13

R73

100 R

JUMPER2

C3610 pF

C3510 pF

25

16 PB5

R63 100 R

USBDM

OPENJP4

47

T_JTCK

BOOT0

T_JTCK

SWD_IOR694.7 K

2

I/O1#6

11

USB_RENUM

R30100 K

VSSA

2

PB8LED_STLINK

8

27

C28100 nF

R6510 K

23

29J6

61300411121

3

R374.7 K

41

PA8

T_NRSTPB0

1

29

1

SHELL

RX

D-

D+

SWDIO

VDD

R43

0 R

PA0-WKUP

42

33

VDD_2

GND

10

PB6

1

PA12

1

2

PC15-OSC32_OUT

4

R72 NP

4

30

20

3

1

15

USB_DM

OSCIN/PD0

1

C30

1 uF

R70

100 K

34

STLINK FW LOAD

VBAT

R62 100 R

C27100 nF

VSS_3

USB_RENUM

RED-GREEN

LD1

USB_DP

PA13

SWD_CLK

C37100 nF

13

T_JTMS

3V3_STLINK

PB13

1

K2

5

1

USB_GND

VIN

VUSB

3

LED_STLINK

28

PC14-OSC32_IN

PB1

C3210 nF

PA5

5

UART1_TX

3V3_STLINK

J761300211121

VDDA

PA14

C311 uF

5

VSS_2

T_JTCK

USBDP

R682.7 K

6

1

R384.7 K PB3/JTDO

45

VDD_3

SHELL

X1

8MHz

PA922

TX

UM

2572 - Rev 1

page 18/23

UM

2572Schem

atic diagrams

Page 19: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

Revision history

Table 6. Document revision history

Date Version Changes

06-May-2019 1 Initial release.

UM2572

UM2572 - Rev 1 page 19/23

Page 20: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

Contents

1 Solution overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2

1.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.2 Hardware user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.3 STSPIN32F0B advanced single shunt BLDC controller with embedded STM32 MCU . . . . . 4

1.3.1 BLDC motor controller description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.3.2 STSPIN32F0B block diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.4 Overcurrent protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.5 Current mode driving (current limiter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.6 Hall effect sensors and Quadrature encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.7 Programming and debugging the STSPIN32F0B motor controller . . . . . . . . . . . . . . . . . . . . . . 8

2 Get started with the board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9

2.1 Safety information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2.2 How to set up and use the board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 Hardware description and configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12

4 Schematic diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15

Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19

UM2572Contents

UM2572 - Rev 1 page 20/23

Page 21: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

List of figuresFigure 1. STEVAL-SPIN3204 evaluation board. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Figure 2. STEVAL-SPIN3204 motor control block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Figure 3. STSPIN32F0B System-In-Package block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Figure 4. Analog IC block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Figure 5. Current limiter peak value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Figure 6. J11 gate driving modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Figure 7. J3 phase wire connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Figure 8. J2 motor power supply. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Figure 9. J5 USB connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Figure 10. Jumper and connector positions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Figure 11. STEVAL-SPIN3204 schematic - motor controller MCU and interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Figure 12. STEVAL-SPIN3204 schematic - power stage and external sensor inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Figure 13. STEVAL-SPIN3204 schematic - current and voltage feedback, and BEMF sensing circuits. . . . . . . . . . . . . . . 17Figure 14. STEVAL-SPIN3204 schematic - ST-LINK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

UM2572List of figures

UM2572 - Rev 1 page 21/23

Page 22: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

List of tablesTable 1. Overcurrent thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Table 2. VOCCOMPth settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Table 3. Hall based sensors/Quadrature encoder connector (J4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Table 4. Hardware setting jumpers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Table 5. Connectors and test points description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Table 6. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

UM2572List of tables

UM2572 - Rev 1 page 22/23

Page 23: How to use the six-step brushless motor driver …...1 Solution overview The STEVAL-SPIN3204 motor control board can be set up to control a three-phase brushless DC (BLDC) motor based

IMPORTANT NOTICE – PLEASE READ CAREFULLY

STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and improvements to STproducts and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. STproducts 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 ofPurchasers’ 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 servicenames are the property of their respective owners.

Information in this document supersedes and replaces information previously supplied in any prior versions of this document.

© 2019 STMicroelectronics – All rights reserved

UM2572

UM2572 - Rev 1 page 23/23