system in package stspin32f0 3-phase controller with mcu · 2016. 11. 18. · in fact tim1 can be...

36
System In Package STSPIN32F0 3-phase controller with STM32F0 Technical training

Upload: others

Post on 31-Mar-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

System In Package

STSPIN32F0

3-phase controller with STM32F0

Technical training

Page 2: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Designed for 3-phase BLDC applications

• FAN, vacuum cleaner

• Drones

• Power Tools

• Home appliances

• Robots

• Key points:• Small size 7x7 package

• Field Oriented Control 1 shunt/3 shunt

Page 3: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

STSPIN32F0 Block Diagram

STM32

PC13

PC14

PC15

PF0

PF1

NRST

PA2

PA3

VSSA

PA0

PA1

VDDA

PF7

PF6

PA13

PA12

PA11

PA10

PB12

PA9

PA8

PB14

PB13

PB15

VB

AT

VD

D

VSS

PB

9

PB

4

PB

8

BO

OT0

PB

6

PB

5

PA

15

PA

14

PB

7

PB

3

HS

LS

HS

LS

HS

LS

Gate

Driver

Co

ntro

lLogic

VR

EF

VR

EF

VR

EF

3FG HallDecoding Logic

AD

J REF

6

3.3V

PF0

PF1

NRST

PA2

PA3

VDDA

PA0

PA1

PA

5

TESTM

OD

E

PA

4

PB

1

PA

6

3FG

_PA

7

OP

4P

OP

4O

OP

4N

OP

3P

OP

3O

OP

3N

OP

2P

OP

2O

OP

2N

OP

1P

OP

1O

OP

1N

OC

Co

mp

GN

D

OC_SEL

OC comp threshold select

control

DC/DC Buck conv

3.3V VM

12VVREG

VM

VREG12 VREG12

VREG12

VREG12

VREG12

VREG12

VREG12

2

3FG_HiZ

HSU

OUTU

LSU

HSV

OUTV

LSV

HSW

OUTW

LSW

VBOOTU

VBOOTV

VBOOTW

PB

7

PA

14_SWD

_CLK

VD

D

PB

6

PA

13_SWD

_IO

VM

SW

VR

EG12V

CO

MP

CO

MP

CO

MP

CO

MP

OPA

MP

OPA

MP

OPA

MP

OPA

MP

PA

4

PA

5

PA

6

PA

7

PB

0

PB

1

PB

10

PB

11

PB

2

VSS

VD

D

connecte

d

to E

PAD

toVD

DA

Page 4: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

STSPIN32F0 – Main features

• Operating voltage from 8 to 45 V

• Three phase gate drivers

• 600 mA sink/source current capability

• Embedded bootstrap diode

• Interlocking protection

• Embedded STM32F031x6x7

• 3.3 V buck converter

• 12 V LDO linear regulator

• 4x Operation Amplifiers

• Comparator for over-current protection

• Analog Hall sensor decoding with 3FG open-drain output

• UVLO protection on all supply voltages

• Internal over-temperature shut down

Page 5: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

STSPIN32F0 – Pinout

7 mm

7 mm

Page 6: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Embedded STM32F031

Page 7: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

STM32F031x6x7 MCU characteristics

• Core: ARM® 32-bit Cortex ® -M0 CPU, frequency up to 48 MHz

• Memories: 4kB of SRAM, 32 kB of Flash Memory

• CRC calculation unit

• Up to 16 fast I/Os

• Advanced-control timer dedicated for PWM generation

• Up to 5 general purpose timers

• 12-bit ADC (up to 9 channels)

• Communication interfaces: I2C, USART, SPI

• Serial Wire Debug (SWD)

• Extended temperature range: -40 to 125°C

Page 8: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Internal connections

An

alo

g IC

ST

M3

2VDD

VBAT

PB12

PB13

PB14

PB15

PA8

PA9

PA10

PA11

PA12

PA13

PF6

PF7

PA7

V3V3_1

