Upload
phamdang
View
232
Download
1
Embed Size (px)
Citation preview
BLDC_basics.ppt 1
STMicroelectronics
ST7FMCxST7FMCx
BLDC MOTOR TRAINING PLANMCU A-P COMPETENCE CENTRE
JIANG JIAN GUO
Page 201 to 221
BLDC_basics.ppt 2
V22 ®
BLDC MOTORBLDC MOTOR
• BLDC MOTOR BASIC
• BLDC MOTOR PERIPHERAL
• BLDC START & DRIVE
• ST7FMC GUI & STARTER KIT
• BLDC MOTOR CONTROL LIBRARY
BLDC_basics.ppt 3
STMicroelectronics
ST7FMCxST7FMCx
BLDC Motor basics
BLDC_basics.ppt 4
V24 ®
Why The BLDC MotorWhy The BLDC Motor• Also called brushless Permanent Magnet DC (BLDC) or
synchronous DC motor
• Advantages : High efficiency (up to 98%)Variable speedSilent operationReliable/long life time (no brushes)High Power/ Size ratioHigh torque at start-upSame stator as Induction 3 phase motor
• Major applications (where above advantages are required): Compressor (air conditioner, refrigerator)Appliances (refrigerator, vacuum cleaner*, food processor*)Industrial fanAutomotive (fuel* and water*pumps, cooling fan*, climate control)
• Drawbacks:Overall system cost due to cost of electronic control
BLDC_basics.ppt 5
V25 ®
BLDC Synchronous Motor BLDC Synchronous Motor
• Synchronous : Stator flux and rotor mechanical rotation speed are same.
• Stator description : 3 phase winding (1 or 2 or more pairs of poles)
• Rotor description : Permanent magnet
• For 1 pair of pole : 1 electrical cycle (6 steps) = 1 mechanical cycle
South Pole
1
23
4
5 6
NS 1
23
4
5 6
NS
For p pair of poles 1 mechanical cycle = p electrical cycles
BLDC_basics.ppt 6
V26 ®
Why BEMF in a PMDC MotorWhy BEMF in a PMDC Motor
A
B C
ea
eb
ec
Neutral
(1) B-emf is the voltage induced in a winding by the movement of the magnet in front of this winding : e=dϕ/dt. It is independantof the energy supply to the motor (just by spinning by hand the rotor for example it is possible to generate back-emf).
BLDC_basics.ppt 7
V27 ®
Control BasicsControl Basics• To run efficiently a BLDC motor, the current in each winding must be in
phase with the b-emf (1) induced in this same winding by the rotation of the magnet (when this happens we “autocommutation”).
• If current and b-emf are not in phase, then the BLDC will not run efficiently or not run at all.
• To keep current and b-emf in phase, the current must be applied with the correct timing and therefore the position or the rotor (which determines the b-emf) needs to be known.
tcurrent
Back-EMF
BLDC_basics.ppt 8
V28 ®
Rotor Position DetectionRotor Position Detection• ControI efficiently a BLDC requires to know the position of the
rotor at all times. At least 2 common ways are available to know the rotor position.
By using Hall effect sensors which allow to read physically and precisely the rotor position (BLDC control with sensors). By reading the back-emf and deducting the rotor position from its reading (BLDC control without sensors). There are several methods available to monitor the back-emf. Most of them require 6 step mode current supply to the motor.
BLDC_basics.ppt 9
V29 ®
Drive Mode: 6 Step ModeDrive Mode: 6 Step Mode
2
T1 T1 T3 T3 T5 T5 T4 T6 T6 T2 T2 T4
1 2 3 4 5 6
t
t
t
A
B
C
Current in winding A,B,C
UVW
1
6
54
3
C
AT5
T6
T3 T1
T4 T2
B
+300V DC
-
+I
During one electrical cycle, there are 2 times when there is no current in the winding.During one electrical cycle there is always one winding biased in one direction and an other in the other direction.
BLDC_basics.ppt 10
V210
®
One pair pole motorOne pair pole motor
1
NS
A
B CT1-T4
2
NS
T1-T6
A
B 3
N S
A
B T3-T6
4
NS
A
B CT3-T2
5
NS
A
T5-T2B C 6
NS
A
B CT5-T4
Magnet of Rotor follow the statoric resultant flux
BLDC_basics.ppt 11
V211
®
Sensorless BEMF MeasurementSensorless BEMF Measurement
BUS
POWER GND
N
A
B
C
ea
eb
ec
Voltmeter
The Goal is to measure the voltage of not polarized winding
BLDC_basics.ppt 12
V212
®
State of the Art BLDC control method (A)State of the Art BLDC control method (A)
weaknesses: - Voltage dividers give reduced sensitivity & difficulty for low speed operation- Filtering is optimised for narrow speed range
300V
~
POWER GND
N
N'
+ 5V
divider & filter
BUS
~
POWER GND
N
BUS
~
POWER GND
N
N'
divider & filter
virtual ground
Fully analog method with many drawbacks.A virtual ground is created. The signal from it is divided and then filtered before enteringcomparator.The signal from the winding we want to measure b-emf from is also divided and filtered before entering comparator.This method implies to dimension components according to nominal point of operation of motor.
BLDC_basics.ppt 13
V213
®
State of the Art BLDC control method (B)State of the Art BLDC control method (B)
BUS
~
POWER GND
N
HV
~
POWER GND
N
+ 5V
divider & filter
divider & filterHV/2
During On state of PWM the neutral voltage value is equal to HV/2.We create a voltage reference equal to HV/2 on the second input of Voltage comparator
BLDC_basics.ppt 14
V214
®
State of the Art BLDC control methodState of the Art BLDC control method
Filtered voltageof rebuilt reference node N'
Filtered Phase voltage
Zero crossing event
filt1.hgl
Phase current
BLDC_basics.ppt 15
V215
®
ST Sensorless BLDC control methodST Sensorless BLDC control method
GND
A
BC
T1 PWM "ON"
T4 always ONbemf
300V
V/2
back-EMF whole signal sensinghigh sensitivity + large speed range + very low speed operation + starting with full torqueno filtering delayhigh signal to noise ratio
GND
A
B C
T1 PWM "OFF"
T4 always ONbemf
300V
GND+ 5V
voltage clamping
ST7MC
ABC
T5
T6
T3
T4
+300V DC
+IT1
T2
What happened before this chart : winding C has been demagnetised.The window of b-emf reading is now opened.Every time the T1 transistor is off, current flows in the free-wheeling diode and
voltage at point N is at ground. B-emf zero crossing can be monitored at T1 sampling frequency on the comparator output.The C voltage is clamped at +5V/-0.6V (but what we are interested in is around 0V) by the on-chip clamping diode.
BLDC_basics.ppt 16
V216
®
ST Sensorless BLDC control methodST Sensorless BLDC control method
End of demagnetisation End of demagnetisation
Back-EMF Back-EMF
Zero Crossing
Floating phase Floating phaseConducting phase
2 bemf detection : One for crossing coming from negative area, one for crossing coming from positive area.
BLDC_basics.ppt 17
V217
®
Sensorless PMDC, in current Mode
Sensorless PMDC, in current Mode
PMDC
MCIA
MCIB
MCIC
MCO5MCO4
MCO3
PB
MCO2MCO1MCO0
MCCFI
MCCREF
ST7MC
Vcc
L6386
HVGOUT
HIN
SD
SGND
LVG
PGND
LIN
L6386
HVGOUT
HIN
SD
SGND
LVG
PGND
LIN
L6386
HVGOUT
HIN
SD
SGND
LVG
PGND
LIN
300-400VDC input
6 steps output to PMDCB-emf input to ST7MC
5Volts High side outputs 15Volts High side outputs
Current limit input
Current sense
15V Low side outputs
5Volts Low side outputs
DC bus is sustained by electronic capacitor after the rectifier bridge.
BLDC_basics.ppt 18
V218
®
Control Principles of PMDC Maximum efficiency with delay manager
Control Principles of PMDC Maximum efficiency with delay manager
t
zero crossing detection times
back-EMF
t
switching timeof step n+1
current
C: commutationZ: zero CrossingD: end of demagnetization
D
Z
Z
image of ST7MC Motor control timer (MTIM)
CC
Delay
For a given speed, the best efficiency of the PMDC motor is when the current in a winding is in phase with the b-emf generated by rotation of the magnet in front of this same winding.The regulation process is going to be about keeping these 2 signals in phase.Zero crossing and end of Demagnetisation are physical events.The commutation is a calculated event (by the Motor control cell coprocessor), according to the delay the motor control cell wants to put.This delay is either computed from the value of the timer at the zero crossing (n) , or from the value of the timer at the zero crossing before (n-1). This is required for some types of motors (dissymmetrical motors) to avoid B-emf to be detected at different times. The choice between n and n-1 is done by SW.
BLDC_basics.ppt 19
V219
®
See Tutorial on Motors on
www.st.com/stonline/products/support/motor/tutorial/tutorial.htm
See Tutorial on Motors on
www.st.com/stonline/products/support/motor/tutorial/tutorial.htm
BLDC_basics.ppt 20
STMicroelectronics
ST7FMCxST7FMCx
BLDC Motor Peripheral
BLDC_basics.ppt 21
V221
®
Chronogram of eventsalways C -----> D -----> Z Chronogram of events
always C -----> D -----> Z
Timer
Z
C
t
D
DD
C C
Z Z
Step Time
Delay Time DemagnetizationTime
Motor Control Peripheral manages the three events always in the same order:Z generates C after real computed Delay then waiting for D event.Time between two consecutive Z event corresponds to Step time.Zero crossing and end of Demagnetisation are physical events.The commutation is a calculated event (by the Motor control cellcoprocessor), according to the delay the motor control cell wants to put.This delay is either computed from the value of the timer at the zero crossing (n) , or from the value of the timer at the zero crossing before (n-1).
BLDC_basics.ppt 22
V222
®
Main featuresMain features2 on chip analog comparators (BEMF Z. C. and current regulation)
7 selectable reference voltages + external reference7 selectable reference voltages + external reference
88--bit MTIM counter with 3 compare registersbit MTIM counter with 3 compare registers
Measurement window generator for BEMF zeroMeasurement window generator for BEMF zero--crossing detectioncrossing detection
Filter option for the zero crossing detectionFilter option for the zero crossing detection
AutoAuto--calibrated calibrated prescalerprescaler (16 division steps)(16 division steps)
8 x 8 bit multiplier8 x 8 bit multiplier
Sophisticated output managementSophisticated output management
BLDC_basics.ppt 23
V223
®
ST7MC MTC Macro CellST7MC MTC Macro CellMCIAMCIBMCIC
BEMF=0
MCO5MCO4MCO3MCO2MCO1MCO0
DELAY = WEIGHT x Zn
MCCFI0
MCCREF
NMCES
COMMUTE [C]
Int
(I) (V)
C (I)
DELAY MANAGER
CHANNEL MANAGER
BEMF ZERO-CROSSING DETECTOR
PWM MANAGER
[Z]
(V)
[Z] : Back EMF Zero-crossing eventZ n : Time elapsed between two consecutive Z events[C] : Commutation eventC n : Time delayed after Z event to generate C event(I): Current mode(V): Voltage mode
U, V, WPhases
Phase U
INPUT DETECTION
12-bit THREE-PHASE PWM GENERATOR
MCVREF
MCAOP
MCAON
MCPWMU
MCPWMV
MCPWMW
(V)
R 3PCN bit
MCAOZ/ MCCFI1
OAON bit
+
-CFAV bit
ADC
TACHO
or SPEED MEASURE UNIT (not represented)
=?
Ext
Vref
WEIGHT CAPTURE ZnMTIM
TIMER
Encoder Unit
MEASUREMENT WINDOW
GENERATOR
MODE
CURRENT (I)
VOLTAGE (V) PHAS
E
Phase U
Phase W
Phase V
12-bit counter
Vdd
R1
R2
The motor control Peripheral can be divided in four main block:* INPUT DETECTION: with a comparator, an input
multiplexer and an incremental encoder interface. It can work either as BEMF zero-crossing detector or as Speed Sensor Interface
* DELAY MANAGER: with an 8/16 bit timer and an 8x8 multiplier, which may work as a 8-bit delay manager or as Speed Measurement unit
* PWM MANAGER: including a measurement window generator, a mode selector and a current comparator
* CHANNEL MANAGER: with PWM multiplexer, polarity programming, dead time insertion and high frequency chopping capability and emergency HiZ configuration input
BLDC_basics.ppt 24
V224
®
PHASE INPUTBlock Diagram for Z & D Hard events
PHASE INPUTBlock Diagram for Z & D Hard events
* use preload register
MCIA00
01
10
+
-D Q
CP
VI
12-bit PWM generator Signal U
Sampling frequency
Sample
CS,H
DS,H
MCRA b3 VOC1 bit
Inputn Sel Reg IS[1:0]
CS,H
MPHST * b7-b6
MCIB
MCIC
MCVREF
VREF
MCRC b2-b0VR[2:0]
111
MCRC b3MCONF b[7-4]
SPLG bitDS[3:0] bits
Phase A
Phase B
Phase C
12
1
2
DWF[3:0]
MDFR b3-b0
ZWF[3:0]
MZFR b3-b0
SR bitMCRA b5
SCF[1:0]MSCR b3_b2
fSCF
IS bit allow to select the PHASE to be read, they are accessible by MPHST preload register.VR bit set the Voltage reference for all analog input signal.The sampling clock is dependant of Polarization Mode (Voltage or Current) in sensorless wiring for zero_crossing detection: internal clock in current mode and timer U in voltage mode.In sensor mode and during the demagnetization behaviour the sampling clock frequency is set by SCF bit in MSCR register.The VOC1 bit selects the polarization (current or voltage mode)MCIi inputs are the analog voltage inputsIn sensorless mode, the sampling frequency is the PWM clock signal frequency or fSCF Frequency depending of the Sampling selection done by SPLG, DS and SCFBits.Voltage reference can be select from 0.2V to 3.5V or external.
BLDC_basics.ppt 25
V225
®
PHASE INPUTD event Generation Mechanism
PHASE INPUTD event Generation Mechanism
DSDH
HDMSDM
F(X) D = DH & HDM + DS & SDM
DS
DH
8
MTIM (8-bit Up Counter)
MDREG
Compare
SDM *
MCRB b4
DWF [3:0]MDFR b3-b0
* use preload registerRegister Register updated on R event
MCRB b6 MCRB b5
D H
or1
2
D S,H
Sample
SR
MCRA b5
CPB*
To Z detection
*HDM
C S,H
DEF [3:0]
MDFR b7-b4
WARNING 1:If HDM and SDM bits are both set, the first event that occurs, triggers a demagnetization event. For this to work correctly, a Ds event must not precede a Dh event because the latter could be detected as a Z event.
WARNING 2:Due to the alternate automatic capture and compare of the MTIM timer with MDREG register by DH and by DS events, the MDREG should be manipulated with special care.
WARNING 3: In soft demagnetization Mode (SDM=1), the value written in MDREG is checked by hardware with MTIM timer after one C event. If it results less or equal to MTIM, the software demagnetization event is immediately generated and MTIM value overwrites the value in MDREG register.
BLDC_basics.ppt 26
V226
®
D Event FilterD Event Filter
MCDEM debug
Phase Current
Phase Voltage
C D
10 µs Blanking Window
0.6V for MCVREF
Event counter avoidto get wrong information
BLDC_basics.ppt 27
V227
®
Z Event FilterZ Event Filter
MCZEM debug
Phase Current
Phase Voltage
CZ
0.6V for MCVREF
Z Event counterWait for 4 samplings higher than MCVREFat PWM frequency
Zoom
BLDC_basics.ppt 28
V228
®
PHASE INPUTProtection on Z H event
PHASE INPUTProtection on Z H event
SamplingClock
PhaseComparator
Rz
D Q
CP Q
R
S
D Q
CP Q
R
S
D Q
CP
F
D
Pz bit
V
I
C
Fz
C
Fz
Fz = (ZVD.CPB) + (ZVD.CPB)Rz = (ZVD.CPB) + (ZVD.CPB)
Rz
Reset on C
Set on C
Instantaneous Edge
Z
MCRA b1
We can select this protection to implement a transition chronology on event to validate the ZH event.If Pz is validated the Z event filter(ZEF[3:0]) is ignored
BLDC_basics.ppt 29
V229
®
PHASE INPUTZVD and CPB level SelectionPHASE INPUT
ZVD and CPB level Selection
CPB Event generation versus input data sampledFilter Filter
C Z
Filter Filter
C Z
Filter Filter
C Z
Filter Filter
ZDH
0 0
0
0
1
1
11
ZVD
DH
DH
DH
With ZVD and CPB we can select the level of both End of demagnetizationand zero-crossing event, if they are with same level or with opposite level for both level high or low.The two first cases are when D and Z are in opposite transitions.The two last cases are when Z and D have the same transition.In our case, Z and D event are always in opposite transition.
BLDC_basics.ppt 30
V230
®
DELAY MANAGER (1)DELAY MANAGER (1)
DELAY = WEIGHT x Zn/256Or
DELAY = WEIGHT x Zprv/256
WEIGHT Capture Zn
= ?
TIMER
Commute (C)
Yes
Zn Time between two last consecutive Z events
C Commutation event
Capture Zprv
Zprv Time between two previous consecutive Z events
When a Z event occurs, the system catches the Timer value (reset at a Z event in autoswitched mode) and computes the next commutation time (the delay). When the timer will reach this value, the C event will occur.We can compute the delay on the actual Z event value or on the previous one (Z previous). It depends on the motor type. For dissymmetrical motors, we compute the delay with the Z previous value.
BLDC_basics.ppt 31
V231
®
DELAY MANAGER (2)DELAY MANAGER (2)
Register
Register updated on R event
MWGHT
A x B / 256
CH/CS
DCB bit
SWA=1 & SC=0
Compare
ZH
8
88
nn-1
8
MTIM [ 8- bit Up Counter]
MZREG [ ZN]
MZPRV [ Z N - 1]
MCOMP Reg [ C N+1]
MCRA b2
MCRA b0
MCRC b4
ZH/Zs
All datas in the preload registers are transferred in the corresponding active registers at the CH or CS event. SWA bit:=0 we are in switched mode MCOMP contain the step durationSWA bit =1 we are in autoswitched mode MCOMP contain result of delay computation in CH or the CS simulated commutation value.DCB bit selects the delay computation on Zn or Z previous.Delay is loaded in the MCOMP register.
BLDC_basics.ppt 32
V232
®
CLOCK AND TIMER OVERVIEWS (1)CLOCK AND TIMER OVERVIEWS (1)
0.2404.17s0.1781.40s1111
0.4792.08s1.43697ms1110
0.9581.04s2.87349ms1101
1.92522ms5.74174ms1100
3.83261ms11.487ms1011
7.66130ms22.943.6ms1010
15.465.2ms45.921.8ms1001
30.732.6ms91.910.9ms1000
61.316.32ms1835.44ms0111
1238.16ms3672.72ms0110
2454.08ms7351.36ms0101
4902.04ms1.47k680µs0100
9801.02ms2.94k340µs0011
1.96k510µs5.88k170µs0010
3.93k255µs11.7k85µs0001
7.85k127.5µs23.5k42.5µs0000
Minimum step
frequency(Hz)
Maximum step
period
Maximum step
frequency(Hz)
Minimum step
period
Stepratio
registerST 3-0
Register Register undated on R event
MPRSR b3-b0
MCRA b2
4MHz
41 / 2
Ratio
1 / 2
MZREG
MTIM
Zclk
8
R+
R-< 55h ?
= 100h ?
1
0 C
+1
-1
ST<3:0> bits
MTIM [ 8- bit Up Counter] Clr
SWA bit2MHz - 62.5Hz
All timer register are in Read-Write mode until MTC clock is enable (with MOE and DAC). This is useful to initialize timer, prescaler and compares for start-up.In sensorless mode and switched mode the prescaler is loaded with initial value then it can be incremented or decremented by software. To start directly in auto switched mode (in sensor mode for example), write an appropriate value in MZREG and MZPRV enable to perform a stepcalculation as soon as the clock is enabled.If there is an overflow of the timer, it is reset to its middle value=7Fh.Accuracy:1/85=1.17% (55h=85).R+event:timer reaches 100h before the Z event.R- event: timer value is under 55h at the Z event.
BLDC_basics.ppt 33
V233
®
CLOCK AND TIMER OVERVIEWS (2)CLOCK AND TIMER OVERVIEWS (2)Timer Overflow
Begin
Ratio<Fh?
Ratio=ratio + 1
Zn=Zn/2Zn+1=Zn+1/2
Dn=Dn/2Counter=Counter/2
Re-compute Cn
End
Slow-Down control
yes
No
Begin
Ratio>0h?
Ratio=ratio - 1
Zn=Zn x 2Zn+1=Zn+1 x 2
Dn=Dn x 2Counter=Counter x 2
compute Cn
End
Speed-up control
Z capture with Timer Underflow (Zn<55h)
yes
No
Example: If step ratio register is at 0101:If there is an R+ event, we need to slow down the clock. Go from 0101 to 0110 (increase the ratio)If there is an R- event, we need to accelerate the clock. Go from 0101 to 0100 (decrease the ratio).Everything is automatically done by Hardware.
BLDC_basics.ppt 34
V234
®
DEBUG OPTIONDEBUG OPTION
BLDC_basics.ppt 35
V235
®
Built in Checks and Controls for simulated events (1)
Built in Checks and Controls for simulated events (1)
Simulated demagnetization / zero-crossing event generation
By setting SDM bit (MCRB reg) and SC, SZ bits (MCRC reg) simulated event generation is enabled
To avoid system stop, if the value written in one of compare registers is less than or equal to the current value of the MTIM timer value, the simulated event is generated immediately and the value of MTIM timer overwrites the value in the register.
When using simulated commutation (Cs) the result of the 8*8 hw multiplication of the delay manager is not taken in account and must be overwritten if the SC bit has been set in a Z event interrupt. The sequence of events is broken meaning that several consecutive simulated commutation can be implemented.
As soon as SC bit is set, the capture/compare feature and protection on MCOMP register is reestablished only after a write access on MCOMP register. Otherwise, once SC bit was set, no write on MCOMP cause no commutation event generation, both in switch and in autoswitch mode
BLDC_basics.ppt 36
V236
®
PWM MANAGER (1)PWM MANAGER (1)
(I) Current mode
(V) Voltage mode
MEASUREMENTWINDOW
GENERATOR
MODE
(I)
12 bit Timer U
(V)
PWM Out
MCCFI
(I)
(V)
Current
Comparator MCCREF
In current mode, 12 bits Timer U, V or W can be used to set the current reference. In voltage mode, the 12 bits PWM timer U signal is applied directly to the drivers.Clock frequency is also the sampling frequency in sensorless mode, current mode.The comparator is reset when the current feedback reaches the current reference.
BLDC_basics.ppt 37
V237
®
PWM MANAGER (2)Sampling Clock Generation
PWM MANAGER (2)Sampling Clock Generation
35µs1011
40µs1111
37.5µs0111
32.5µs0011
30µs1101
27.5µs0101
25µs1001
22.5µs0001
20µs1110
17.5µs0110
15µs1010
12.5µs0010
10µs1100
7.5µs0100
5µs1000
2.5µs0000
Off TimeOT0
OT1
OT2
OT3
Toff measurement window
T sampling
Frequency logic4 MHz
1
Off-Time logic S
QR
4
SA[3:0]
4
OT[3:0] bits
MPWME b3-b0
MPRSR b7-b4
961 Hz1011
390 Hz1111
625 Hz0111
1.25 kHz0011
1.56 kHz1101
3.13 KHz0101
6.25 KHz1001
10.0 KHz0001
12.5 KHz1110
15.4 KHz0110
18.1 KHz1010
20.0 KHz0010
25.0 KHz1100
33.33 KHz0100
40.0 KHz1000
50.0 KHz0000
Samplingfrequency
SA0
SA1
SA2
SA3
MPRSR b7-b4 MPWME b3-b0
Increasing the frequency of the clock increases the resolution but there are more losses on the IGBTsSA<3-0> bits allow the user to change the clock frequency.OT<3-0> bits allow the user to change the OFF Time in current mode sensorless.
BLDC_basics.ppt 38
V238
®
PWM MANAGER (3)Current Feedback Description
PWM MANAGER (3)Current Feedback Description
MCCFI 0
V CREF
R
MCCREFC EXT
To Phase StateControl
Sampling frequency
+-
MPWME b6-b4
(V)
R1
R2
VDD
(I)
12-bit PWM Generator
LEGEND:(I): Current mode(V): Voltage mode
PWM[U:V:W]
+-
OAP
OAN
OAZMCCFI 1
OACSR b4OAON
MREF b5CFAV
VI
12-bit PWM generator Signal U
Sampling frequency
MCRA b3 VOC1
S
R Q
MCPWMU /V /W
Cli
CFW[2:0]
MCFR b2-b0
CFF[2:0]
MCFR b5-b3
In current mode the current reference is provided to the comparator by the PWM output of a 12 Bit PWM Generator (U/V or W) , filtered through a RC filter.
The sensed current input is connected on the MCCFI 0 pin or on one of the AOP input.
A 0.5 µs to 3.5µs Blank window filter after switch-on of PWM can be applied on comparator output.
A Counter (between 1 to 8), set the number of consecutive samples needed to generate the turn off of PWM (the current sample frequency is Fperiph/4)
In Voltage mode the current comparator is used for safety purpose as a current limitation.
BLDC_basics.ppt 39
V239
®
Current Window and Feedback FiltersCurrent Window and Feedback Filters
For Current comparator we have two Filter:
The Blank Window filter(CFW[2:0]) start at each PWM turn-on and masking the output of current comparator for the programmed timebetween 0.5µs to 3.5µs
The Event filter CFF[2:0] (from 1 to 8) allow to fix the number of good consecutive sampling we want to get before to turning-off the PWM
BLDC_basics.ppt 40
V240
®
Over Current Handling in Voltage ModeOver Current Handling in Voltage ModeCurrent Limitation Interrupt Mask in MIMR(available only in Voltage Mode)
Current Limitation Interrupt Flag in MISR
Over Current protection in Voltage Mode in MCRB
MCO reset state is selected in option byte 1
BLDC_basics.ppt 41
V241
®
CHANNEL MANAGERCHANNEL MANAGER
* use preload register
OP[5:0]
MOEt
x6
x66
1
MC
O0
MC
O2
MC
O4
MC
O3
MC
O5
MC
O1
MPOL b5-b0
MRCA b7
NMCES
POLARITY REGISTER
OUTPUT STAGE
MCRA b3
CFF[2:0]
OO bits*C
OE[5:0]
6
6OS[2:0] bits*
Phasen Register*
SR bit
3
PWMU Generator
Sampling frequency
DAC
Current comparator output
V
I
PWMU Generator
S Q
R
V0C1
V
I
Filter
MPHST b5-b0MCRB b2-b0MPAR b5-b0
MCRA b5MCRA b4
MCFR b5-b3
High Frequency Chopper
DeadTime
DeadTime
DeadTime
Channel [5:0]
Channel [5:0]MREF b4-b0HFE [1:0]
HFRQ[2:0]
OCVt
CLIM
CLIt
MCRB b3MIMR b4MISR b4
MPHST register has a preload register and an active register.MPAR register permits to choose the parity of the outputs:T1,T3,T5 are Odd drivers and T2,T4,T6 are Even drivers for example.PWM signal can be applied either on Odd or Even drivers (High or low side)MPOL register can select the polarity of each of the output:0:Output is active low level, 1: Output is active high level.
A Chopper signal can be superposed on output signal .
BLDC_basics.ppt 42
V242
®
Sensorless Mode PWM ApplicationSensorless Mode PWM Application
t
Delay
Motorback-EMF
t
Motorcurrent
C : commutationZ : Zero CrossingD : end ofdemagnetisation
C CZ ZD D
OS0 from Z to C
OS2 from C to D
OS1 from D to Z
OS[2:0) from MCRBAllow PWM applicationBetween Events
Bits OS[2:0] of MCRB register allow to select the PWM application on Odd or Even channels between each events.
OS2 with preload register manage PWM between C and DOS 1 manage PWM between D and ZOS 0 manage PWM between Z and C
BLDC_basics.ppt 43
V243
®
Sensorless PWM application and paritySensorless PWM application and parity
BLDC_basics.ppt 44
V244
®
Demagnetisation and Z Monitoring Window depends on current amplitude
Demagnetisation and Z Monitoring Window depends on current amplitude
t
I1
I2
demagnetisation timeis increasing when current is high
back-EMFmonitoring interval
Higher is the current level longer is the demagnetization time
BLDC_basics.ppt 45
V245
®
Demagnetisation and Z Monitoring Windowdepends on line voltage
Demagnetisation and Z Monitoring Windowdepends on line voltage
t
I1
demagnetisation timeis increasing when line is low
current slope is dependant ofthe line voltage
back-EMFmonitoring window
Lover is the line voltage longer is the demagnetization time
BLDC_basics.ppt 46
V246
®
Demagnetisation Speed UpPrinciple on High Side set with OS2 Bit
Demagnetisation Speed UpPrinciple on High Side set with OS2 Bit
Step 2
A
B C
T1
T6bemf
V
B Polarization duringPWM “Off”
A
B C
T1
T6
PWM “off”
V
-2V/3D2
D3
Step 1
ABC
T5
T6
T3
T4
+300V DC
+IT1
T2
A
BC
T1
T4bemf
V/2
V
V/2
B Polarization duringPWM “on”
A
B C
T1
T6
PWM “on”
V
-V/3
D3 2V/3 V/3
Demagnetization of B winding
For a winding previously connected to ground, the PWM signal must be applied on the high side switch to speed up the demagnetization.
During on state of PWM voltage apply on B winding is -V/3 compare to +V/2 during the step 1. So voltage on B winding during demagnetization is reverse.
During off state of PWM voltage apply on B winding is -2V/3 compare to -V/3 during on state of PWM. So voltage on B winding under demagnetization during PWM off is double than during PWM on and by the way speed up the demagnetization.
BLDC_basics.ppt 47
V247
®
Demagnetisation Speed Up Principle on Low Side set with OS2 BitDemagnetisation Speed Up Principle on Low Side set with OS2 Bit
Step 2
A
B C
T1
T6bemf
V
V/2
A Polarization during PWM “off”
A
BC
T6
V
T3
-2V/3
D2
D1
CBA
T5
T6
T3
T4
+300V DC
+IT1
T2
Step 3
A
BC
T3
T6
B-emf
V
A Polarization during PWM “on”
A
BC
T6
V
T3
-V/3
D2
Demagnetization of A winding
PWM “on”
PWM “off”
For a winding previously connected to the line, the PWM signal must be applied on the low side switch to speed up the demagnetization.
During on state of PWM voltage apply on A winding is -V/3 compare to +V/2 during the step 2. So voltage on A winding during demagnetization is reverse.
During off state of PWM voltage apply on A winding is -2V/3 compare to -V/3 during on state of PWM. So voltage on A winding under demagnetization during PWM off is double than during PWM on andby the way speed up the demagnetization.
BLDC_basics.ppt 48
V248
®
Deadtime generatorDeadtime generator
• Dead Time Generator (DTG) avoid half bridge short circuits
Definition: 6-bit with 125, 250 or 500ns at 16MHz(i.e. from 0 to 16µs)
Write-once register to avoid cross conduction whatever theenvironement.
U
Uh
Ul
Delay
Delay
5V
5V
5V0V
0V
0V
High side PWM
Low side PWM
Internal PWM before deadtime generator
BLDC_basics.ppt 49
V249
®
High Frequency ChopperHigh Frequency Chopper
A chopper can be add to the PWM signal for transformer gate drive for example.
BLDC_basics.ppt 50
V250
®
Back-EMF Sampling (1)Back-EMF Sampling (1)
Sampling during PWM OFF State at PWM frequency
Sampling during PWM ON state only at PWM frequency
Sampling during PWM ON state only at High frequency
Sampling either during OFF or ON state at High frequency
PWM signal on switches
PWM signal on switches
PWM signal on switches
fSCF sampling
PWM signal on switches
fSCF sampling
= instant of sampling
d d d
d d d
NOTE 1: The delay ‘d’ is set by the DS[3:0] bits in MCONF register
NOTE 2: Setting the SPLG bit in MCRC register allows a sampling frequency of fSCF for Z event detection independent from the PWM signal. As soon as the SPLG bit is set the minimum OFF time needed for the PWM signal in current mode is set to 0us and a true 100%duty cycle can be set in 12-bit PWM generator compare register in voltage mode.
NOTE 3: The ZEF[3:0] event counter in the MZFR register is active in all configurations
BLDC_basics.ppt 51
V251
®
Back-EMF Sampling (2)Back-EMF Sampling (2)
COMMUTATION NOISE FILTERTo avoid any erroneous detection due to PWM commutation noise, an hardware filter of 1us (for fPERIPH = 4MHz) when PWM is put ON and when PWM is put OFF has been implemented. This filter is active all the time for the D event and it is active for the Z event when the SPLG bit is set and DS[3:0] bits are cleared, sampling at high frequency whatever the PWM state.
BLDC_basics.ppt 52
V252
®
12 Bit PWM Counter12 Bit PWM Counter
12 Bit PWM free running Up/Down counterEdge-aligned and center-aligned PWM operating modeFull-scale PWM generationTimer re-synchronization
BLDC_basics.ppt 53
V253
®
MTIM [8-bit Up Counter]
C
A
B
HV
DQ
CP
Microcontroller
+
VREF
ZVD b it
-
MPO
L Reg
MO
E b
it
MCCFI
MCO0
MCO2
MCO4
MCO1
MCO3
MCO5
HDMn bit
ISn bit
Board + Motor
CFF[2
:0] b
it
VR2-0
ZH
MCIC
MCIA
MCIB
DH
MWGHT Reg [an+1
]
MZREG Reg [Zn]
A x B / 256
Fcpu
MZPRV Reg [Zn-1]
CS,H
DS
ST3-0 bits4
DCB bit SDMn bit
SWA bit
MDREG Reg [Dn]
Compare
Compare
MCOMP Reg [Cn+1]
ZH
1 / 2Ratio
1 / 2
MZREG
MTIM
ZS,H
SA3-0 &
12-bit PWM genera tor
S Q
R
VI
DH
NMCES
+1
-1Z
clr
x6 x6
ck
MIS
R R
eg
CS,H
DS,H
ZS,H
E
MPA
R R
eg
6 6
8
8
881
Filter / PWM
1 1/128
OT1-0 bits
nn-1
R+
R-
R-/+
MIM
R R
eg
CL
3
MP
HSTn R
eg
SR
bit
SR bit
+
-
Cext
DS,H
or
ororor
1
2
VI
1 2
F ilte r / D
F ilt e r / C
1 /20
1 / 4
CS,H
DS,H
A
CPBn bit
OS
n
REO bit
CS,H
DS,H
< 55h?
= FFh?
Filter / C
CPBn bit
1
0
SWA bit
CH
(V)
R1ext
R2ext
VDD
(I)
Com
pare
U
MCPWMU
MCPWMV
MCPWMW
MCVREF
SPLG
EF[2 : 0]
E F [2 :0 ]
PZ bit
EF[2
:0]
SZn
Compare
Filt
er / C
EF
[2:0
]
bit
ZSC
h0C
h1C
h2C
h3C
h4
Ch5
bits
PC
N b
it =0
DTG
registe
r
82
6
Dea
dTim
eD
ead
Tim
eD
ead
Tim
e
High F
requen
cy C
hopp
er
MCAOP
MCAON
MCCREF
MCPWMU/V/W
AO
bit
+
-
MPW
ME R
eg
MR
EF
Reg
CL
XT16 bit
MCAOZ
CFAV bit
ST7MC MTC Cell for BLDCST7MC MTC Cell for BLDC
BLDC_basics.ppt 54
V254
®
Current limitation in voltage mode controlCurrent limitation in voltage mode control
I
Motor Voltage
Max currentreference
t
tstep time step time
T1-T4 T1-T6
-+
setR
TIMER HVST7FMCMicrocontroller
T1
T4
A
ST7FMC 12 Bit Timer U output
Vdd
Max currentreference
BLDC_basics.ppt 55
V255
®
Current loop regulation in current mode control
Current loop regulation in current mode control
I
MotorVoltage
current reference
tt
tstep time step time
T1-T4 T1-T6
clock
-+
SetR
current reference
12 Bits TIMERU/V/W
clockHVST7FMC
Microcontroller
T1
T4
A
+ -
BLDC_basics.ppt 56
V256
®
Multiple Parameter Setting for SensorlessMultiple Parameter Setting for Sensorless• Filter between C -> D, D -> Z events: 8 values (5 to 40us)
• Current feedback filter: 8 values (0 to 3.5us)
• 4 sampling methods (using Ton/Off, PWM On/Off or 1MHz)
• Protection on Hard Z event (edge transition protect): on/off
• Simulated C, D, Z events (with protection writing).
• Delay coefficient Manager (between Z and C) for best efficiency (256 values)
• Comparator input threshold: external or 7 internal values (0.2 to 3.5V)
• PWM sequencing for de-magnetization acceleration
• Complementary PWM for active braking
C: Commutation EventD: End of demagnetization EventZ: Zero Crossing Event
BLDC_basics.ppt 57
STMicroelectronics
BLDC START & DRIVEBLDC START & DRIVE
ST7MCxST7MCx
BLDC_basics.ppt 58
V258
®
ST Sensorless PMDC Control Method (1)ST Sensorless PMDC Control Method (1)
GND
A
B C
T1 PWM "ON"
T4 ONbemf
V = 300V
“V/2”
back-EMF direct sensinghigh sensitivity + large speed range + starting with full motor torqueno filtering delay and attenuationhigh signal to noise ratio
GND
A
B C
T1 PWM "OFF"
T4 ON
bemf
V = 300V
“GND”+ 5V
voltage clamping
ST7MC
Winding C has been previously demagnetised. The time window for back-EMF reading is now opened.Every time T1 transistor is off, the current flows in the free-wheeling diode and the motor windings are referred to ground.Then the Back-EMF zero crossing can be sampled at the output of the comparator.The C voltage is clamped at +5V / -0.6V by the on-chip clamping diode.
BLDC_basics.ppt 59
V259
®
ST Sensorless BLDC Control Method (2)ST Sensorless BLDC Control Method (2)
Back-EMF Back-EMF
Zero CrossingFloating phase Floating phase
Conducting phase
T1 T2 T4 T5T3
2 time windows per phase : One for crossing coming from negative area, one for crossing coming from positive area.
BLDC_basics.ppt 60
V260
®
Auto-commutation principle (1)Auto-commutation principle (1)
t
Delay
Motorback-EMF
t
Motorcurrent
t
C : commutationZ : Zero CrossingD : end ofdemagnetisation
Z C D Z C D
At a given speed, the best efficiency of the BL PM DC motor is achieved when the current in a winding is in phase with the back-MF generated by the magnet moving in front of that winding.The auto-commutation process is about keeping these 2 signals in phase.Z zero crossing and D end of demagnetisation are physical events.The C commutation is an event calculated by the Motor Control Cell coprocessor, with regards to a delay coefficient that depends on the speed and the motor characteristics.
BLDC_basics.ppt 61
V261
®
Auto-commutation principle (2)Auto-commutation principle (2)
PhaseCurrent
Phase B-EMF
ZeroCrossingsignal
Z C Z CZ Z Z Z Z
Each edge is sequenced by a zero-crossing back-EMF detection.
BLDC_basics.ppt 62
V262
®
Alignment PhaseAlignment Phase
UVW
63
C
A
T5
T6
T3 T1
T4 T2
B
+300V DC
-
+IT1-T4-T6
•Put in an intermediary position•Not an ordinary polarization•Using the 3 windings generate a more important flux•Less oscillations around the start position
N
S
• 1/ Define a rotor alignment phaseex: phase B & C are grounded, PWM is applied to phase A with increase duty cycle
BLDC_basics.ppt 63
V263
®
Sensorless Acceleration Phase (1)Sensorless Acceleration Phase (1)• 2/ Start an acceleration phase with a constant acceleration ramp
and define the slopeSlope depends on system inertia, load & motor torqueUsable slope must be small versus maximum slope in no load conditionDisable the Back EMF detection to ease the slope adjustment (the whole ramp can be run)
Example of acceleration ramp
0
5
10
15
20
25
30
0.000 0.500 1.000 1.500 2.000 2.500 3.000 3.500Time (sec.)
spee
d (r
.p.m
.)
BLDC_basics.ppt 64
V264
®
Maximum Starting Slope MeasurementMaximum Starting Slope Measurement
Maximum acceleration with no load condition
Auto-commutation disabled
Speed signal
Phase sequence
This allows to determine the maximum starting slope and then the pratical slope for a given load.
BLDC_basics.ppt 65
V265
®
Sensorless Acceleration Phase (2)Sensorless Acceleration Phase (2)• 3/ Select the acceleration phase adapted to the load
With pumps or fans, the initial load is mainly inertial. So the actual slope can be set at half the maximum slope.
With unknown load, the actual slope is set at one tenth of the maximum slope.
Starting with dynamic loading is the most challenging situation when designing without sensor. The starting procedure described here applies when the motor is initially stopped. If it is running due to the load, a re-synchronization procedure will be needed.
BLDC_basics.ppt 66
V266
®
Sensorless Starting ProcedureSensorless Starting Procedure
• Start:Put the rotor to starting position (typically few 100msec to damp oscillations)Increase the current to maximum (get maximum torque) and sequence phase commutations according to the rampEnable Back EMF detection from beginningEnable auto-commutation after detection of two successive Back EMF
• Thanks to the direct Back EMF sensing (no voltage divider is needed), the detection sensitivity is very high.
Back EMF signals as low as 0.2V are detectableAuto-commutation is reached from the third step typicallyIn consequence full torque is available at very low speedThis makes easy to start sensorless even with un-predictable load (ex: compressor, food processor, tools)
BLDC_basics.ppt 67
V267
®
STARTING SEQUENCESTARTING SEQUENCE
I motor
30%imposed I
time (sec)1 32
2000
1000
rotation speed(rpm)
waiting for BEMFsynchronous sequence
enabling auto-commutated mode
closing theregulation loop
BLDC_basics.ppt 68
V268
®
Alignment Forced Switched Mode Auto-switched Mode
C event
Z event
Sensorless Starting ProcedureSensorless Starting Procedure
The auto-commutation has been enabled late to highlight the acceleration change.
BLDC_basics.ppt 69
V269
®
C6 IT ISRAutoswitch Mode
Delay = 128
C5 IT ISRFirst Step in AutoSw
Delay = 255
Z2 IT ISRLast Step in Synch Mode
MCOMP = MZREG*2
Sensorless Starting ProcedureSensorless Starting Procedure
C3
Z1
C4
Z2
C5 Z3 C6
Z4 Z5
C7
t
C1 C2
Synchronous mode Autoswitch mode
Z IT masked
MZREG
MCOMP
MCOMP
MZREG
LastStep
First Step inAutoswitch
BLDC_basics.ppt 70
V270
®
COMPRESSOR START CONSTRAINTSCOMPRESSOR START CONSTRAINTS• BIG VARIATION OF RESISTIVE TORQUE
• STARTING IN HIGH LOAD CONDITIONS
After a power shortage, piston and rotor are locked due to pressure inside cylinder
BLDC_basics.ppt 71
V271
®
START STRATEGYSTART STRATEGY• Unknowns position of rotor and high load conditions induce to
used a specific starting strategyUse of Voltage mode drive allow to put in the motor the maximum current acceptable by this one, to be able to start in high load condition.Run motor in reverse sense with low polarization and for few step (based on number of pair poles of motor), to put the piston to its minimum mechanical point and not pass over this minimum mechanical point Increase the duty cycle up to the maximum allowed
Start the ramp-up with the right acceleration with no detection of BEMF to reach minimum speed allowing detection of BEMF.Wait for two consecutive BEMF to pass in autoswitch modeSome time it could be interesting to work with simulated demagnetization and manage the demagnetization time in relation with the speed of motor. The speed regulation is validate at the same time we pass in autoswitch mode and is done over one mechanical cycle of motor to not be dependant of the torque change on mechanical cycle.
BLDC_basics.ppt 72
V272
®
Start with 15 Bars pressure and2200rpm targeted Speed
Start with 15 Bars pressure and2200rpm targeted Speed
BLDC_basics.ppt 73
V273
®
Zoom on Autoswitch TransitionZoom on Autoswitch Transition
BLDC_basics.ppt 74
V274
®
Sensorless Step Time Balancing (1)Sensorless Step Time Balancing (1)
At 230Vac, 2NmParameter set-up:Rising Ki = 12Falling Ki = 12
Steps are unbalanced
Zoom
Several factors can un-balance the odd and even step-times:-magnet pole dissymmetry.-High value of comparator reference voltage versus line voltage.
BLDC_basics.ppt 75
V275
®
At 230Vac, 2NmNew parameter set-up:Rising Ki = 9Falling Ki = 16
Steps are balanced
Sensorless Step Time Balancing (2)Sensorless Step Time Balancing (2)
This step-time dissymmetry can be cancelled by adjusting the delay coefficient.
BLDC_basics.ppt 76
STMicroelectronics
ST7MCxST7MCx
Starter Kit & GUI
BLDC_basics.ppt 77
V277
®
ST7FMC Starter KitST7FMC Starter Kit
BLDC_basics.ppt 78
V278
®
ST7FMC Starter Kit GUI (1)ST7FMC Starter Kit GUI (1)Motor Type Selection
Warning about Jumper Setting
BLDC_basics.ppt 79
V279
®
ST7FMC Starter Kit GUI (2)BLDC Basic Setting Screen
ST7FMC Starter Kit GUI (2)BLDC Basic Setting Screen
BLDC_basics.ppt 80
V280
®
ST7FMC Starter Kit GUI (3)BLDC Advanced Setting Screen
ST7FMC Starter Kit GUI (3)BLDC Advanced Setting Screen
BLDC_basics.ppt 81
V281
®
ST7FMC Starter Kit Flow ChartST7FMC Starter Kit Flow Chart
Selection of key parameters:AC/PM brushless motor
Sensor / sensorless schemes
Selection of parameters to be tuned:Acceleration ramps, filters andblanking windows setup, etc.
RUN motor with selected cellparameters, and modify on the fly
real time parameters (speed, voltage, current)
Select most appropriate library and write binary file into ST7MC Flash memory
Re-write dedicated Flash sector
Generation of header source files with selected parameters
Optimized motor control software library
Development of application-specific software
Application Build
Developer’s Actions Software Tools
1
2
3
Needs improvements Parameters OK
BLDC_basics.ppt 82
V282
®
Starter kit Used in Stand Alonewith BLDC Motor
Starter kit Used in Stand Alonewith BLDC Motor
BLDC_basics.ppt 83
V283
®
Set Parameter Using GUISet Parameter Using GUI
Version.hMTC_Settings_Sensorless.h
After setting right parameters using the GUI, we can save all this one in the corresponding file.
BLDC_basics.ppt 84
V284
®
Version.h FileVersion.h File/* Sensors distribution */
#define SENSOR_60 1
#define SENSOR_120 2
/* Demagnetization type parameters */
#define HW 1 // 1 -> Hard demag only
#define HSW 2 // 2 -> Alternate Hard/Soft
#define SW 3 // 3 -> Soft Demag only
/* Driving mode parameters */
#define CURRENT_MODE 0 // 0 -> Current mode
#define VOLTAGE_MODE 1 // 1 -> Voltage mode
/* Regulation type parameters */
#define OPEN_LOOP 0 // 0 -> Open loop
#define CLOSED_LOOP 1 // 1 -> Closed loop
/******************************************************************************/
/* Option settings used throughout the compilation process */
#define SENSOR_TYPE 0 // no use in sensorless mode
#define DEMAG_TYPE 2 // no use in sensor mode
#define DRIVING_MODE 1
#define FEEDBACK_TYPE 1
/******************************************************************************/
We are insensorlessHSW demagnetizationVoltage ModeClosed Loop
In this file we found the definition of each parameter and the configuration used to compile the project.
BLDC_basics.ppt 85
V285
®
MTC-Settings_Sensorless.h FileMTC-Settings_Sensorless.h File#define mem_MCRA ((u8)0) // Setting of MCRA register for polarization type, detection mode, filter,...
#define mem_MCRC ((u8)64) // Setting of MCRC register for sampling and voltage reference
#define mem_MPRSR ((u8)80) // Setting of PWM frequency used in current mode
#define mem_MDTG ((u8)31) // Selection of Dead time
#define mem_MCONF ((u8)2) // Selection of delay before sampling and Peripheral frequency (4MHz with 16Mhz input frequency)
#define mem_MCFR ((u8)1) // Set filter of current feedback
#define mem_MZFR ((u8)0) // Set filter of Z event detection
#define mem_MSCR ((u8)252) // Set sampling frequency to count D & Z events
#define Freq_Min ((u16)100) // Setting of min frequency in closed loop mode
#define Freq_Max ((u16)3000) // Setting of max frequency in closed loop mode
#define Pole_Pair_Num ((u8)2) // number of pair poles
#define Brake_Duty ((u16)0) // Duty cycle in Break mode
#define Brake_Time ((u16)0) // Time, Break mode
We found in this file all data download in ST7MC when running starter kit board with GUI.
These data are needs when we want to run the starter kit board in stand alone.
BLDC_basics.ppt 86
V286
®
Closed Loop Data CollectionClosed Loop Data CollectionData to update after collection in MTC.h file
Minimum and Maximum speed are normally the one Set in the advance setting screen of GUI
The software compute for the target speed selected trough the RV1 potentiometer.Once the motor runs, Back-EMF rising/falling and proportional/integer coefficients are computed following a linear curve between F_min and F_1, F_1 and F_2, F_2 and F_Max, all frequency are electrical frequencies with 0.1Hz resolution (for 123.4Hz we have to fill 1234)
BLDC_basics.ppt 87
V287
®
Flash, IAP, ICC, ICPFlash, IAP, ICC, ICP
• HD Flash: ST7MC Flash device uses double voltage High Density Flash requiring external or charge pump 12V for ICP and IAP. This HD Flash is programmed byte by byte but erased by sector.
• IAP (In-Application Programming): The Flash has IAP which is the ability to re-program the FLASH memory of a micro-controller while the device is already plugged into the application and the application is running.
• ICC (In-Circuit Communication): The ICC is either an ST7 mode or a software protocol stored by ST7 micro-controller in the System Memory. The ICC software is used to download programs into RAM and execute them. It can also write (registers or RAM) or read any part of the memory space and jump to any memory address. The ICC protocol is used for ICP. It is accessed by entering ICC mode after a dedicated reset sequence.
• ICP (In-Circuit Programming): The ICP is the ability to program the FLASH memory of a micro-controller using ICC protocol while the device is plugged-in to the application.
BLDC_basics.ppt 88
V288
®
ST7MC Tools SummaryST7MC Tools SummaryLow-cost emulator (ST7XF-INDART/USB)
STVD7 capabilitiesEmulation features
In circuit debugging through ICP connectorReal-Time code ExecutionFull HW & SW control over registers, memories and variables2 HW breakpoints
Built-In ICP Programmer
High-end emulator (ST7MDT50-EMU3)
Probe mode True source-level debuggingAdvanced breakpointsSelective trace and output trigger256K real-time trace with timestampProgrammable internal clockRead/Write on the flySTVD7 capabilities
In Circuit Debugging modeIn circuit debugging through ICP connectorReal-time code executionFull HW & SW control over registersMemories and variables2 HW breakpoints
BLDC_basics.ppt 89
STMicroelectronics
ST7MCxST7MCx
BLDC Motor Control Library
BLDC_basics.ppt 90
V290
®
Software Library (1/2)Software Library (1/2)
• Three phase Induction motor featuresSinewave generationTacho feedback processingBrake capability (DC current injection)Basic control routines (Start-up/Accel/Decel/Slip regulation…)
• PMDC motor featuresSensorless & sensored control schemesVoltage or Current modeSynchronous rectification availableBasic control routines (Start-up/Accel/Decel/…)
• Bi-phase & PMAC motor planned (based on same sinewave generation principle)
BLDC_basics.ppt 91
V291
®
Software Library (2/2)Software Library (2/2)• State of the art PI regulator
• Module approachMotor control dedicated peripheral driverSeparate PI regulator moduleBasic control routines module
• Complete C source codeCosmic / Metrowerks compatibleSTVD7 environment files availableFully documented
BLDC_basics.ppt 92
V292
®
BLDC motor Function prototypes BLDC motor Function prototypes • u8 BOOT_REFRESH
• u8 GetMotorStatus(void)
• void RefreshBootstrap(void)
• void AlignRotor(void)
• void MTC_ResetPeripheral(void)
• BOOL MTC_StartMotor(void)
• void MTC_StopMotor(void)
• void Update_Duty(void)
• BOOL active_break(void)
• void Chk_Motor_Stalled(void)
• (interrupt service routine)void MTC_U_CL_SO_IT(void)void MTC_C_D_IT(void) void MTC_R_Z_IT(void)void MCES_SE_IT(void)
BLDC_basics.ppt 93
V293
®
Main.cMain.c• void main(void)
{MTC_InitPeripheral();EnableInterrupts();while(1) // main loop
{switch (State)
{case IDLE: if (key_scan() == TRUE) State = START;case START: if (MTC_StartMotor() == TRUE) State = RUN;case RUN: if (GetMotorStatus() & AUTO_SWITCH)
Set_Target_Electrical_Frequency((u16)(temp));Set_Duty((u16)(temp));if (key_scan() == TRUE) State = BRAKE;
case BRAKE:if (active_break(Brake_Duty,Brake_Time) == TRUE) State = STOP;case STOP: MTC_StopMotor();
State = IDLE;case WAIT: break;case FAULT: if ((u8)(GetMotorStatus() & FAULT_MSK) == 0) State = IDLE;}
}}
BLDC_basics.ppt 94
V294
®
MTC_StartMotorMTC_StartMotor• BOOL MTC_StartMotor(void)
{
switch (Status_Start)
{
case INIT_START: Status_Start = ALIGN_ON_GOING;
case ALIGN_ON_GOING: AlignRotor();
case INIT_SWITCHED_MODE: MIMR = ((u8)CIM_MSK );// Unmask C interrupt}
}
BLDC_basics.ppt 95
V295
®
MTC_C_D_ITMTC_C_D_IT• void MTC_C_D_IT(void)
{
if(MISR & CI_MSK)
MPHST = PHASE_CONFIG[StepIndex]; // Preload active phase on next C eventMCRB = ZC_DEMAG_PWM[StepIndex];
if (MotorStatus == AUTO_SWITCH)
if (DEMAG_TYPE == SW)
if (DEMAG_TYPE == HSW)
if (MotorStatus & FIRST_AUTO_SWITCH)
if (MotorStatus & LAST_FORCED_SWITCH)
if(MISR & DI_MSK)
if (DRIVING_MODE == VOLTAGE_MODE) MCPUL = Previous_Duty
if (DEMAG_TYPE == HSW) temp_D = (u8)(MDREG - MCOMP);
}
BLDC_basics.ppt 96
V296
®
MTC_R_Z_ITMTC_R_Z_IT• void MTC_R_Z_IT(void)
{
if (MISR & ZI_MSK)
if (MotorStatus & AUTO_SWITCH)
Step_Z[Step_Z_Counter].Ratio = (u8)(MPRSR & 0x0f);
// update Z steptime buffer for PI regulation
Step_Z[Step_Z_Counter].StepTime = MZREG;
// & motor frequency computati
if (BemfCounter == bemf_valid) MotorStatus |= LAST_FORCED_SWITCH;
if (MISR & RPI_MSK)
if (RPICounter == 0) MDREG = (u8) SoftDemagTime;
if (MISR & RMI_MSK)
}
BLDC_basics.ppt 97
V297
®
Safety features: Power stage checkSafety features: Power stage check
• Heatsink TemperatureMust be monitored with the ADC, and motor stopped when heatsinkbecomes to hot
• Over current protectionDisables immediately the PWM outputs in MCES interruptMust be detected in Power Stage Check routine to change the State of themotor control state machine to FAULT
• Bus voltage must stay below a certain level, otherwise the motor must be stopped and PWM outputs set in reset state
Occurs in case of reactive current injection in bus capacitorsIs main loop reaction time sufficient?
BLDC_basics.ppt 98
V298
®
SW Time BasesSW Time Bases
• Based on 16-bit Timer B Interrupt:Accessed in motor control module for:
PI_SamplingBrake Duration and brake current increasing rate
Accessed in ICC module:ICC TimeOutSCI_Tx_Timer
Accessed in Stand Alone:DebounceButton
Common Access:timer_10ms, timer_led_10ms, Timer_1ms
BLDC_basics.ppt 99
V299
®
VOLTAGE MODE CLOSED LOOP(C Cosmic Compiler)
VOLTAGE MODE CLOSED LOOP(C Cosmic Compiler)
Regul_PI CPU Load Analysis
We open here the advance breakpoint window to set the entry point on the file to toggle the trigger 1 on each event.
BLDC_basics.ppt 100
V210
®
BLDC_basics.ppt 101
V210
®