You are on page 1of 22

2014 Texas Instruments Motor Control Training

POSITION REGULATOR SPEED REGULATOR MODULATION


CURRENT REGULATOR

CLAMPED INTEGRATOR
INTEGRATOR

{ I_cur rent/Fs_curr ent}

Range={ 2.2*I_limit} , bits=10 E11


Z -1
{ I_speed/Fs_speed} max
Clk2
cur r ent ADC clk
E2
-1
Z
Clk1
Clamp clk
V4
min
ADC Tr igger
{ Speed_limit}
{ I_lim it}
Position_Er r or Curr ent_Er r or
V1 PULSE(-1 1 { 20uS + p/2 - T_aper tur e} 0 0 { T_aper tur e} { p} 100000) 25
V16
i_sam pled
V17
{ P_pos/quadcounts} max { P_speed} max { P_curr ent} max PWM Module Reload

E1 E5 E12
Position_Comm and Speed_command z.o.h. I_com mand z.o.h. z.o.h.
Radians/sec clk clk clk
V7 Clamp Clamp Clamp
Quantize PWM Car r ier
min min min
Range=50, levels=760
25
Clk1 Speed_Er r or
PULSE(-24 24 20uS { p/2} { p/2} 0 {p} 100
V5 V19 Clk2 V15
V18
V22
V3
PULSE(-1 1 { 2*T_apertur e} 0 0 {T_apertur e} {1/Fs_speed} 100000)
{ -Speed_limit} { -I_limit} PULSE(-1 1 10uS 0 0 {T_apertur e} {1/Fs_curr ent} 100000)

PULSE(-1 1 { 20uS + p - T_aper tur e/2} 0 0 { T_aper tur e} { p} 100000)

Speed^

Motor Model (Pittman DC Servo Motor LOAD


VELOCITY OBSERVER
Model 14206 with 24V Winding) B1

cur r ent
INTEGRATOR INTEGRATOR INTEGRATOR
V=I(L1)

{ I_vo/Fs_speed} { 1/Fs_speed} { 1/Fs_speed} L1

Pos _ e nc ode r
PWM
E6 E14 E17 { L} E3
Z -1 Z -1 Z -1 Radians
Clk0 Clk0 Clk0
clk clk clk
{ Kem f}
i.c.
Damping Losses

e r ror _ v o
{ 2* pi/quadcounts} E4 { 1/(Jmotor + Jload)}
{ P_vo} Speed Radians/sec
R2 Tor que E7
Speed
E18 E9 { Rt}
Counts z.o.h. Pos_vo { Kd}
i.c.
clk

M1- RPM

Pos _ v o
lock load
r otor tor que V13 E8
Clk0 { 1/Jt_est} Load
E10 E13 E16 0 { 30 / pi}
V14 Tor que^
i_sam pled { Kt_est} Acceler ation^ 0.5 B3 V12

PULSE(-1 1 0 0 0 { T_aper tur e} { 1/Fs_pos} 100000) Friction


V=I(L1)* Kt
Z -1 Motor Bear ings and Brushes PWL(0 0 0.0999999 0 0.1 0.6)
max
{ B_vo/Jt_est} Clk0
clk V6
To put motor on a dyno, set jumper to "lock r otor "
E15 and then use integr ator i.c. voltage source to specify dyno speed.
{ Kf} V11
Clamp
min
{ -Kf}

-Vth

Dave Wilson
Feed-Forward Approach

What you want


Controller Process
What you get
(G2) (G1)

Unadjustable, but perfectly predictable


1
G2 =
G1 Everything is
beautiful and linear!

Dave Wilson TI Spins Motors…Smarter, Safer, Greener.


Feedback Approach
The System
(G)

Comparator
What you want What you get
+ Controller Process
(G2) (G1)
-
Unadjustable,unpredictable,
the difference and often non-linear!

G
What you get = What you want
1+G

What if G = 1? What about 100?


Dave Wilson 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 What you get

G(s)
-
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 happens if the phase delay = 180º and gain = 1 ?


Dave Wilson TI Spins Motors…Smarter, Safer, Greener.
Designing a Feed-Forward Compensator

Example:


1 d
2 dt
y (t ) 10x (t )
2
2 dt y (t ) 10 x(t ) y (t ) 10x 2 (t )
Desired 1 s Plant 2 System
 G(s ) 
Output G(s ) 2 Input s Output
Feed-forward
Plant
Compensator

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

AC Mains Control
Center

Vdesired = volt-sec average of PWM signal

Vbus(t)
1
Vdesired 1 Duty Cycle 0
Vbust 
PWM 0

Module
Vb usavg Uncompensated
1:1 PWMs

PWM Scaling Modulation


Plant 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

AC Mains Control
Center

Vdesired

Vdesired Vbusavg Duty Cycle


1

1
Vbust 
PWM 0

Module
Vbus(t ) Vb usavg Compensated
PWMs
1:1
Feed-forward PWM Scaling Modulation
Compensator Plant Process
Motor Current Motor Current
Without F-F Compensation With F-F Compensation
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 TI Spins Motors…Smarter, Safer, Greener.


Feedback or Feedforward…
Which is Best?

More traditional approach Better stability


Best for disturbance rejection 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 Commanded Commanded


Current +
TI

Position + Velocity +
Dave’s

PI PI PI Control
Center

- - -

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

Kp term specifies the gain at higher frequencies


Ki term specifies the gain at lower frequencies
Amplitude (dB)

Kp term

0.1 1 10 100 1000


Frequency
Controller “zero”

Dave Wilson TI Spins Motors…Smarter, Safer, Greener.


Series PI Controller
Commanded


Value + Error + Output
Ka Kb
- +

Measured
Value

Ka is simply a gain term for all frequencies


Kb is equal to the controller’s “zero” in rad/sec
Amplitude (dB)

Ka  K p
Ka

Ki
Kb 
Ka

Popular with
Current Contollers
0.1 1 10 100 1000
Kp
Frequency
Kb
Controller “zero”

Dave Wilson TI Spins Motors…Smarter, Safer, Greener.


Current PI Controller Coefficients
L R

PI Controller
Commanded
Vpi + V = w KE +

Current + Error +
Ka Kb V = Vpi
- -
- +

Measured
Current

R
K a  L  Current Bandwidth (rad / sec) , Kb 
L
Motor Rd Rq Ld Lq
PMSM Rs Rs Ls Ls
 L 2   L 2 
ACIM Rs Rs+Rr Ls 1  m  Ls 1  m 
 Lr Ls   Lr Ls 
   
IPM Rs Rs Ls_d Ls_q

Dave Wilson TI Spins Motors…Smarter, Safer, Greener.


Cascaded Velocity Controller

Commanded Load
Commanded Kc, Kd Ka, Kb Motor Motor
Current Inertia
Speed PI PI Volts TI
Torque
Dave’s

Controller Controller
Control
Center

Motor Current
Low
Speed Feedback
Pass
Filter
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 Commanded
Vpi

Speed + Error + Current
Kc Kd
- +

Filtered Measured
Speed Low Speed
Pass
Filter

1 1 Pole = t
Kc  Kd 
 Kt ,
 t
2 Ke = Back-EMF constant
P = Number of motor poles
3PK e J = System Inertia (as seen by the motor)
K  for permanent magnet motors
4J t = LPF Pole
 = the Damping Factor
3 Lm2
K  P Id for AC Induction motors
4 J Lr 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 closed-loop bandwidth

Velocity filter pole


0 dB

 = 1.5

 = 2.5 Normalized velocity loop step response


=4
=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 Commanded
Vpi

Speed + Error + Current
Kc Kd
- + Limiter

Min Current

Filtered Measured
Speed Low Speed
Pass
Filter
Pole = t
Unfortunately, the Integrator exhibits “windup”
under sudden transient conditions.

Dave Wilson TI Spins Motors…Smarter, Safer, Greener.


Simple Static Integrator Clamping
Pout H
P
Commanded +
Value + Error Imax PIout Output
- +
Limiter L ≤ Output ≤ H
Measured

Iout
Value I
L

Imin

Imin = L, Imax = H

Dave Wilson TI Spins Motors…Smarter, Safer, Greener.


Dynamic Integrator Clamping
Pout H
P
Commanded +
Value + Error Imax PIout Output
- +
Limiter L ≤ Output ≤ H
Measured

Iout
Value I
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) Controller g(t) Plant c(t)


Σ
-
Gc(s) Gp(s)

h(t) c(t)
H(s)
•Drawbacks:
- 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.
Typical Digital Control System
PWM Module

r(n) + e(n) Controller g(n) Plant c(t)


Σ Z. O. H
-
Gc(z) Gp(s)

ADC Module
h(n) c(n) T
H(z)

T 2T 3T 4T 5T 6T 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.


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.

You might also like