V3V3_2

OC_COMP_OUT

LS1

LS2

LS3

HS1

HS2

HS3

OC_SEL

3FG_HIZ

OC_TH_STBY2

OC_TH_STBY1

3FG_OUT

VDDA

PA7/3FG SWDIO

BOOT0 VSS\VSSA

GND/EPAD GND/EPAD

GND

VDDA VDD

SWDIO_INT

SYS_SWDIO

Page 9: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Internal connections

Some GPIOs of the STM32F0 are directly connected to the Analog IC.

For this reason it is mandatory to properly setup these GPIOs at the very

beginning of the MCU initialization.

STM32 Pin Analog IC Function and notes

PA7 3FGOUTWhen 3FG_HIZ is low, PA7 can be set in any mode

When 3FG_HIZ is high, PA7 must be set as input

PB12 OC_COMP_INT Input TIM1_BKIN

PB13 LS1 Output Push-Pull TIM1_CH1N

PB14 LS2 Output Push-Pull TIM1_CH2N

PB15 LS3 Output Push-Pull TIM1_CH3N

PA8 HS1 Output Push-Pull TIM1_CH1

PA9 HS2 Output Push-Pull TIM1_CH2

PA10 HS3 Output Push-Pull TIM1_CH3

PA11 OC_SEL Output Push-Pull

PA12 3FG_HIZ Output Push-Pull

PF6 OC_TH_STBY2 Output Push-Pull

PF7 OC_TH_STBY1 Output Push-Pull

NOTE: Input configuration is always allowed. All the Analog IC inputs integrates a

pull-down resistor.

Page 10: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Advanced-control timer – TIM1

The Advanced-control timer (TIM1) is a 16-bit auto-reload

up/downcounter with a 16-bit prescaler.

In the device TIM1 is reserved to the interfacing between the STM32F0

IC and the gate driving inputs of the Analog IC.

In fact TIM1 can be seen as a three-phase PWM multiplexed on six

channels. It has complementary PWM outputs with programmable

inserted dead times.

STM32 pin Analog IC TIM1 In-application function

PB12 OC_COMP_INT BKINEmergency input forcing used-defined status of the

timer outputs (overcurrent protection).

PB13 LS1 Channel 1N PWM generation for phase U (low side driving)

PB14 LS2 Channel 2N PWM generation for phase V (low side driving)

PB15 LS3 Channel 3N PWM generation for phase W (low side driving)

PA8 HS1 Channel 1 PWM generation for phase U (high side driving)

PA9 HS2 Channel 2 PWM generation for phase V (high side driving)

PA10 HS3 Channel 3 PWM generation for phase W (high side driving)

Page 11: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

ADC channels

The device make available up to 9 ADC channels:

• Current sensing

• BEMF sensing

• VBUS monitoring

• TPCB monitoring

STM32 pin ADC channel

PA0 Channel 0

PA1 Channel 1

PA2 Channel 2

PA3 Channel 3

PA4 Channel 4

PA5 Channel 5

PA6 Channel 6

PA7 Channel 7

PB1 Channel 9

Page 12: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Hall sensors and encoder – TIM2

The general purpose timer TIM2 is

capable of handling quadrature

(incremental) encoder signals and

the digital outputs from 1 to 3 hall-

effect sensors.

It is based on a 32-bit auto-reload

up/downcounter and a 16-bit

prescaler.

STM32 pin TIM2

PA0 Channel 1

PA1 Channel 2

PA2 Channel 3

PA3 Channel 4

PA5 Channel 1 ETR

NOTE: TIM3 can also be used in Encoder mode, but not in Hall decoding mode.

Page 13: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Other timers

TIM3 TIM14 TIM16 TIM17

Counter 16bit up/down

with 16 bit

prescaler

16bit up with 16

bit prescaler

16bit up with 16

bit prescaler

16bit up with 16

bit prescaler

# of channels(*) 3 1 1 1

Timer Link Yes No No No

Complementary

