Motor Control: Operator Input Power Supply
Motor Control: Operator Input Power Supply
Motor Control: Operator Input Power Supply
Suppose we wish to use a microprocessor to control a motor - (or to control the load attached to the motor!)
Operator Input
digital analog voltage
Power supply ?
D/A, PWM
CPU
Amplifier
linear, PWM
Motor
Load
Sensor
Convert discrete signal to analog voltage - D/A converter - pulse width modulation (PWM) Amplify the analog signal - power supply - amplier Types of power ampliers - linear vs. PWM - voltage-voltage vs. transconductance (voltage-current) DC Motor - How does it work? What to control? - electrical signals: voltage, current - mechanical signals: torque, speed, position Sensors: Can we measure the signal we wish to control (feedback control)?
Outline
Review of Motor Principles - torque vs. speed - voltage vs current control - with and without load D/A conversion vs. PWM generation - harmonics - advantages and disadvantages - creating PWM signals power ampliers - linear vs PWM - voltage vs transconductance Control - choice of signal to control - open loop - feedback References are [5], [3], [1], [4], [8], [7], [6], [9]
Motor Review
Recall circuit model of motor:
R
+ V -
VB=K V
+ TL
T M,
Suppose motor is driven by a constant voltage source. Then steady state speed and torque satisfy = TM = Torque-speed curve
TM
increasing
KM V RTL KM KV + RB KM (V B + KV TL) KM KV + RB
Voltage Control
Suppose we attempt to control speed by driving motor with a constant voltage. With no load and no friction (TL = 0, B = 0) V = KV TM = 0 Recall that torque is proportional to current: TM = KM I . Hence, with no load and no friction, I = 0, and motor draws no current in steady state. Current satises V VB I = R In steady state, back EMF balances applied voltage, and thus current and motor torque are zero. With a load or friction, (TL = 0 and/or B = 0) < V KV
TM > 0 Speed and torque depend on load and friction - friction always present (given in part by motor spec, but there will be additional unknown friction) - load torque may also be unknown, or imprecisely known
volts tachometer
rad/sec
System
A system is any object that has one or more inputs and outputs
input System output
Input: applied voltage, current, foot on gas pedal, . . . Output: other variable that responds to the input, e.g., voltage, current, speed, torque, . . . Examples: - RC circuit
R + -
vi(t)
vo(t)
+ V -
VB=K V
+ TL
T M,
Stability
We say that a system is stable if a bounded input yields a bounded output If not, the system is unstable Consider DC Motor with no retarding torque or friction - With constant voltage input, the steady state shaft speed is constant the system from V to is stable - Suppose that we could hold current constant, so that the steady state torque is constant. Since TM d = , dt J
the shaft velocity and velocity increases without bound the system from I to is unstable
Tests for stability - mathematics beyond scope of class - we will point out in examples how stability depends on system parameters
Frequency Response
A linear system has a frequency response function that governs its response to inputs:
u(t) H(j) y(t)
If the system is stable, then the steady state response to a sinusoidal input, u(t) = sin(t), is given by H(j): y(t) |H(j)| sin(t + H(j)) We have seen this idea in Lecture 2 when we discussed antialiasing lters and RC circuits The response to a constant, or step, input, u(t) = u0, t 0, is given by the DC value of the frequency response: y(t) H(0)u0
10
10
10
10
10
10 frequency, rad/sec
10
10
Steady state response to input sin(10t) satises yss(t) = 0.1 sin(10t 85).
response of H(j) to sin(10t) 1 input output 0.8
0.6
0.4
0.2
0.2
0.4
0.6
0.8
0.5
1.5
3.5
4.5
10
The transfer function relates the Laplace transform of the system output to that of its input: Y (s) = H(s)U (s) for simple systems H(s) may be computed from the dierential equation describing the system for more complicated systems, H(s) may be computed from rules for combining transfer functions To nd the frequency response of the system, set s = j , and obtain H(j)
11
vi(t)
vo(t)
dierential equation for circuit - Kirchos Laws: vi(t) I(t)R = vo(t) o (t) - current/voltage relation for capacitor: I(t) = C dvdt - combining yields RC dvo(t) + vo(t) = vi(t) dt
To obtain transfer function, replace - each time signal by its Laplace transform: v(t) V (s) - each derivative by s times its transform: dv(t) sV (s) dt - solve for Vo(s) in terms of Vi(s): Vo(s) = H(s)Vi(s), H(s) = 1 RCs + 1
12
Solving for Y (s) in terms of U (s) yields the transfer function as a ratio of polynomials: Y (s) = H(s)U (s), N (s) H(s) = D(s)
N (s) = b1s
n
n1
+ b2 s
n1
n2
+ . . . bn1s + bn
n2
D(s) = s + a1s
+ a2s
+ . . . + an1s + an
The transfer function governs the response of the output to the input with all initial conditions set to zero.
13
reduces to
u(t) G(s)H(s) y(t)
G(s)
y(t)
reduces to
u(t) G(s)+H(s) y(t)
14
Feedback Connection
Consider the feedback system
u(t)
y(t)
Feedback equations: the output depends on the error, which in turn depends upon the output! (a) y = Ge (b) e = u Hy If we use negative feedback, and H = 1, then e = y u - the input signal u is a command to the output signal y - e is the error between the command and the output Substituting (b) into (a) and solving for y yields
u(t) G(s) 1+/-G(s)H(s) y(t)
15
dI + RI = V VB dt 1 sL + R (V (s) VB (s))
(1)
I(s) =
- Torque:
TM (s) = KM I(s)
(3)
- Back EMF:
VB (s) = KV (s)
(4)
We can solve for the outputs TM (s) and (s) in terms of the inputs V (s) and TL(s)
EECS461, Lecture 6, updated September 23, 2008 16
Transfer function from Voltage to Speed (set TL = 0): - First combine (1)-(3) (s) = 1 KM (V (s) VB (s)) (sJ + B) (sL + R)
(s) = 1 =
(s) V (s)
KM (sL + R)(sJ + B) + KM KV
K (sJ+B)
M Similarly, TM (s) = (sL+R)(sJ+B)+K K V (s) M V The steady state response of speed and torque to a constant voltage input V is obtained by setting s = 0 (cf. Lecture 5):
ss =
KM V , RB + KM KV
TM ss =
KM BV RB + KM KV
17
10
10
10
10
10
10
10 frequency, Hz
10
10
Parameter Values - KM = 1 N-m/A - KV = 1 V/(rad/sec) - R = 10 ohm - L = 0.01 H - J = 0.1 N-m/(rad/sec)2 - B = 0.28 N-m/(rad/sec) Why is frequency response important? - Linear vs. PWM ampliers . . .
2 Matlab m-le DC motor freq response.m
18
- output voltage is a scaled version of the input voltage, gain measured in V /V . - Draws whatever current is necessary to maintain desired voltage K V RTL - Motor speed will depend on load: = K MK +RB
M V
- output current is a scaled version of the input voltage, gain measured in A/V . - Will produce whatever output voltage is necessary to maintain desired current - Motor torque will not depend on load: TM = KM I Advantage of linearity: Ideally, the output signal is a constant gain times the input signal, with no distortion - In reality, bandwidth is limited - Voltage and/or current saturation Disadvantage: - inecient unless operating full on, hence tend to consume power and generate heat.
19
20
PWM Examples
40% duty cycle3:
1.2 1 duty cycle = 40%, switching period = 1 sec, switching frequency = 1 Hz
0.8
PWM signal
0.6
0.4
0.2
5 time,seconds
10
0.8
PWM signal
0.6
0.4
0.2
5 time,seconds
10
0.8
PWM signal
0.6
0.4
0.2
5 time,seconds
10
21
0.8
PWM signal
0.6
0.4
0.2
0.1
0.2
0.3
0.4
0.7
0.8
0.9
Frequency spectrum will contain - a nonzero DC component (because the average is nonzero) - components at multiples of 10 Hz
duty cycle = 40%, switching period = 0.1 sec, switching frequency = 10 Hz 4
3.5
2.5
1.5
0.5
0 100
80
60
40
20
0 20 frequency, Hz
40
60
80
100
22
mostly on 1
mostly off
0.8
0.6
0.4
0.2
5 time, seconds
10
5 time, seconds
10
23
2.5
1.5
0.5
0 20
15
10
0 frequency, Hz
10
15
20
Potential problem with PWM control: - High frequencies in PWM signal may produce undesirable oscillations in the motor (or whatever device is driven by the amplied PWM signal) - switching frequency usually set 25 kHz so that switching is not audible
24
10 gain, db
20
30
40 2 10
10
10
10
10
0 20 phase, degrees 40 60 80 10
2
10
10 frequency, Hz
10
10
Then, after an initial transient, the lter output has a 0.1 Hz oscillation.
filtered PWM output
0.5 0.4 0.3 0.2 0.1 0 0.1 0.2 0.3 0.4 0.5
5 time, seconds
10
25
PWM Generation
Generate PWM using D/A and pass it through a PWM amplier
CPU
D/A
Motor
techniques for generating analog PWM output ([6]): - software - timers - special modules Feed the digital information directly to PWM amplier, and thus bypass the D/A stage
duty cycle
CPU
Motor
PWM voltage or current ampliers must determine direction - normalize so that * 50% duty cycle represents 0 * 100% duty cycle represents full scale * 0% duty cycle represents negative full scale * what we do in lab, plus we limit duty cycle to 35% 65% - use full scale, but keep track of sign separately
26
References
[1] D. Auslander and C. J. Kempf. Mechatronics: Mechanical Systems Interfacing. Prentice-Hall, 1996. [2] M. Barr. Introduction to pulse width modulation. www.oreillynet.com/pub/a/network/synd/2003/07/02/pwm.html. [3] W. Bolton. Mechatronics: Electronic Control Systems in Mechanical and Elecrical Engineering, 2nd ed. Longman, 1999. [4] C. W. deSilva. Control Sensors and Actuators. Prentice Hall, 1989. [5] G.F. Franklin, J.D. Powell, and A. Emami-Naeini. Feedback Control of Dynamic Systems. Addison-Wesley, Reading, MA, 3rd edition, 1994. [6] S. Heath. Embedded Systems Design. Newness, 1997. [7] C. T. Kilian. Modern Control Technology: Components and Systems. West Publishing Co., Minneapolis/St. Paul, 1996. [8] B. C. Kuo. Automatic Control Systems. Prentice-Hall, 7th edition, 1995. [9] J. B. Peatman. Design with PIC Microcontrollers. PrenticeHall, 1998.
27