Title of Presentation Two or three lines White Bold - 36 pt

Download Report

Transcript Title of Presentation Two or three lines White Bold - 36 pt

Motor Control with
PSoC
Objectives
Objective:
To explain the physics of different types of
electrical motors.
Show conventional and PSoC solutions for
motor controllers.
2
Permanent Magnet
DC Motors
A Primer
Operation relies on the following
physical properties.
• Opposite magnetic fields
attract.
• Like magnetic fields oppose.
• A current running through a
wire produces a magnetic
field orthogonal to the current
flow.
• These attracting and
opposing forces produce
rotational motion. Axle
3
N
North
South
Brushes
Axle
Commutator
Armature
Field Magnet
Permanent Magnet
DC Motors
A Primer
As the armature rotates, the
commutator and brushes form a
switch that disconnects the
armature windings and reconnects
them to generate an armature field
in the opposite direction.
• This causes the armature to
continue to rotate, trying to
attract the new opposite
pole.
• Of course, the commutator
and brushes switch back
and the cycle starts all over
again.
4
N
North
South
Brushes
Axle
Commutator
Armature
Field Magnet
Permanent Magnet
DC Motors
A Primer
Neglecting the inductance of the
armature, the following circuit
diagram is an electrical model of a
simple motor.
I
V
•
•
•
•
V := power source
I := current
R := armature coil resistance.
Ebemf := voltage generated
across the motor due to the
back electromotive force.
• T := torque
• w:= shaft speed
5
R
T,w
Ebemf
Permanent Magnet
DC Motors
A Primer
The three equations shown define the
motor operation.
I
Kv, Km and R are the Transducer
Equations for a motor.
R
V
T,w
Ebemf
• They are dependent on motor
model and manufacturer.
If the shaft turns fast enough,
Ebemf  V
the current flips direction and the
motor becomes a generator.
6
V  IR  Ebemf
Ebemf  K vw
T  Km I
Permanent Magnet
DC Motors
A Primer
An increase in torque
T
• causes an increase in current
stall
• causing more voltage to be lost
in the armature resistance.
• causing less voltage to be
made available to the
motor.
• causing slower shaft
speed.
Torque vs Speed Plot
For a constant supply voltage
• As torque increases, speed
decreases.
• As torque decreases, speed
increases.
The equations shown give the stall
torque and no load speed.
7
wnoload
K mV
Tstall 
R
w
V
wnoload 
Kv
Permanent Magnet
DC Motors
DC Motor Controller
Requires a programmable
power source.
V
• Pulse Width Modulated
Power FET.
Using measured current to
control power source allows for
torque control.
• Requires current shunt.
Using shaft speed to control
power source allows for speed
control.
• Calculate Ebemf.
• Or external tachometer.
8
M
Vm
PWM
Vi
Rs
ADC
Permanent Magnet
DC Motors
DC Motor Controller
When the PWM is high
• FET is on
Vi  I  Rs
Vm  I  Rs  rdson 
When the PWM is low
• FET is off
Vi  0
Vm  V  Ebemf
9
V
M
Vm
PWM
Vi
Rs
ADC
Permanent Magnet
DC Motors
DC Motor Controller
And of course there is always ringing on these signals.
V
M
Vm
PWM
Vi
ADC
V
Vm
Vi*10
PWM
Rs
The conventional solution is to sample these signals fast enough to
determine the value of the settled signals.
But why settle for conventional?
10
Permanent Magnet
DC Motors
DC Motor Controller
PSoC configurable analog
and digital blocks allow for
the construction of an
Incremental ADC with a builtin synchronous 8 bit PWM.
It integrates the signal over an
integer number of PWM cycles.
• Requires a single digital block.
• One or two SCBlocks.
• Single or double ADC
Modulator
• 6 to 14 bits resolution.
11
ADC
PWM
Sample input
Process
Answer
An 8 bit ADC samples over 4
complete PWM cycles.
Permanent Magnet
DC Motors
The PSoC DC Motor Controller
Given a PWM duty cycle of a.
V
Vi  I  Rs  a
Vm  I  Rs  rdson   a  V  Ebemf  1  a 
M
Vm
Combining these equations results in
solutions for the average current (torque)
and Ebemf (speed).
I
Vi
Rs
Ebemf 
Rs
Vi  Rs  rdson 
V
V  m
Rs  1  a 
1a
Any signal ringing is removed by the
integrating of the signals.
12
Vi
ADC
PWM
Permanent Magnet
DC Motors
The PSoC DC Motor Controller
Able to fit in Cy8C22xxx family of parts.
• Very low cost solution
13
Permanent Magnet
DC Motors
DC Motor Controller
Harmonic Noise
The PWM is configured as a down
counter with the duty cycle value
stored in a compare register.
When the count becomes less than
the compare value, the PWM output
goes high.
For a duty cycle of 50% the output
is low for the first half of the count
and goes high the remaining 50%.
This relatively slow changing signal
produces a significant amount of
harmonics as shown in the plot to
the right.
14
VH
VL
Permanent Magnet
DC Motors
DC Motor Controller
Psuedo Random Pulse Width
Modulation
If the PWM is configured with a
pseudo random counter instead of
the normal down counter, the
compare value still causes the same
percentage of high states. But now
they are randomly dispersed.
For a compare value of 50%, the
output at any given time has a 50%
probability of being high.
This dithering of the PWM output
significantly removes harmonic
noise as shown in the plot to
the right.
15
VH
VL
Electromagnetic
DC Motors
Electromagnetic
DC Motors
The field magnets are replaced
with a electromagnetic field coil.
If the field winding is connected
in series with the armature
winding, the motor is know as a
Series Motor.
N
North
South
Brushes
Axle
Commutator
Armature
Commutator
M
16
Field Winding
Electromagnetic
DC Motors
Electromagnetic
DC Motors
With the field winding now in series with
the armature, the direction is independent
of input voltage polarity.
M
CW
M
CCW
The armature must be “reversed” in
reference to the field windings for the
motor to turn in the opposite direction.
Since the motor can be run with either
polarity of input voltage, it can be run with
an AC input.
17
Universal Motors
Universal Motor
A brushed motor with series field windings,
designed to run with either an AC or DC
input. The series coupled field windings
make for excellent start up torque.
Called “universal” because it can operate
with most any power source. Invented by
Thomas Edison, so it has been around a
long time. (For good reason, it’s cheap!)
Small and light weight, it delivers more
power than other equivalently sized motors.
Good for commercial and consumer
applications where the motor is not
continuously run.
18
• Hair dryers
• Power Hand tools
• Vacuum Cleaners
M
Mains
Universal Motors
Universal Motor
Commutator Noise
Series Motor
• Constant Power
Runs on either AC or DC
• Direction determined by
commutator connection.
Voltage across the Commutator
is:
• Mains power less the voltage
drop across the field coils.
• Inductive switching pulses for
brush switching.
19
Com+
Mains
M
Com-
Universal Motors
Commutator Noise
Amplitude of pulses is:
• Proportional to the voltage
across the commutator.
Frequency of pulse is:
• Dependent on rate of switch
changes.
• Proportional to shaft speed.
(RPM) determined by
commutator switching.
If the mains power component
can be suppressed, the pulses
can easily be digitized.
20
Com+
Mains
M
Com-
Universal Motors
Slew Rate Limited Pulse
Separator
Amplifier allows low frequency
signals (Mains Power) to pass.
Fast Slewing signals
(Commutator Noise) are
blocked, leaving only the
pulses at the output of the Diff
Amp.
Forms an effective phase neutral
high pass filter.
• No distortion of Pulses
• No Delay
21
Vin
Diff Amp
Vout
Slew Limited
OpAmp
Universal Motors
PSoC Implementation
of Slew Rate Limited
Pulse Separator
M
1M
1M
1k
SENSE+
1k
SENSEPulseDetect
Presently implemented
with:
Compare
• 6 Analog Blocks
• 2 Digital Blocks
27k
.1uF
For Production
Implemented with:
• 5 Analog Blocks
• 1 Digital Block
Remaining Resources:
22
• 58% of Analog Blocks
• 87% of Digital Blocks
• 100% of CPU
AGND
InAmpOutVout
Vout
Universal Motors
PSoC Implementation
of Slew Rate Limited
Pulse Separator
Scope Traces show that the
60Hz signal is removed with no
visible distortion of pulses.
Pulses can easily be digitized
• (and counted)
A Slew Rate Limited Pulse
Separator allows for the easy
extraction of commutator pulses.
The PSoC architecture allows for
a low cost implementation
without the addition of external
active components.
23
Universal Motors
Triac Motor Controller
M
A triac is a semiconductor AC
Switch used to switch AC
power.
200
150
100
50
Volts
Once triggered, a triac
remains on until the current
passing though it falls below
a near zero (Holding Current)
value.
Mains
• Once triggered in a particular
half cycle, a triac stays on
until that cycle ends.
0
-50
-100
-150
-200
-250
24
Triac
Driver
Mains Power
Triac Trigger
Voltage across Motor
Universal Motors
Triac Primer
MT2
The figure to the right shows
the simple block construction
of a triac.
N
It is a junction device where
the gate sets up a conduction
path between MT1 and MT2.
N
There are four Quadrants of
operation.
25
P
N
Gate
P
N
MT1
Universal Motors
Triac Primer
Gate sensitivity is best
in quadrants I and III.
MT2 Positive
N
If quadrants I and III can
N
not be used, the next
Gate
best choice is quadrants -IGT
II & III.
N
Quadrant IV is not always
an allowable operation
mode for all triacs.
MT2
MT2
N
P
P
N
N
P
N
N
MT1
P
Gate
QII QI
QIII QIV
+IGT
MT2
MT2
N
P
P
N
N
Gate
N
MT1
P
N
N
MT1
N
P
Gate
N
MT1
MT2 Negative
If the physical diagrams help understand triac operation then great!
If not, it’s okay to think of triacs as magical AC Switches!
26
Universal Motors
Triac Motor Controller
Operates in quadrants II and III.
• Trigger generates negative
transient pulse.
• This triac is good for 400Volts
and 25 amps.
M
Vdc
Mains
1k
Trigger generated with a PWM8
• Clock is 25kHz
• Pulse width is 3 counts
• 120usec
• Delay is the period minus the
pulse width,
• Delays from 0 to 253 counts
• 0 to 10.1msec
27
47 4.7uf
2n2222
trigger
330
Q4025L6
Universal Motors
Triac Motor Controller
PWM initialized for a delay of
101-3 counts.
• 4.04msec
Connect to mains power
The PWM interrupts at the
falling edge of the pulse.
The PWM is stopped
The PhaseIn pin is read
The PWM is set to be enabled
on the opposite PhaseIn
polarity.
The PWM is started again.
This interrupt insures that the
PWM starts timing at the
transition from one polarity to
another.
28
1Meg
Induction AC Motors
Simple AC Motor
N
North
A free turning magnet is mounted
between the poles of an electromagnet.
The alternating polarity of the
electromagnet (stator ) causes the freeturning magnet (rotor) to turn.
South
Axle
S
Rotor
(Magnet)
Stator Winding
29
Induction AC Motors
Simple AC Motor
The magnetic rotor is replaced with an
electromagnetic rotor.
The current to supply the rotor winding
is supplied by the magnetic field of the
Stator (It’s a transformer). It is called
an induction motor because the rotor
current is inducted from the stator
field.
N
North
South
Axle
S
Rotor
Winding
Stator Winding
30
Induction AC Motors
Squirrel Cage Motors
The rotor is constructed of a number of
conducting bars running parallel to the
axis of the motor and two conducting
rings on the end.
As the alternating current is passed
through the stator windings, a moving
magnetic field is formed near the stator.
This induces a current in the rotor,
creating it own magnetic field.
The interaction of these fields
produces a torque on the rotor.
•
(It spins).
Called a squirrel cage rotor because of
it’s resemblance to a pet’s running wheel.
31
Induction AC Motors
Slip in Induction Motors
The frequency of the supplied AC current
determines the speed at which the stator
field rotates.
The rotor follows somewhat behind this
field, turning at a slower pace.
• This difference is called slip.
The greater the torque, the greater the slip.
• Slip is generally no greater than 5%
32
Induction AC Motors
Different types of Induction
Motors
Single Phase
Rotor
Single Phase.
• Can’t start up by itself.
Split Phase
• Extra stator winding generating a field
+/= 90 degrees out of phase. This
allows the motor to start in a
predictable direction.
Split Phase
Rotor
• The second field can be coupled with a
capacitor to generate the required
phase.
Three Phase
• The smoothest operation of all.
• Requires three field drives. (Inverters)
33
Three Phase
Rotor
Induction AC Motors
Inverters for Three
Phase Drive
Requires three centeraligned PWMs
• A single center-aligned PWM
can be constructed with 2
PWM8s and a digital row lut.
Each PWM must be 120 degrees
out of phase from each other.
•
•
•
•
0, 120 240
1, 121, 241
2, 122, 242
etc
+Vd
P1
P2
P3
P3
-Vd
PWM_A
PWM_B
A and !B
34
P2
P1
Induction AC Motors
PSoC Three Phase
Center- Aligned PWM
Controller
Requires software control to keep
changing phases all 120 degrees
apart.
35
Induction AC Motors
PSoC Three Phase
Psuedo Random Pulse
Width Modulation
Controller
Requires three PRPWMs.
• Each must have phase
probabilities 120 degrees
apart from each other.
• Also requires software
control to keep changing
phases all 120 degrees apart.
36
PSoC Motor Control
And we are out of time!
Stayed tuned for future Webcasts where:
• DC Synchronous Motors
• DC Brushless Motors
• DC Stepper Motors
Will be discussed.
37
Summary
A fundamental understanding the physics of
motor operation makes designing motor
controllers very straight forward.
The PSoC microcontroller offers flexible
resources allowing the construction of several
types of motor controllers.
PSoC’s unique capabilities allow the design
of motor controllers not possible with
conventional micro-controllers.
38
Questions
39