Feedback Control of Computing Systems M4: Analyzing Composed Systems Joseph L. Hellerstein IBM Thomas J Watson Research Center, NY hellers@us.ibm.com September 21, 2004 Feedback Control of Computing Systems © 2004 Hellerstein Key Results for LTI Systems U(z) G(z) Y(z) Adding signals: If {a(k)} and {b(k)} are signals, then {c(k)=a(k)+b(k)} has Z-Transform A(z)+B(z). 0.5 2 A(z) + 0.4 C(z) 1.5 y(k) + u(k) 0.3 1 B(z) 0.2 0.5 0.1 0 0 10 20 30 k 0 0 10 20 30 k Stable if |a|<1, where a is the largest pole of G(z) kS 4 , where | a | is the largest pole of G(z) log | a | Transfer functions in series U(z) G(z) H(z) Y(z) is equivalent to U(z) y ( ) G (1) ssg of G(z) is u ( ) 2 W(z) Feedback Control of Computing Systems: M4 - Composed Systems G(z)H(z) Y(z) © 2004 Hellerstein Motivating Example r (k ) u(k + 1) u(k ) + K I e(k + 1) + e( k ) Controller w(k + 1) (0.43) w(k ) + (0.47)u ( k ) u (k ) Notes Server y (k + 1) 0.8 y (k ) + 0.72w(k ) 0.66 w(k 1) w( k ) Notes Sensor y (k ) e( k ) r ( k ) y ( k ) The problem Want to find y(k) in terms of KI so can design control system that is stable, accurate, settles quickly, and has small overshoot. But this is difficult to do with ARX models. The Solution Use a different representation This module addresses the analysis of composed systems: steady state gain, stability, settling time 3 Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein M4: Lecture 4 Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Outline Canonical feedback loop and its transfer functions Generalized canonical feedback loop Complex structures Reference: “Feedback Control of Computer Systems”, Chapter 4. 5 Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Block Diagram Basics D(z) Controller R(z) U(z) E(z) + K(z) W(z) + Target System + V(z) G(z) H(z) Transducer 6 Y(z) Functional block: component of the system Arrow: signal Summation point: addition of signals Branching point: signal with multiple destinations Feedback Control of Computing Systems: M4 - Composed Systems Permitted operations Summing signals Cascading systems © 2004 Hellerstein Canonical Feedback Loop Disturbance D(z) Input Reference Input R(z) Controller U(z) E(z) + K(z) W(z) + Noise Input N(z) Target System Y(z) + + V(z) G(z) + Measured Output T(z) H(z) Transducer Want to analyze characteristics of the entire system, like its stability, settling time, and accuracy (ability to achieve the reference input). It’s all done with transfer functions! 7 Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Canonical Feedback Loop – Reference Input FR(z) Reference Input R(z) D(z)=0 Controller U(z) E(z) + K(z) + N(z)=0 Target System Y(z) + + V(z) G(z) + Measured Output T(z) Transducer W(z) H(z) View the dark rectangle as a large transfer function FR(z) with input R(z) and output T(z). System is stable if largest pole of FR(z) has an absolute value that is less than 1 System is accurate if FR(1)=1 System’s settling time is determined by the largest pole of FR(z) 8 Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Canonical Feedback Loop Has Many T.F. Disturbance D(z) Input Reference Input R(z) U(z) E(z) K(z) N(z) Target System Y(z) + + V(z) G(z) + Controller + Noise Input + W(z) Measured Output T(z) H(z) A transfer function is specified in terms of its input and output. Transducer Assess Assess Accuracy 9 disturbance robustness FR (z) FD (z ) Transfer function from the reference input to the measured output Transfer function from the disturbance input to the measured output FN (z ) Assess noise robustnes s Transfer function from the noise input to the measured output Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Results Used to Find T.F. Adding signals: If {a(k)} and {b(k)} are signals, then {c(k)=a(k)+b(k)} has Z-Transform A(z)+B(z). A(z) + C(z) + B(z) Transfer functions in series U(z) G(z) W(z) H(z) Y(z) is equivalent to U(z) 10 Feedback Control of Computing Systems: M4 - Composed Systems G(z)H(z) Y(z) © 2004 Hellerstein Computing FR(z) R(z) Simplified B.D. since D(z)=0=N(z) The only non-zero input is R(z). U(z) E(z) + T(z) G(z) K(z) W(z) H(z) A set of equations relates R(z) to T(z) based on our previous results W(z) = H(z)T(z) by the definition of a transfer function. E(z) = R(z)-W(z) since this is an addition of signals. T(z) = E(z)K(z)G(z) since K(z) and G(z) are in series. T(z) = (R(z)-H(z)T(z))K(z)G(z) by substitution. 11 FR ( z ) T ( z) K ( z )G ( z ) R( z ) 1 + K ( z )G ( z ) H ( z ) Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Computing FD(z)=T(z)/D(z) The only non-zero input is D(z). N(z)=0 D(z) R(z)=0 + K(z) G(z) + W(z) W(z) = H(z)T(z) by the definition of a transfer function. E(z) = -W(z) since this is an addition of signals. T(z) = E(z)K(z)G(z) + D(z)G(z). Y(z) = (-H(z)T(z))K(z)G(z) + D(z)G(z) by substitution. 12 Y(z) + + V(z) U(z) E(z) T(z) + H(z) FD ( z ) Feedback Control of Computing Systems: M4 - Composed Systems G( z ) 1 + K ( z )G( z ) H ( z ) © 2004 Hellerstein Results Used Next U(z) G(z) Y(z) 0.5 2 0.4 1.5 y(k) u(k) 0.3 1 0.2 0.5 0.1 0 0 10 20 30 k 0 0 10 20 30 k Stable if |a|<1, where a is the largest pole of G(z) kS 4 , where | a | is the largest pole of G(z) log | a | y ( ) G (1) ssg of G(z) is u ( ) 13 Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Properties of Canonical Loop R(z) + K(z) FR ( z ) G(z) + W(z) Reference to Output FD ( z ) T(z) + H(z) Disturbance to Output T ( z) K ( z )G ( z ) R( z ) 1 + K ( z )G ( z ) H ( z ) Y(z) + + V(z) U(z) E(z) N(z) D(z) Noise to Output? T ( z) G( z ) D( z ) 1 + K ( z )G ( z ) H ( z ) FN ( z ) T ( z) 1 N ( z ) 1 + K ( z )G( z ) H ( z ) What can we say about the stability and settling times of these three transfer functions? They are the same! When is the system accurate in the sense that T(z)=R(z)? FR(1)=1 When is the system robust to disturbances and noise? 14 FD(1)=0= FN(1) Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Predicting Measured Outputs R(z) + K(z) Y(z) + + V(z) U(z) E(z) N(z) D(z) G(z) + W(z) T(z) + H(z) What is T(z) if R(z), D(z), and N(z) are all non-zero? T ( z ) R( z ) FR ( z ) + D( z ) FD ( z ) + N ( z ) FN ( z ) 15 Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Generalized Canonical Feedback Loop I2(z) I1(z) In-1(z) In+1(z) + + G1(z) Gn(z) + Hm(z) What is F j ( z ) T(z) + H1(z) T ( z) ? I j ( z) G j ( z )...Gn ( z ) T ( z) Fj ( z) I j ( z ) 1 + H1 ( z )...H m ( z )G j ( z )...Gn ( z ) 16 Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Nested Structures R(z) + K1(z) + T(z) K2(z) G(z) Find: T ( z) FR ( z ) R( z ) H(z) is equivalent to Approach 1: Solve directly. R(z) Approach 2: a. Transform into a canonical control loop. b. Apply result for T.F. of canonical control loop. 17 T(z) + K(z) K 2 ( z )G ( z ) 1 + K 2 ( z )G ( z ) H(z) Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Summary Control systems have many transfer functions of interest Key properties of system are indicated by the transfer functions Stability, accuracy, settling time, robustness to disturbance, robustness to noise Find transfer functions by 18 FR(z) – From reference input to measured output FD(z) – From distrubance input to measured output FN(z) – From noise input to measured output Solving a (simple) set of equations Transforming into a canonical control loop and solving Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Key Results for LTI Systems U(z) G(z) Y(z) Adding signals: If {a(k)} and {b(k)} are signals, then {c(k)=a(k)+b(k)} has Z-Transform A(z)+B(z). 0.5 2 A(z) + 0.4 C(z) 1.5 y(k) + u(k) 0.3 1 B(z) 0.2 0.5 0.1 Transfer functions in series U(z) 0 0 10 20 30 k G(z) 0 0 10 20 30 k W(z) H(z) Y(z) is equivalent to Stable if |a|<1, where a is the largest pole of G(z) kS 4 , where | a | is the largest pole of G(z) log | a | y ( ) G (1) ssg of G(z) is u ( ) 19 U(z) FR ( z ) G(z)H(z) Y(z) T ( z) K ( z )G ( z ) R( z ) 1 + H ( z ) K ( z )G ( z ) Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein M4: Labs 20 Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Analytic Solution to First Lab Exercise Block Diagram Reference RIS + r* MaxUsers e(k) u(k) Controller Notes Server ARX Models Actual RIS y(k) Control error: e(k)=r*-y(k) P controller: u(k)=Ke(k) System model: y(k)=(0.43)y(k-1) +(0.47)u(k-1) Assignment 1. Find FR(z) 2. Find the steady state error K, K = .1, 1, 3 3. Find the poles for these same values of K. For each, determine the settling times. How do they compare with simulation results? 21 Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Solution FR ( z ) T ( z) K ( z )G( z ) R( z ) 1 + H ( z ) K ( z )G( z ) ARX Models Control error: e(k)=r*-y(k) P controller: u(k)=Ke(k) System model: y(k)=(0.43)y(k-1)+(0.47)u(k-1) e(k) r* + Controller Notes u(k) Server y(k) U ( z) K E( z) Y ( z) 0.47 G( z) U ( z ) z 0.43 H ( z) 1 0.47 K 0.47 K z 0.43 FR ( z ) 0.47 z 0.43 + 0.47 K 1+ K z 0.43 K ( z) Compare with simulations in M1. 22 Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein Homework: Due 9/23/2004 D(z) w(k+1)=0.43w(k)+0.47v(k) y (k + 1) 0.8 y (k ) + 0.72w(k ) 0.66 w(k 1) u(k)=u(k-1)+KIe(k) + V(z) e( k ) Controller u (k ) + Notes Server w( k ) Notes Sensor y (k ) e( k ) r ( k ) y ( k ) Assignment 1. Find FD(z) 2. Assess the robustness of this control system to noise. 3. Use FD(z) to find the KI that produces the smallest settling time. (Hint: plot the largest pole versus KI. 4. Verify the results of analysis using simulations. 23 Feedback Control of Computing Systems: M4 - Composed Systems © 2004 Hellerstein