Post on 06-Jul-2020
TM
Freescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008.
AZ114
Hands-on Workshop: Motor Control Part 4 -Brushless DC Motors Made Easy
June, 2008
Eduardo ViramontesApplications Engineer
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 1
Agenda
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 2
Motor Anatomy
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 3
Motor Anatomy
►The first electric motor was the Brushed DC Motor• Basic idea is to repel rotor from stator
Rotor
Stator
Commutator
Brushed DC
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 4
Motor Fundamentals
N
S
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 5
N
S
N S
+ _ + _
V
Motor Fundamentals
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 6
N
S
N S
+ _ + _
V
Motor Fundamentals
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 7
NS
S N
_ + _ +
V
Motor Fundamentals
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 8
N S
N S
+ _ + _
V
Motor Fundamentals
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 9
Electric Motor Type Classification
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 10
Electric Motor Type Classification
ELECTRIC MOTORS
AC DC
SYNCHRONOUSASYNCHRONOUS
BrushlessInduction StepperSinusoidal
Permanent Magnet
Wound Field
Surface PM
Interior PM
SR
VARIABLE RELUCTANCE
Known as Universal DC motors or Brushed DC Motors•AC power Tools
•Washers, Dryers
•Garage Openers
•Blenders
•Vacuum Cleaners
•HVAC
•Toys
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 11
Brushed DC Motors
• Rotation due to electromagnetic force
• Undesirable effects due to friction and current reversing
• Continues rotation with multiple coils
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 12
Electric Motor Type Classification
ELECTRIC MOTORS
AC DC
SYNCHRONOUSASYNCHRONOUS
BrushlessInduction StepperSinusoidal
Permanent Magnet
Wound Field
Surface PM
Interior PM
SR
VARIABLE RELUCTANCE
Reluctance
•Robots•Traction Control
•Servo Systems
•Hard Drives•Fans
•Sewing Machines
•Treadmills
•Industrial Machines
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 13
Brushless DC (BLDC) Motors
• Reverse design of brushed motors:� Magnet is on the rotor� Inductors are on the
stator
• Benefits vs. Brushed� No mechanical
commutator(higher speeds)
� Better torque/inertia ration
(higher acceleration)
� Easier to cool(Higher specific outputs)
The confusion arises because a BLDC Motor does NOT directly operate off a DC voltage source
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 14
Brushed and Brushless Motors Comparison
A controller is always required
Complex and expensive
Higher – Permanent magnets
Higher – No mechanical limitation
Flat
Longer
Less required due to absence of brushless
Electronic commutation based on Hall position sensors
BLDC Motor
A controller is required only when variable speed is desired
Simple
Lower
Lower – Mechanical limitations by the brushes
Moderately Flat. Higher speeds produces higher friction and this reduces torque.
Shorter
Periodic maintenance is required
Brushed commutation
Brushed DC motor
Control Requirements
Control
Building Cost
Speed range
Speed/Torque
Life
Maintenance
Commutation
Feature
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 15
Electric Motor Type Classification
ELECTRIC MOTORS
AC DC
SYNCHRONOUSASYNCHRONOUS
BrushlessInduction StepperSinusoidal
Permanent Magnet
Wound Field
Surface PM
Interior PM
SR
VARIABLE RELUCTANCE
Reluctance
•Washing Machines
•Vacuum Cleaners
•Machine tools•Food Processors
•Fans
•Small Appliances
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 16
Switched Reluctance
►Both the rotor and stator have salient poles
►The stator winding is comprised of a set
►of coils, each wound to the stator
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 17
Electric Motor Type Classification
ELECTRIC MOTORS
AC DC
SYNCHRONOUSASYNCHRONOUS
BrushlessInduction StepperSinusoidal
Permanent Magnet
Wound Field
Surface PM
Interior PM
SR
VARIABLE RELUCTANCE
Reluctance
• Cruise Control•Air Vents
•Medical Scanners
•Gauges•Office Equipment
•Printers
•Instrumentation
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 18
Stepper Motor
►These motors turn as different voltages
►are applied to the different windings
►Field rotates in one direction while rotor
►moves in opposite direction of field
►In this example, field rotates 60°while rotor only moves 30°
►It takes four complete cycles of the control system to rotate motor
through one cycle. This is because the Rotor has 4 poles
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 19
Electric Motor Type Classification
ELECTRIC MOTORS
AC DC
SYNCHRONOUSASYNCHRONOUS
BrushlessInduction StepperSinusoidal
Permanent Magnet
Wound Field
Surface PM
Interior PM
SR
VARIABLE RELUCTANCE
Reluctance
•Get name from sinusoidial
windings
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 20
Brushless DC Motor Control
►BLDC Motor versus PMSM Motor• Both motors have identical construction. The difference is in stator
winding only. The BLDC has distributed stator winding in order to have trapezoidal Back-EMF. The PMSM motor has distributed stator winding in order to have sinusoidal Back-EMF.
Phase APhase A Phase BPhase B Phase CPhase C
Trapezoidal Back-EMF voltageSinusoidal winding distribution
Source: Hendershot J. R. Jr, Miller TJE: Design of brushless permanent-magnet motors
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 21
Electric Motor Type Classification
ELECTRIC MOTORS
AC DC
SYNCHRONOUSASYNCHRONOUS
BrushlessInduction StepperSinusoidal
Permanent Magnet
Wound Field
Surface PM
Interior PM
SR
VARIABLE RELUCTANCE
Reluctance
•Large Appliances•HVAC
•Blowers
•Fan Pumps•Industrial Controls
•Lifts
•Inverters
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 22
Induction Machines
No permanent magnets
Think of it as a rotating transformer.
•Stator is the primary
•Rotor is the secondary
Rotor current is “induced” from stator current
Invented over a century ago by Nikola Tesla
• Stator same as BLDC• Difference in rotor
construction
If properly controlled
• Provides constant torque
• Low torque ripple
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 23
AC Induction Motor Slip
rotating Field (ωs)
Torqueωr
Induced current
►Basic Principle: The stator is a classic three-phase
stator with the winding displaced by 120°
The rotor is a squirrel cage rotor in which bars are shorted together at both ends of the rotor by cast aluminum end rings
The rotor currents are induced by stator magnetic field.
The motor torque is generated by an interaction between the stator magnetic field and induced rotor magnetic field
NO BRUSHES, NO PERMANENT MAGNETS
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 24
Electric Motor Type Classification
ELECTRIC MOTORS
AC DC
SYNCHRONOUSASYNCHRONOUS
BrushlessInduction StepperSinusoidal
Permanent Magnet
Wound Field
Surface PM
Interior PM
SR
VARIABLE RELUCTANCE
Reluctance
•Unpractical for large motors
yet practical in small sizes
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 25
Reluctance
►If the rotating field of a motor is de-energized, it will still develop 10
or 15% of synchronous torque
►If slots are cut into the conductor-less rotor of an induction motor,
corresponding to the stator slots, a synchronous reluctance motor
results
►Starts like an induction motor but runs with a small amount of
synchronous torque
TM
Freescale Roadmap for Motor Control
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 27
BLDC In Depth:BLDC Motor Configurations
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 28
Windings Electrical Connection - Star
A
CB
A C
B
A
B
C
Star connection
+
-
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 29
A
CB
A C
B
A
B
C
Delta connection
+
-
Windings Electrical Connection - Delta
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 30
BLDC motor configuration
H1
H2
H3
N
S
N
S
N
S
N
S
4 pole pairs
H1 H2 H31 0 1
A
A
B
BC
C
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 31
BLDC motor configuration
H3
H2
H1
N S
N
S N
S
3 pole pairs
9 coils
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 32
External Rotor – Different Motor Configurations
H1
H2
H3
1 pole pairs
H1 H2 H31 0 1
S
NA
B
C
H1
H2
H3
2 pole pairs
H1 H2 H31 0 1
S
N
S
N
A
A
B
B
C
C
H1
H2
H3
N
S
N
S
N
S
N
S
4 pole pairs
H1 H2 H31 0 1
A
A
B
BC
C
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 33
Internal Rotor – Different Motor Configurations
H1
H2
A C
B
1 pole pair
H1 H2 H31 0 1
H3N
S
H1
H2
A
A
B
C
B
C
2 pole pairs
H1 H2 H31 0 1
H3
N
NSS
H1
H2
A
A
B
C
B
C
4 pole pairs
H1 H2 H31 0 1
H3
N S
N
S
NS
N
S
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 34
Six Step BLDC Motor Control
• Voltage applied on two phases only
• It creates 6 flux vectors
• Phases are power based on rotor position
• The process is called commutation
Power StagePhases voltage
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 35
Brushless DC Motor Control
►Commutation example• Stator field is maintained 60°, 120°relative to rotor field
Before commutation After commutation
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 36
Brushless DC Motor Control
►Six Step BLDC Motor Control cont’d
1
2
3
4
5
6
S
R
T
b
a
cCo
ntr
oll
er
Source: Eastern Air Devices, Inc. Brushless DC Motor Brochure
1
1
0
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 37
Brushless DC Motor Control
►Six Step BLDC Motor Control cont’d
PWM 1
PWM 3
PWM 5
PWM 2
PWM 4
PWM 6
Hall a
Hall b
Hall c
0 60 120 180 240 300 360
Rotor Electrical Position (Degrees)
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 38
Brushless DC Motor Control
►Example of commutation table
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 39
Brushless DC Motor Control
►Sinusoidal BLDC motor control
iS
iSa
iSb
iSc
All three phases are powered by sinewave
shifted by 120°
We are able to generate stator field to
any position over 360°
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 40
Brushless DC Motor Control Summary
►Six step control versus sinusoidal control
� Requires sensor with high
resolution
+ Simple sensor
+ Very quiet� A little noise operation
(due to ripple in the torque)
+ Smooth torque
(stator flux rotates fluently)
� Ripple in the torque
(stator flux jumps by 60°)
� More complex PWM generation
(sinewave has to be generated)
+ Simple PWM generation
Sinusoidal controlSix step control
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 41
Sensor Example: Hall Effect Sensor
►Hall effect sensor is a transducer that varies its output voltage in
response to changes in magnetic field
►Hall sensors are used for proximity switching, positioning, speed
detection and current sensing applications
►In this case, hall sensors are used in On/Off mode
Everytime a
magnetic field is
sensed, a change in
voltage can be
detected
Permanent Magnet
Hall Sensor
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 42
Putting All Together
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 43
Lab1
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 44
How to Set Up the Boards
1. Power
Supply
(9V DC)
2. BDM
3.BLDC
Motor
6. Jumper
J13
APMOTOR board
AC16 board
7. 8
LED
array 3
2
1
J13
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 45
Create a New CodeWarrior Project1. Click on the Open
Icon
4. Click next
2. Select the
MC9S08AC16 MCU
3. Select P&E
Multilink/Cyclone Pro
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 46
Name Your CodeWarrior Project
1. Set new name for
your project
2. Select Project Path
3. Click next
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 47
Add Additional Files
1. Select
AC16DaugherCard.h
2. Add To Project Files
3. Click next
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 48
Processor Expert
1. Click next
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 49
C Options
1. Click next
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 50
PC-Lint Options
1. Click Finish
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 51
New Project Set Up
1. Click On Make
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 52
Commutation Table & Knowing Position with Hall Effect sensors
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 53
Necessity of Knowing the Position
►To spin 3-phase BLDC motor:• Detect position/commutation
• Read commutation table
• Mask and swap phases
It is important to
know the rotorposition in order to
maintain the rotating
magnetic field
60° 120° 180° 240° 300° 360°
H1
H2
H3
A-B
B-C
C-A
+
_
+
_
+
_
10
10
10
Supplied motor voltage
Signal sequence diagram for the hall
sensors
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 54
3-Phase Inverter
Q1
Q4
Q2
Q5
Q3
Q6
A
B
C
Vb
0v
With the 3-phase
inverter, you cancontrol which
phases need to be
fed in order to
turn the motor
Q1, Q2 and Q3 is
where the current goes in
the motor and Q4, Q5
and Q6 is where thecurrent goes out
of the motor
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 55
BLDCMotor
A
C BA’
C’B’A
BCN
S
Control of 3-Phase Inverter Determined on the Hall Sensor Position
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 56
+VDCB-VDCBNC100
+VDCBNC-VDCB110
NC+VDCB-VDCB010
-VDCB+VDCBNC011
-VDCBNC+VDCB001
NC-VDCB+VDCB101
Phase C
Phase B
Phase A
H3H2H1
Control of 3-Phase Inverter Determined on the Hall Sensor Position
A
C BA’
C’B’
NS
BLDCMotorA
BC
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 57
+VDCB-VDCBNC100
+VDCBNC-VDCB110
NC+VDCB-VDCB010
-VDCB+VDCBNC011
-VDCBNC+VDCB001
NC-VDCB+VDCB101
Phase C
Phase B
Phase A
H3H2H1
Control of 3-Phase Inverter Determined on the Hall Sensor Position
A
C BA’
C’B’N
S
BLDCMotorA
BC
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 58
+VDCB-VDCBNC100
+VDCBNC-VDCB110
NC+VDCB-VDCB010
-VDCB+VDCBNC011
-VDCBNC+VDCB001
NC-VDCB+VDCB101
Phase C
Phase B
Phase A
H3H2H1
Control of 3-Phase Inverter Determined on the Hall Sensor Position
BLDCMotor
A
C BA’
C’B’A
BCN S
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 59
+VDCB-VDCBNC100
+VDCBNC-VDCB110
NC+VDCB-VDCB010
-VDCB+VDCBNC011
-VDCBNC+VDCB001
NC-VDCB+VDCB101
Phase C
Phase B
Phase A
H3H2H1
Control of 3-Phase Inverter Determined on the Hall Sensor Position
BLDCMotor
A
C BA’
C’B’A
BCN
S
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 60
+VDCB-VDCBNC100
+VDCBNC-VDCB110
NC+VDCB-VDCB010
-VDCB+VDCBNC011
-VDCBNC+VDCB001
NC-VDCB+VDCB101
Phase C
Phase B
Phase A
H3H2H1
Control of 3-Phase Inverter Determined on the Hall Sensor Position
BLDCMotor
A
C BA’
C’B’A
BC
NS
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 61
+VDCB-VDCBNC100
+VDCBNC-VDCB110
NC+VDCB-VDCB010
-VDCB+VDCBNC011
-VDCBNC+VDCB001
NC-VDCB+VDCB101
Phase C
Phase B
Phase A
H3H2H1
Control of 3-Phase Inverter Determined on the Hall Sensor Position
BLDCMotor
A
C BA’
C’B’A
BC
NS
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 62
Lab 1
►Make a program that moves the motor in the clockwise direction• On/Off transistors
TO DO:
•Enable Switch1 to enable commutations
•Enable 3-Phase Inverter
•LEDs will still reflect HALL Effect sensors
•Each time Switch1 is pressed, we will advance one step in the commutation table
•Commutation table will tell us which transistors to turn on
•When Switch1 is not pressed, turn OFF transistors
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 63
Import Table Add Variables, Enable Switch1, Enable Inverter
void main(void) {
EnableInterrupts; /* enable interrupts */
/* include your code here */
ENABLELED(1);
ENABLELED(2);
ENABLELED(3);
for(;;) {
extern unsigned char table_rotate[8];
unsigned char value;
unsigned char commutation;
ENABLESWITCH(1);
ENABLE3PHASEINVERTER();
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 64
Wait for Switch1 to be Pressed
for(;;) {
__RESET_WATCHDOG(); /* feeds the dog */
LED1_PIN = HALL_1;
LED2_PIN = HALL_2;
LED3_PIN = HALL_3;
if(!SW1_PIN)
{
}
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 65
Once Pressed, Advance Counter, Commutate
for(;;) {
__RESET_WATCHDOG(); /* feeds the dog */
LED1_PIN = HALL_1;
LED2_PIN = HALL_2;
LED3_PIN = HALL_3;
if(!SW1_PIN)
{
value++;
if(value>=7) value = 1;
commutation = table_rotate[value];
if(commutation & Q1_MASK) Q1 = 1;
if(commutation & Q4_MASK) Q4 = 1;
if(commutation & Q2_MASK) Q2 = 1;
if(commutation & Q5_MASK) Q5 = 1;
if(commutation & Q3_MASK) Q3 = 1;
if(commutation & Q6_MASK) Q6 = 1;
}
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 66
Wait for Switch to be Released
if(commutation & Q3_MASK) Q3 = 1;
if(commutation & Q6_MASK) Q6 = 1;
}
while(!SW1_PIN)
{
__RESET_WATCHDOG();
LED1_PIN = HALL_1;
LED2_PIN = HALL_2;
LED3_PIN = HALL_3;
}
TURNOFFTRANSISTORS();
IT IS IMPORTANT TO
TURN OFF
TRANSISTORS!
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 67
Download and Run Code
1. Click On Run
2. Click On Connect
on the Debugger
3. Click On Yes To
Reprogram the MCU
4. Click On Run
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 68
Lab2
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 69
Lab 2
►Make a program that move the motor in clockwise direction• On/Off transistors
TO DO:
• Enable Switch5 to enable commutations
• Check Hall Effect sensors to evaluate which commutation state motor is in
• When Hall Effect sensors changes state, transistors will commutate
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 70
Add Variables, Enable Switch5
void main(void) {
EnableInterrupts; /* enable interrupts */
/* include your code here */
ENABLESWITCH(1);
ENABLELED(1);
ENABLELED(2);
ENABLELED(3);
ENABLE3PHASEINVERTER();
for(;;) {
ENABLESWITCH(5);
unsigned char pasthallsensors;
unsigned char hallsensors;
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 71
Wait for Switch5 to be On
for(;;) {
__RESET_WATCHDOG(); /* feeds the dog */
LED1_PIN = HALL_1;
LED2_PIN = HALL_2;
LED3_PIN = HALL_3;
while(SW5_PIN)
{
}
TURNOFFTRANSISTORS();
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 72
Once On, Display and Check Hall Effect Sensors
while(SW5_PIN)
{
__RESET_WATCHDOG(); /* feeds the dog */
LED1_PIN = HALL_1;
LED2_PIN = HALL_2;
LED3_PIN = HALL_3;
}
hallsensors = 0;
if(HALL_1) hallsensors |= 0x04;
if(HALL_2) hallsensors |= 0x02;
if(HALL_3) hallsensors |= 0x01;
if(pasthallsensors != hallsensors)
{
/* Do something */
}
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 73
Once On, Display and Check Hall Effect Sensors
if(pasthallhensors != hallsensors)
{
}
pasthallsensors = hallsensors;
value++;
if(value>=7) value = 1;
commutation = table_rotate[value];
TURNOFFTRANSISTORS();if(commutation & Q1_MASK) Q1 = 1;
if(commutation & Q4_MASK) Q4 = 1;
if(commutation & Q2_MASK) Q2 = 1;
if(commutation & Q5_MASK) Q5 = 1;
if(commutation & Q3_MASK) Q3 = 1;
if(commutation & Q6_MASK) Q6 = 1;
IT IS IMPORTANT TO TURN OFF
TRANSISTORS!
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 74
Download and Run Code
1. Click On Run
2. Click On Connect
on the Debugger
3. Click On Yes To
Reprogram the MCU
4. Click On Run
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 75
Sensorless Sensing
►Based on BEMF• Speed range from 5-10% up to
100% of nominal speed� The BEMF must be high enough
►Based on Motor Inductance
Saliency• Speed range from standstill to
about 20% of nominal speed
►Sensors are expensive and take up space
►Several techniques can be used to determine the motor
position/speed without an external device
►These techniques are based on the electrical characteristics of
motors, mainly on their inductance characteristics:
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 76
BEMF
- BEMF is just an acronym for Back Electromagnetic Force
- Back electromagnetic force is a fancy term for the generator
characteristics of a motor
- As has been shown not all phases of the motor are on at the
same time
- BEMF voltage can be measured on the inactive phases of the
motor
- The characteristics of the voltage curve generated by BEMF
can tell the position/speed of the motor
- The method that will be exposed is the zero crossing method.
When BEMF voltage equals zero, the motor is in a specific
position
- By measuring the zero crosses against time, the speed of the motor can be determined
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 77
BLDC Motor Back-EMF Shape
Phase A
Phase A-B Voltage Phase B-C Voltage Phase C-A Voltage
Phase B Phase C
0V
A
C B
CH4
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 78
Sensorless BLDC Motor Control with BEMF Zero-Crossing Detection
Zero Crossing event
detected
Appropriate Phase Comparator Output selected
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 79
Sensorless Commutation and BEMF
PWM 1
PWM 3
PWM 5
PWM 2
PWM 4
PWM 6
Phase R
Phase S
Phase T
0 60 120 180 240 300 360
Rotor Electrical Position (Degrees)
Zero crossings
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 80
BLDC Central Point is Not Accessible
►3-phase inverter and DC bus current measurement
Inverter Stage
Rshunt
Idcbus
Udcbus
0VB
AC
HB2
HB3
BLDC
Motor
HB1
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 81
Zero Crossing Sensing Reference
►BLDC Motor central point is not accessible
+-
+
-
+-
0VB
AC
HB1
HB2
HB3
+-
+-
+-
0VB
AC
HB1
HB2
HB3
Udcb+-
+
-
+-
0VB
A
HB1
HB2
HB3
• Virtual CP reference
• ½ UDCB reference • GND reference
Rshunt
Idcbus
Udcbus
0VB
AC
HB2
HB3
BLDC
Motor
HB1
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 82
Zero Crossing Sensing using ADC
►The principle is the same as the HW topology, but more flexible
0VB
AC
HB1
HB2
HB3
0VB
AC
HB1
HB2
HB3
Udcb
0VB
A
HB1
HB2
HB3
• Virtual CP reference • ½ UDCB reference • GND reference
ADC1
ADC2
ADC3
ADC4
ADC1
ADC2
ADC3
ADC4
ADC1
ADC2
ADC3
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 83
Application Details
►ADC Measurement – Back-EMF evaluation
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 84
Back-EMF Detection Window
0 30 60 90 120 150 180 210 240 270 300 330 360 390
uVA
uSa
- “visible” Back-EMF
detectable zero crossing
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 85
Lab3
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 86
Sensorless BLDC Motor Control using MC9S08AC►Application Diagram
BLDC motor
PH A,B,C
3-phase inverter3
3
6
DC current sensing
Power supply
9 Vdc
3.3V
6 PWM
4 ADC inputs
Fault LED
Direction LED
Run/Stop status
PB_A
PB_B
SW
3 outputs
3 inputs
AC microcontroller
BDMFreemaster on PCRead/set variables
APMOTOR board
Zero-cross detection circuit
3
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 87
Sensorless BLDC Motor Control using MC9S08AC
►MC9S08AC Peripheral Utilization
• Timer 1� 6 channels: PWM modulation for BLDC motor (complementary bipolar)
• Timer 2� Time base for commutation period measurement
� Channel 0: commutation
� Channel 1: timing of application
• A/D Converter� DC bus current, phase voltages (zero-cross detection)
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 88
►Proportional Control• Error multiplied by constant
• Deals with present behavior
PI Control
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 89
PI Control
►Integral Control• Ads long-term precision
• Takes longer to settle, but provides better precision
• Deals with past behavior
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 90
PI controller on AC MCU
This is the controlAlgorithm inplemented
In AC16 MCU for
Motor control
These variables are used
To tune the system
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 91
PWM and manual dead time insertion
►PWM Generation ► TIMER set to center aligned mode
(TPM1SC:CPWMS=1)
► Example:• PWM0: switching (duty cycle (50 - 100%) + dead
time), negative polarity (TMP1CxSC:ELSnB
=x,TMP1CxSC:ELSnA =1)
• PWM1: switching (duty cycle (50 - 100%) - dead
time), positive polarity (TMP1CxSC:ELSnB
=1,TMP1CxSC:ELSnA =0)
• PWM2: switching (duty cycle (50 - 100%) - dead
time), positive polarity (TMP1CxSC:ELSnB
=1,TMP1CxSC:ELSnA =0)
• PWM3: switching (duty cycle (50 - 100%) + dead
time), negative polarity (TMP1CxSC:ELSnB
=x,TMP1CxSC:ELSnA =1)
• PWM4: OFF
• PWM5: OFF
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 92
Dead Time
Q1
Q4
Q1
Q4
a) Center aligned PWM, Q1 and Q4 change in the same instant, it can short circuit between Vb and GND
b) Center aligned PWM, Q1 and Q4 triggered with different PWM duty cycle avoiding that both transistors turn on at the same time.
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 93
Application Details
►ADC Measurement• DC bus current, Back-EMF voltage
• Single result register only
• 3.5 us conversion time
• ADC measurement has to be synchronized with PWM
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 94
Application Details
►ADC Measurement – PWM -> ADC Synchronization
Overflow interrupt is used for PWM->ADC synchronization
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 95
Application Details
►ADC Measurement – Back-EMF evaluation
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 96
FlexTimer in the MCF51AC
This part pending because dev board was delivered on April 29
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 97
FlexTimer advantages
► Supports up to 8 channels which can be synchronized in pairs for complementary signal generation.
► Dead time insertion supported by software.
► FTM can trigger ADC conversions automatically.
► Fault input supported by hardware (automatically turns of PWM pin outputs).
► Synchronized reloading of PWM duty cycle from several sources (ADC, analog comparator, software).
► Polarity for PWM output can be configured.
► Edge and center alligned PWM generation.
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 98
Dead time insertion
► Used to avoid to power devices to
be turned on at the same time.
• No CPU load generated to make
dead time insertion.
• To configure simply enable dead time insertion bit and configure the number of timer counts of dead time, the rest is done by timer module.
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 99
ADC Synchronization
► Reduces CPU load by saving time needed to start conversions (todetect zero-crossings or instantaneous current.
► When doing back-EMF sensing measurements need to be made in certain timing windows. If measurements are always taken at the same times, control algorithm is more precise.
►Without hardware trigger With hardware trigger►T = t1 + t2 + t3 T = t1 + t3
Manual start of ADC conversiont11
Timer Channel ISR
ADC conversion
t31
ADC Channel ISR
t2
Process ADC data
Automatic start of ADC conversion
Timer Channel ISR
ADC conversion
t3
ADC Channel ISR
t1
Process ADC data
TMFreescale Semiconductor Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2008. 100
Related Session ResourcesSessions (Please limit to 3)
Session ID
Demos (Please limit to 3)
Pedestal ID
Meet the FSL Experts (Please limit to 3)
Title
Motor Control Part 3 – Solutions for Small Appliances and Health Care ApplicationsAZ120
Motor Control Part 2 – Solutions for Large Appliances and HVACAZ121
Motor Control Part 1 – Fundamentals and Freescale SolutionsAZ131
Title
Air Hockey Demonstration featuring the Flexis AC Products
706
3-Phase PMSM Vector Control demo with Encoder214
Large Appliance Demo312
Demo Title Time Location
TM