output with dead

time generation

No No Yes Yes

Quadrature

encoder mode

Yes No No No

DMA Yes No Yes Yes

(*) All channels features input capture/output compare, PWM or one-pulse mode output

Page 14: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Other timers

STM32 pin TIM14

PA4\PB1\PA7 Channel 1

STM32 pin TIM16

PA6 Channel 1

PB6 Channel 1N

STM32 pin TIM3

PA6 Channel 1

PA7 Channel 2

PB1 Channel 4

STM32 pin TIM17

PA7 Channel 1

PB7 Channel 1N

Page 15: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Interfaces – USART

The device provides a complete

universal synch/asynchronous

receiver/transmitter which

communicates at speeds of up to 6

Mbit/s.

It supports a wide range of

communication protocols including

hardware management of CTS and

RTS

STM32 pin USART

PA0 CTS

PA1 RTS

PA2\PB6\PA14 TX

PA3\PB7 RX

PA4 CK

Page 16: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Interfaces – SPI

The device provides a SPI interface

communicating up to 18 Mbit/s in

master\slave and full\half duplex

modes.

The 3-bit prescaler gives 8 master

mode frequencies and the frame size

is configurable from 4 bits to 16 bits.

STM32 pin SPI

PA4 NSS

PA5 SCK

PA6 MISO

PA7 MOSI

Page 17: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Interfaces – I2C

The I2C interface can operate in

multimaster or slave modes. Standard

mode (up to 100 kbit/s), Fast mode

(up to 400 kbit/s) and Fast Mode Plus

(up to 1 Mbit/s) communication speeds

are available.

It supports 7-bit addressing and 10-bit

addressing. It also includes

programmable analog and digital

noise filters.

STM32 pin I2C

PB6 SCL

PB7 SDA

Page 18: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

External clock source

The embedded STM32F0 can operate

using as main clock source:

• The integrated RC 8 MHz oscillator

• An external clock source (OSC_IN)

ranging from 4 to 32 MHz

• An external crystal/resonator ranging

from 4 to 32 MHz

STM32 pin

PF0 OSC_IN

PF1 OSC_OUT

Page 19: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

External clock source

Page 20: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Analog IC

Page 21: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Analog IC characteristics

• Triple half-bridge gate drivers for N-channel power MOSFETs

• Integrated bootstrap diode to generate high side supply voltages

• Interlocking function: no high- and low-side outputs of same half bridge

simultaneously turned on

• 3.3 V DC/DC buck regulator

• 12 V LDO linear regulator

• 3FG open-drain output

• Operation Amplifiers for analog Hall Effect sensors decoding and

current sensing

• Comparator for over-current protection with adjustable threshold

• UVLO and OT protections

Page 22: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

3.3 V buck regulator

VM

VMVDDA SW

CVDD

LSW

VDD

3.3V DC/DC

Regulator

• Input supply voltage: VM = 8 to 45 V

• Provide the 3.3 V suitable to supply

the integrated MCU and other

external devices

• A soft-start function with fixed start-

up time

• Overcurrent and short-circuit

protection

• Embeds thermal protection

Page 23: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

3.3 V buck regulator

VDDOn

VDDOff

If during operation VDDA falls

below the VDDOff threshold, a new

soft-start sequence is started.

If at the end of the soft-start

sequence VDDA does not reach

the VDDOn threshold, the

sequence is restarted

Page 24: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

3.3 V buck regulator

A. In case of an

overcurrent/short failure

event on the SW pin, the

regulator is latched off.

B. To restart the DC/DC

regulator a power-down and

power-up cycle of device

supply voltage (VM) is

required.

VM

VMVDDA SW

CVDD

LSW

VDD

3.3V DC/DC

Regulator

A

B

Page 25: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

3.3 V buck regulator

It is possible to bypass the embedded 3.3 V buck regulator forcing the

VDD/VDDA voltage externally.VM

VDD

+

CDD

CMPOL

CM

10 kΩ

