Uploaded by chuanlong zhai

01 Control Structures

advertisement
2014 Texas Instruments Motor Control Training
POSITION REGULATOR
SPEED REGULATOR
MODULATION
CURRENT REGULATOR
INTEGRATOR
CLAMPED
INTEGRATOR
{ I_cur rent/Fs_curr ent}
E11
Range={ 2.2*I_limit} , bits=10
{ I_speed/Fs_speed}
Z -1
max
cur r ent
E2
Z
Clk1
Clamp
min
Clk2
ADC
clk
-1
clk
V4
ADC Tr igger
{ Speed_limit}
{ I_lim it}
Position_Er r or
Curr ent_Er r or
PULSE(-1 1 { 20uS + p/2 - T_aper tur e} 0 0 { T_aper tur e} { p} 100000)
V1
V16
25
i_sam pled
V17
{ P_pos/quadcounts}
{ P_speed}
max
E1
Position_Comm and
PWM Module Reload
E12
I_com mand
z.o.h.
clk
Clamp
min
max
{ P_curr ent}
E5
Speed_command
Radians/sec
V7
max
z.o.h.
z.o.h.
clk
Clamp
min
clk
Clamp
min
Quantize
Range=50, levels=760
25
Clk1
Speed_Er r or
V5
V19
Clk2
V22
V3
PULSE(-1 1 { 2*T_apertur e} 0 0 {T_apertur e} {1/Fs_speed} 100000)
{ -Speed_limit}
PWM Car r ier
PULSE(-24 24 20uS { p/2} { p/2} 0 {p} 100
V15
V18
PULSE(-1 1 10uS 0 0 {T_apertur e} {1/Fs_curr ent} 100000)
{ -I_limit}
PULSE(-1 1 { 20uS + p - T_aper tur e/2} 0 0 { T_aper tur e} { p} 100000)
Speed^
LOAD
Motor Model (Pittman DC Servo Motor
Model 14206 with 24V Winding)
VELOCITY OBSERVER
B1
cur r ent
INTEGRATOR
INTEGRATOR
INTEGRATOR
V=I(L1)
Pos _ e nc ode r
{ I_vo/Fs_speed}
{ 1/Fs_speed}
E6
{ 1/Fs_speed}
E14
PWM
E17
Z -1
Clk0
L1
Z -1
Clk0
clk
{ L}
Z -1
Clk0
clk
Radians
e r ror _ v o
E18
i.c.
Damping Losses
{ 1/(Jmotor + Jload)}
E4
Speed
{ P_vo}
R2
{ Rt}
E9
z.o.h.
Counts
E3
clk
{ Kem f}
{ 2* pi/quadcounts}
{ Kd}
Pos_vo
Tor que
Radians/sec
Speed
E7
i.c.
clk
RPM
Pos _ v o
M1-
Clk0
V14
i_sam pled
lock
r otor
load
tor que
{ 1/Jt_est}
E10
{ Kt_est}
Tor que^
V13
E8
0
{ 30 / pi}
Load
E13
E16
Acceler ation^
0.5
PULSE(-1 1 0 0 0 { T_aper tur e} { 1/Fs_pos} 100000)
Z -1
Clk0
{ B_vo/Jt_est}
clk
B3
V12
Friction
Motor Bear ings and Brushes
V=I(L1)* Kt
PWL(0 0 0.0999999 0 0.1 0.6)
max
V6
To put motor on a dyno, set jumper to "lock r otor "
and then use integr ator i.c. voltage source to specify dyno speed.
E15
{ Kf}
Clamp
min
V11
{ -Kf}
-Vth
Dave Wilson
Feed-Forward Approach
What you want
Controller
(G2)
1
G2 =
G1
Dave Wilson
Process
(G1)
What you get
Unadjustable, but perfectly predictable
Everything is
beautiful and linear!
TI Spins Motors…Smarter, Safer, Greener.
Feedback Approach
The System
(G)
What you want
Comparator
+
What you get
Controller
(G2)
Process
(G1)
the difference
Unadjustable,unpredictable,
and often non-linear!
G
What you get =
What if G = 1?
Dave Wilson
What you want
1+G
What about 100?
TI Spins Motors…Smarter, Safer, Greener.
Frequency Response of a Feedback Loop
Every system in nature has poles in its transfer function
Comparator
What you want
+
System
G(s)
What you get
Gain is really a function of frequency
Poles negatively impact the control system in the following ways:
增益
1. Gain is reduced at higher frequencies
2. Phase delay is introduced (90º for every real pole)
What you get =
-what you want
What happens if the phase delay = 180º and gain = 1 ?
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Designing a Feed-Forward Compensator
Example:
y (t ) 10x (t )
2
Desired
Output
1
2
d
dt
y (t ) 10 x(t )
Plant
Input
1
s

G(s ) 2
Feed-forward
Compensator
激励信号

2 dt
G(s ) 
y (t ) 10x 2 (t )
2
s
System
Output
Plant
前馈补偿器
The thought process goes something like this: “To achieve a desired
output, what stimulation signal is required at the plant input to get
that output? By knowing the plant transfer function in the forward
direction [G(s)], I find the transfer function looking backwards through
the plant [1/G(s)], and that becomes the transfer function of my
feedforward filter.”
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Real Feed-Forward Example:
PWM Modulation
TI
Dave’s
Control
Center
AC Mains
Vdesired = volt-sec average of PWM signal
Vbus(t)
Vdesired
1
Vb usavg
PWM Scaling
Duty Cycle
1
PWM
Module
1:1
Plant
0
Uncompensated
PWMs
Vbust 
0
Modulation
Process
When Vbus(t) is equal to Vbusavg, then “what you want” and “what you get” are equal.
However, when they are NOT equal, the output deviates from the desired input.
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Solution: Feed-forward Compensation
TI
Dave’s
Control
Center
AC Mains
Vdesired
Vdesired
Vbusavg
Vbus(t )
Feed-forward
Compensator
1
Vb usavg
Duty Cycle
PWM Scaling
使Vd跟随Vbus波动,Vbus减小-Vd增大
When you multiply through the gain
blocks, you will see that the composite
gain = 1, which again implies that “what
you get” equals “what you want”.
Dave Wilson
1
PWM
Module
1:1
0
Compensated
PWMs
Vbust 
Modulation
Process
Plant
Motor Current
Without F-F Compensation
TI Spins Motors…Smarter, Safer, Greener.
Motor Current
With F-F Compensation
Feedback or Feedforward…
Which is Best?
More traditional approach
Best for disturbance rejection
扰动
Better stability
Best for trajectory tracking
Requires System Dynamics Knowledge
Source: Myths and Realities of Feedforward for Motion Control Systems,
Curtis Wilson, Delta Tau Data Systems, PCIM – August, 1994
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Cascaded Control Structures
Position Loop
Velocity Loop
Torque Loop
Commanded
Position +
PI
-
Commanded
Velocity +
PI
-
Commanded
Current +
TI
Dave’s
Control
Center
PI
-
Measured Current
Measured Velocity
Velocity
Processor
Measured Position
每个级联回路带宽要求?
What do you think the bandwidth requirements are
for each cascaded loop?
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Parallel PI Controller
Kp
Commanded
Value
+
Error
+
Output
+
-
Measured
Value
∫
Ki
Amplitude (dB)
Kp term specifies the gain at higher frequencies
Ki term specifies the gain at lower frequencies
0.1
Kp term
1
10
100
1000
Frequency
Controller “zero”
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Series PI Controller
Commanded
Value
Error
+
Ka
-
∫
Kb
Output
+
+
Measured
Value
Amplitude (dB)
Ka is simply a gain term for all frequencies
Kb is equal to the controller’s “zero” in rad/sec
Ka
Ka
Popular with
Current Contollers
0.1
1
10
Kb
100
1000
Ka  K p
Ki
Kb 
Kp
Frequency
Controller “zero”
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Current PI Controller Coefficients
R
L
PI Controller
Commanded
Current
+
Error
Ka
∫
Kb
-
Vpi
+
+
-
+
V = Vpi
V = w KE
+
-
Measured
Current
R
K a  L  Current Bandwidth (rad / sec) , Kb 
L
Motor
Rd
Rq
Ld
Lq
PMSM
Rs
Rs
Ls
Ls
ACIM
Rs
Rs+Rr
IPM
Rs
Rs
Dave Wilson
2 

L
Ls 1  m 
 Lr Ls 


2 

L
m

Ls 1 
 Lr Ls 


Ls_d
TI Spins Motors…Smarter, Safer, Greener.
Ls_q
Cascaded Velocity Controller
Commanded
Speed
Kc, Kd
PI
Controller
Commanded
Current
Ka, Kb
PI
Controller
Motor
Volts
TI
Dave’s
Control
Center
Motor
Torque
Load
Inertia
Motor Current
Low
Pass
Filter
Speed Feedback
Pole = t
Load
Due to the techniques used for velocity feedback synthesis,
the velocity signal must be filtered in most cases.
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Velocity PI Controller Coefficients
PI Controller
Commanded
Speed
Error
+
Kc
∫
Kd
-
Filtered
Speed
1
Kc 
 Kt
K 
3PK e
4J
,
Kd 
Low
Pass
Filter
Pole =
1
 t
2
3 Lm2
K  P
Id
4 J Lr
+
Measured
Speed
t
阻尼系数根据什
么得到?给定?
交流感应电机
for AC Induction motors
Commanded
Current
+
永磁电机
for permanent magnet motors
Vpi
Ke = Back-EMF constant
P = Number of motor poles
J = System Inertia (as seen by the motor)
t = LPF Pole
 = the Damping Factor
Single tuning adjustment!
( Equations assume that the Current Controller closed-loop bandwidth is greater than 3t 
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Damping Factor
 = 1.5
Velocity filter pole
Velocity closed-loop bandwidth
0 dB
 = 1.5
 = 2.5
=4
Normalized velocity loop step response
=6
For more information on PI tuning, read my blog series at www.ti.com/motorblog
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Integrator Windup
Max Current
PI Controller
Commanded
Speed
Error
+
Kc
-
Kd
∫
Commanded
Current
Vpi
+
+
Limiter
Min Current
Filtered
Speed
Low
Pass
Filter
Pole =
Measured
Speed
t
Unfortunately, the Integrator exhibits “windup”
under sudden transient conditions.
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Simple Static Integrator Clamping
P
Commanded
Value
Imax
Error
+
+
+
-
Measured
Value
I
H
Pout
∫
PIout
Output
Limiter
L ≤ Output ≤ H
Iout
L
Imin
Imin = L, Imax = H
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Dynamic Integrator Clamping
P
Commanded
Value
Imax
Error
+
+
+
-
Measured
Value
I
H
Pout
∫
PIout
Output
Limiter
L ≤ Output ≤ H
Iout
L
Imin
L ≤ Pout + Iout ≤ H
for minimum condition: L = Pout + Imin → Imin = Min(L – Pout , 0)
for maximum condition: H = Pout + Imax → Imax = Max(H – Pout , 0)
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Comparison of Clamping Techniques
No integrator clamping
Static integrator clamping
Dynamic integrator clamping
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
Typical Analog Control System
r(t)
+
Σ
e(t)
-
h(t)
•Drawbacks:
-
Controller
Gc(s)
H(s)
g(t)
Plant
Gp(s)
c(t)
Low noise immunity
Filter characteristics change with temperature
Little flexibility
Component aging
Power supply variation
Lot-to-lot manufacturing
Requires adjustments
Critical component specification, especially for high order filters
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
c(t)
Typical Digital Control System
PWM Module
r(n)
+
Σ
e(n)
Controller
Gc(z)
-
h(n)
T
c(n)
H(z)
2T
3T
4T
g(n)
5T
6T
Z. O. H
ADC Module
Plant
Gp(s)
T
T is the sampling period
(Inverse of sampling frequency)
In most digital controllers, the control block (Gc(z)) is
implemented as an IIR filter to minimize phase delay.
Dave Wilson
TI Spins Motors…Smarter, Safer, Greener.
c(t)
The 10 Commandments of Digital Control
There are 10 facts of life about digital
control systems that your mother
never told you!
If you can handle the truth, read
about them on my blog site:
www.ti.com/motorblog
TI Spins Motors…Smarter, Safer, Greener.
Download