VDD VMSW

control

Buck conv.

3.3V

Page 26: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

12 V LDO linear regulator

• Provide the 12 V supply

voltage for gate drivers section

• UVLO protection

• Embeds thermal protection

12V LINRegulator

VM

VREG12V

CREG

VREG12

Page 27: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

12 V LDO linear regulator

VCC

+

VM

VR

EG

12

12V

LDO

VCC

NOTE: VCC

< 15 V

It is possible to bypass the embedded 12 V LDO linear regulator

connecting the VREG12 pin to VM, when VM is lower than 15 V.

Page 28: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Operational Amplifiers

OPxP

OPxO

OPxN OPAMP

to ADC

input

IN-

IN+

• 4x rail-to-rail operational amplifiers

suitable for signal conditioning:

• sensorless FOC

• manage Hall sensors feedback

• Output stage with fast recovery in

saturation condition

• Input offset voltage 1 mV @ 25°C

• Wide bandwidth 20 MHz

• Stable for gain ≥ 4 or -3

Page 29: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Over Current Comparator

• A comparator is available to perform an

over-current protection

• If OC_SEL pin is ‘HIGH’ the OC event is

acting directly on the control logic of gate

driver switching off all the outputs

• OC threshold adjustable

• Input offset voltage:

1 mV @ 25°C

• Propagation delay 80 ns

OC_TH_STBY1

(PF7)

OC_TH_STBY2

(PF6)

OC threshold

[mV]

0 0 (*)

1 0 100

0 1 250

1 1 500

(*) Device standby mode

Page 30: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Over Current Comparator

Safe mode: HS MOSFETs are forced off

Page 31: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

3FG output function

• The 3FG_PA7 pin have a different

function according the 3FG_HiZ

(PA12 from MCU) status:

• 3FG_HiZ = ‘0’: 3FG function

disabled (PA7 can be used as

output)

• 3FG_HiZ = ‘1’: 3FG decoding logic

output enabled (PA7 should be set

as input)

• The 3FG function is an open-drain

output. The 3FG signal is

generated from the analog Hall

Effect sensors feedback applied to

the Op Amp inputs.

Page 32: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

3FG output function

• The analog output of Op Amp is converted into a logic signal through

internal comparators (Vref = VDD/2) and provided to Hall decoding logic.

• The 3FG resulting output signal is an exclusive-or function of the three

Hall sensors

COMP4 output COMP3 output COMP2 output 3FG_PA7 pin

0 0 0 0

0 0 1 1

0 1 0 1

0 1 1 0

1 0 0 1

1 0 1 0

1 1 0 0

1 1 1 0

Page 33: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

UVLO and OT protections

BlockVM

UVLO

VDD

UVLO

VREG

UVLO

VBOOT

UVLO

Lin Reg

OT

DC/DC

Reg OT

DC/DC regulator OFF

Linear regulator OFF OFF OFF

Op Amps and OC Comp OFF OFF

HSU, HSV, HSW output LOW LOW LOW LOW (1)

LSU, LSV, LSW output LOW LOW LOW

• The device provides UVLO protections on each power supplies

• The device embeds an over temperature shutdown protection. The thermal

sensors are placed next to the DC/DC and linear regulator blocks.

• The table below summarize the UVLO and OT protection management

(1) Only the high side gate driver in UVLO condition

Page 34: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Gate drivers

• Triple half-bridge gate drivers for

N-channel power MOSFETs

• 600 mA Sink/Source capability

• Propagation delay 20 ns (typ)

• Matching time 20 ns

(max full temp. range)

• Integrated bootstrap diode

• Interlocking function

HS

LS

VREG12

VREG 12

HS x

OUTx

LSx

VBOO Tx

Page 35: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Gate drivers

Page 36: System In Package STSPIN32F0 3-phase controller with MCU · 2016. 11. 18. · In fact TIM1 can be seen as a three-phase PWM multiplexed on six channels. It has complementary PWM outputs

Application example