Modeling General Concepts Dr. Kevin Craig Professor of Mechanical Engineering Rensselaer Polytechnic Institute Modeling General Concepts K. Craig 1 Modeling: General Concepts • • • • • • • Classification of System Inputs Pure and Ideal Elements vs. Real Devices; Ideal vs. Real Sources Transfer Functions Linearization of Nonlinear Physical Effects Loading Effects Block Diagram Time Domain & Frequency Domain – Step Response & Frequency Response • State-Space Representation • Poles and Zeros of Transfer Functions • Sensitivity Analysis Modeling General Concepts K. Craig 2 Modeling General Concepts K. Craig 3 Classification of System Inputs System Inputs Initial Energy Storage Kinetic External Driving Potential Input / System / Output Concept: Classification of System Inputs Deterministic Stationary Transient Periodic Sinusoidal Modeling General Concepts Random Unstationary "Almost Periodic" NonSinusoidal K. Craig 4 • Input – some agency which can cause a system to respond. • Initial energy storage refers to a situation in which a system, at time = 0, is put into a state different from some reference equilibrium state and then released, free of external driving agencies, to respond in its characteristic way. Initial energy storage can take the form of either kinetic energy or potential energy. • External driving agencies are physical quantities which vary with time and pass from the external environment, through the system interface or boundary, into the system, and cause it to respond. • We often choose to study the system response to an assumed ideal source, which is unaffected by the system to which it is coupled, with the view that practical situations will closely correspond to this idealized model. Modeling General Concepts K. Craig 5 • External inputs can be broadly classified as deterministic or random, recognizing that there is always some element of randomness and unpredictability in all real-world inputs. • Deterministic input models are those whose complete time history is explicitly given, as by mathematical formula or a table of numerical values. This can be further divided into: – transient input model: one having any desired shape, but existing only for a certain time interval, being constant before the beginning of the interval and after its end. – periodic input model: one that repeats a certain wave form over and over, ideally forever, and is further classified as either sinusoidal or non-sinusoidal. – almost periodic input model: continuing functions which are completely predictable but do not exhibit a strict periodicity, e.g., amplitude-modulated input. Modeling General Concepts K. Craig 6 • Random input models are the most realistic input models and have time histories which cannot be predicted before the input actually occurs, although statistical properties of the input can be specified. • When working with random inputs, there is never any hope of predicting a specific time history before it occurs, but statistical predictions can be made that have practical usefulness. • If the statistical properties are time-invariant, then the input is called a stationary random input. Unstationary random inputs have time-varying statistical properties. These are often modeled as stationary over restricted periods of time. Modeling General Concepts K. Craig 7 Pure and Ideal Elements vs. Real Devices • A pure element refers to an element (spring, damper, inertia, resistor, capacitor, inductor, etc.) which has only the named attribute. • For example, a pure spring element has no inertia or friction and is thus a mathematical model (approximation), not a real device. • The term ideal, as applied to elements, means linear, that is, the input/output relationship of the element is linear, or straight-line. The output is perfectly proportional to the input. • A device can be pure without being ideal and ideal without being pure. Modeling General Concepts K. Craig 8 • From a functional engineering viewpoint, nonlinear behavior may often be preferable, even though it leads to difficult equations. • Why do we choose to define and use pure and ideal elements when we know that they do not behave like the real devices used in designing systems? Once we have defined these pure and ideal elements, we can use these as building blocks to model real devices more accurately. • For example, if a real spring has significant friction and mass, we model it as a combination of pure/ideal spring, mass, and damper elements, which may come quite close in behavior to the real spring. Modeling General Concepts K. Craig 9 Physical Model of a Real Spring Ks f, x M B Modeling General Concepts Ks B K. Craig 10 Ideal vs. Real Sources • External driving agencies are physical quantities which pass from the environment, through the interface into the system, and cause the system to respond. • In practical situations, there may be interactions between the environment and the system; however, we often use the concept of ideal source. • An ideal source (force, motion, voltage, current, etc.) is totally unaffected by being coupled to the system it is driving. • For example, a “real” 6-volt battery will not supply 6 volts to a circuit! The circuit will draw some current from the battery and the battery’s voltage will drop. Modeling General Concepts K. Craig 11 Transfer Functions • Definition and Comments – The transfer function of a linear, time-invariant, differential equation system is defined as the ratio of the Laplace transform of the output (response function) to the Laplace transform of the input (driving function) under the assumption that all initial conditions are zero. – By using the concept of transfer function, it is possible to represent system dynamics by algebraic equations in s. The highest power of s in the denominator determines the order of the system. Modeling General Concepts K. Craig 12 • Transfer Function 2 d x 2 D x 2 dt x ∫ ⎡⎣ ∫ ( x ) dt ⎤⎦dt 2 D dx Dx dt x ∫ (x)dt D – Differential Operator – Consider the spring-mass-damper system Kx B(dx/dt) B K +x M F(t) M +x F(t) Physical Model Modeling General Concepts Free-Body Diagram (x is measured from the static equilibrium position) K. Craig 13 Apply Newton’s Second Law Using the differential operator D we can transform the differential equation to an algebraic equation and then write the transfer function for the system. Modeling General Concepts d2x ∑ Fx = M dt 2 = Mx F ( t ) − Bx − Kx = Mx Mx + Bx + Kx = F ( t ) Mx + Bx + Kx = F ( t ) Mathematical Model Differential Equation d2x dx MD x ≡ M 2 =Mx BDx ≡ B = Bx dt dt MD 2 x + MDx + Kx = F ( t ) Algebraic Equation 2 2 MD ( + BD + K ) x = F ( t ) x 1 = F MD 2 + BD + K Transfer Function K. Craig 14 – The transfer function is a property of a system itself, independent of the magnitude and nature of the input or driving function. – The transfer function gives a full description of the dynamic characteristics of the system. – The transfer function does not provide any information concerning the physical structure of the system; the transfer functions of many physically different systems can be identical. – If the transfer function of a system is known, the output or response can be studied for various forms of inputs with a view toward understanding the nature of the system. – If the transfer function of a system is unknown, it may be established experimentally by introducing known inputs and studying the output of the system. Modeling General Concepts K. Craig 15 • Convolution Integral – For a linear time-invariant system the transfer function G(s) is Y(s) G(s) = X(s) where X(s) is the Laplace transform of the input and Y(s) is the Laplace transform of the output, assuming all initial conditions are zero. – The inverse Laplace transform is given by the convolution integral: t t 0 0 y(t) = ∫ x( τ)g(t − τ)dτ = ∫ g(τ)x(t − τ)dτ Modeling General Concepts t<0 g(t) = 0 x(t) = 0 K. Craig 16 • Impulse-Response Function – The Laplace transform of the response of a system to a unit-impulse input, when the initial conditions are zero, is the transfer function of the system, i.e., Y(s) = G(s). – The inverse Laplace transform of the system transfer function, g(t), is called the impulse-response function. It is the response of a linear system to a unit-impulse response when the initial conditions are zero. – The transfer function and the impulse-response function of a linear, time-invariant system contain the same information about the system dynamics. Modeling General Concepts K. Craig 17 – Experimentally, one can excite a system at rest with an impulse input (a pulse input of very short duration compared with the significant time constants of the system) and measure the response. This response is the impulse-response function, the Laplace transform of which is the transfer function of the system. Modeling General Concepts K. Craig 18 • Three Basic Input-Output Relationships Modeling General Concepts K. Craig 19 • Step Response and Impulse Response – By a step input of any variable we mean a situation where the system is “at rest” at time t = 0 and we instantly change the input quantity, from wherever it was just before t = 0, by a given amount, either positive or negative, and then keep the input constant at this new value “forever.” – The integral of a step input is a ramp and the derivative of a step input is an impulse. – An impulse has an infinite magnitude and zero duration and is mathematical fiction and does not occur in physical systems. Modeling General Concepts K. Craig 20 Explanation of the Impulse Function If the magnitude of a pulse input to a system is very large and its duration is very short compared to the system’s speed of response, then we can approximate the pulse input by an impulse function. Modeling General Concepts K. Craig 21 Step Responses of the Three Basic Elements Modeling General Concepts K. Craig 22 • Frequency Response – If the input to a linear system is a sine wave, the steadystate output (after the transients have died out) is also a sine wave with the same frequency, but with a different amplitude and phase angle. Both amplitude ratio and phase angle change with frequency. – The following plots show the frequency response of the three basic elements. – Note that a decibel dB = 20 log10 (amplitude ratio). • 0 dB is an amplitude ratio of 1 • + 6 dB is an amplitude ratio of 2 • - 6 dB is an amplitude ration of ½ • + 20 dB is an amplitude ratio of 10 • - 20 dB is an amplitude ratio of 1/10. Modeling General Concepts K. Craig 23 Modeling General Concepts K. Craig 24 Modeling General Concepts K. Craig 25 Modeling General Concepts K. Craig 26 Linearization of Nonlinear Physical Effects • Many real-world nonlinearities involve a “smooth” curvilinear relation between an independent variable x and y = f(x) a dependent variable y: • A linear approximation to the curve, accurate in the neighborhood of a selected operating point, is the tangent line to the curve at this point. • This approximation is given conveniently by the first two terms of the Taylor series expansion of f(x): 2 2 (x − x) df df y = f (x) + +" (x − x) + 2 dx x = x dx x = x 2! df − ≈ + y y (x − x) df dx x = x y≈ y+ (x − x) dx x = x yˆ = Kxˆ Modeling General Concepts K. Craig 27 • For example, in liquid-level control systems, when the tank is not prismatic, a nonlinear volume/height relationship exists and causes a nonlinear system differential equation. For a conical tank of height H and top radius R we would have: πR 2 3 V= h 2 3H πR 2 h 3 πR 2 h 2 ˆ V≈ h + 2 2 3H H • Often a dependent variable y is related nonlinearly to several independent variables x1, x2, x3, etc. according to the relation: y=f(x1, x2, x3, …). Modeling General Concepts K. Craig 28 • We may linearize this relation using the multivariable form of the Taylor series: ∂f y ≈ f ( x 1 , x 2 , x 3 , ") + ∂x1 ∂f + ∂x 3 y ≈ y+ x1 ,x 2 ,x 3 ∂f ( x1 − x 1 ) + ∂x 2 ," ( x2 − x2 ) x1 ,x 2 ,x 3 ," ( x3 − x3 ) + " x1 ,x 2 ,x 3 ," ∂f ∂x1 xˆ 1 + x1 ,x 2 ,x 3 ," ∂f ∂x 2 xˆ 2 + x1 ,x 2 ,x 3 ," ∂f ∂x 3 xˆ 3 + " x1 ,x 2 ,x 3 ," yˆ = K1xˆ 1 + K 2 xˆ 2 + K 3 xˆ 3 + " The partial derivatives can be thought of as the sensitivity of the dependent variable to small changes in that independent variable. Modeling General Concepts K. Craig 29 • For example, in a ported gas-filled piston/cylinder where gas mass, temperature, and volume are all changing, the perfect gas law gives us for pressure p: RTM V RTM RM RT RMT p≈ T − T) + M − M) − V − V) + ( ( ( V V V V p= Modeling General Concepts K. Craig 30 Example: Magnetic Levitation System Applications include magnetic bearings for vacuum pumps, conveyor systems in clean rooms, highspeed levitated trains, and electromagnetic automotive valve actuators. Modeling General Concepts Electromagnet Phototransistor Infrared LED Levitated Ball K. Craig 31 Magnetic Levitation System ⎛ i2 ⎞ f ( x,i ) = C ⎜ 2 ⎟ ⎝x ⎠ Equation of Motion: ⎛ i2 ⎞ mx = mg − C ⎜ 2 ⎟ ⎝x ⎠ At Equilibrium: ⎛i ⎞ mg = C ⎜ 2 ⎟ ⎝x ⎠ 2 Modeling General Concepts Linearization: ⎛ i2 ⎞ ⎛ i2 ⎞ ⎛ 2i 2 ⎞ ⎛ 2i C ⎜ 2 ⎟ ≈ C ⎜ 2 ⎟ − C ⎜ 3 ⎟ xˆ + C ⎜ 2 ⎝x ⎠ ⎝x ⎠ ⎝ x ⎠ ⎝x 2 2 ⎛ ⎞ ⎛ ⎞ ⎛ 2i i 2 i mxˆ = mg − C ⎜ 2 ⎟ + C ⎜ 3 ⎟ xˆ − C ⎜ 2 ⎝x ⎠ ⎝ x ⎠ ⎝x 2 ⎛ ⎞ ⎛ 2i 2 i mxˆ = C ⎜ 3 ⎟ xˆ − C ⎜ 2 ⎝ x ⎠ ⎝x ⎞ˆ ⎟i ⎠ K. Craig 32 ⎞ˆ ⎟i ⎠ ⎞ˆ ⎟i ⎠ Use of Experimental Testing in Multivariable Linearization f m = f (i, y) ∂f ∂f f m ≈ f ( i0 , y0 ) + ( y − y0 ) + ∂y i0 ,y0 ∂i Modeling General Concepts ( i − i0 ) i0 ,y0 K. Craig 33 Block Diagrams • A block diagram of a system is a pictorial representation of the functions performed by each component and of the flow of signals. It depicts the interrelationships that exist among the various components. • It is easy to form the overall block diagram for the entire system by merely connecting the blocks of the components according to the signal flow. It is then possible to evaluate the contribution of each component to the overall system performance. • A block diagram contains information concerning dynamic behavior, but it does not include any information on the physical construction of the system. Modeling General Concepts K. Craig 34 • Many dissimilar and unrelated systems can be represented by the same block diagram. • A block diagram of a given system is not unique. A number of different block diagrams can be drawn for a system, depending on the point of view of the analysis. • Closed-Loop System Block Diagram: Σ Modeling General Concepts Σ K. Craig 35 B(s) = G c (s)G(s)H(s) E(s) C(s) = G c (s)G(s) E(s) Open-Loop Transfer Function Feedforward Transfer Function Closed-Loop Transfer Functions G c (s)G(s) C(s) = R(s) 1 + G c (s)G(s)H(s) G c (s)G(s)H(s) >> 1 C(s) G(s) = D(s) 1 + G c (s)G(s)H(s) G c (s)G(s)H(s) >> 1 G c (s)H(s) >> 1 C(s) 1 ⇒ R(s) H(s) C(s) ⇒0 D(s) G(s) C(s) = [G c (s)R(s) + D(s)] 1 + G c (s)G(s)H(s) Modeling General Concepts K. Craig 36 • Blocks can be connected in series only if the output of one block is not affected by the next following block. If there are any loading effects between components, it is necessary to combine these components into a single block. • In simplifying a block diagram, remember: – The product of the transfer functions in the feedforward direction must remain the same. – The product of the transfer functions around the loop must remain the same. Modeling General Concepts K. Craig 37 Some Rules of Block Diagram Algebra Modeling General Concepts K. Craig 38 Loading Effects • The unloaded transfer function is an incomplete component description. • To properly account for interconnection effects one must know three component characteristics: – the unloaded transfer function of the upstream component – the output impedance of the upstream component – the input impedance of the downstream component • Only when the ratio of output impedance over input impedance is small compared to 1.0, over the frequency range of interest, does the unloaded transfer function give an accurate description of interconnected system behavior. Modeling General Concepts K. Craig 39 u G1(s) G2(s) y ⎡ ⎤ Y(s) ⎢ 1 ⎥ = ⎢G1 (s) ⎥ G 2 (s) Z U(s) ⎢ 1 + o1 ⎥ Zi2 ⎦⎥ ⎣⎢ Only if Zo1 << 1 Zi2 Modeling General Concepts for the frequency range of interest will loading effects be negligible. K. Craig 40 • In general, loading effects occur because when analyzing an isolated component (one with no other component connected at its output), we assume no power is being drawn at this output location. • When we later decide to attach another component to the output of the first, this second component does withdraw some power, violating our earlier assumption and thereby invalidating the analysis (transfer function) based on this assumption. • When we model chains of components by simple multiplication of their individual transfer functions, we assume that loading effects are either not present, have been proven negligible, or have been made negligible by the use of buffer amplifiers. Modeling General Concepts K. Craig 41 Analog Electronics Example: Loading Effects ⎡ Vin ⎤ ⎡ RCs + 1 −R ⎤ ⎡ Vout ⎤ ⎢ i ⎥ = ⎢ Cs ⎥⎢i ⎥ 1 − ⎦ ⎣ out ⎦ ⎣ in ⎦ ⎣ Vout 1 1 when iout = 0 = = Vin RCs + 1 τs + 1 Zout = Zin = Vout i out Vin iin = Vin =0 = iout =0 R RCs + 1 RCs + 1 Cs Modeling General Concepts Resistor 15 KΩ Vin Vout Capacitor 0.01 μF RC Low-Pass Filter Output Impedance Input Impedance K. Craig 42 Resistor 15 KΩ Vin Capacitor 0.01 μF Resistor 15 KΩ Capacitor 0.01 μF Vout 2 RC Low-Pass Filters in Series Vout ⎛ 1 ⎞⎛ 1 ⎞ ≠ G(s)1−unloaded G(s) 2−unloaded = ⎜ ⎟⎜ ⎟ Vin ⎝ RCs + 1 ⎠⎝ RCs + 1 ⎠ Vout = G(s)1−loaded G(s) 2−unloaded Vin ⎛ 1 ⎛ 1 ⎞ ⎜⎜ =⎜ ⎟ + RCs 1 ⎝ ⎠ ⎜ 1 + Zout −1 ⎜ Zin −2 ⎝ Modeling General Concepts Only if Zout-1 << Zin-2 for the frequency range of interest will loading effects be negligible. ⎞ ⎟⎛ 1 ⎞ 1 ⎟⎜ = ⎟ 2 + RCs 1 ⎟⎝ ⎠ ( RCs + 1) + RCs ⎟ ⎠ K. Craig 43 Time Domain & Frequency Domain • Time domain and frequency domain are two ways of looking at the same dynamic system. They are interchangeable, i.e., no information is lost in changing from one domain to another. • They are complementary points of view that lead to a complete, clear understanding of the behavior of a dynamic engineering system. • Roughly speaking, in the time domain we measure how long something takes, whereas in the frequency domain we measure how fast or slow it is. • These are two ways of viewing the same thing! Modeling General Concepts K. Craig 44 – When you hear music and see color, you are experiencing the frequency domain. It is all around you, just like the time domain. – The frequency domain is a kind of hidden companion to our everyday world of time. We describe what happens in the time domain as temporal and in the frequency domain as spectral. – Most signals and processes involve both fast and slow components happening at the same time. Frequency domain analysis separates these components and helps to keep track of them. Modeling General Concepts K. Craig 45 • Mechanical Spectrum – – – – Second hand of a clock: 1 rpm Audio CDs: 200 to 500 rpm Dentist’s drill: 400,000 rpm Two-foot diameter tire on a car traveling at 60 mph: 840 rpm – Earth’s rotation: 0.00069 rpm (1000 mph at the equator!) – 1 Hz = 60 rpm = 2π rad/sec = 6.28 rad/sec. All have dimensions 1/time. Modeling General Concepts K. Craig 46 Mechanical Spectrum Electromagnetic Spectrum Modeling General Concepts K. Craig 47 • Electromagnetic Spectrum – Electromagnetic effects can be described in the frequency domain as well. – Electromagnetic waves travel at the speed of light c, which depends on the medium (fastest in a vacuum, slower in other media). – The frequency of vibration f depends on the wavelength λ of the electromagnetic phenomenon and the speed of propagation c of the medium according to f = c/λ. – Long-wavelength electromagnetic waves are radio waves (see spectrum diagram). Frequencies range from a few kHz to 300 GHz. – Higher frequencies are emitted by thermal motion, which we call infrared radiation. Modeling General Concepts K. Craig 48 – Frequencies of visible light range from 440 THz (red light) to 730 THz (violet light). – Humans perceive different frequencies within the visible light spectrum as different colors. Unlike the ear, the eye has a nonlinear response to combinations of frequencies. Modeling General Concepts K. Craig 49 Electromagnetic Spectrum Modeling General Concepts K. Craig 50 Radio Spectrum Modeling General Concepts K. Craig 51 • Time Domain – The time domain is a record of the response of a dynamic system, as indicated by some measured parameter, as a function of time. This is the traditional way of observing the output of a dynamic system. – An example of time response is the displacement of the mass of the spring-mass-damper system versus time in response to the sudden placement of an additional mass (here 50% of the attached mass) on the attached mass. The resulting response is the step response of the system due to the sudden application of a constant force to the attached mass equal to the weight of the additional mass. Typically when we investigate the performance of a dynamic system we use as the input to the system a step input. Modeling General Concepts K. Craig 52 Modeling General Concepts K. Craig 53 • Frequency Domain – Over one hundred years ago, Jean Baptiste Fourier showed that any waveform that exists in the real world can be generated by adding up sine waves. – By picking the amplitudes, frequencies, and phases of these sine waves, one can generate a waveform identical to the desired signal. – While the situation presented on the next page is contrived, it does illustrate the idea. On the left is a “real-world” signal and on the right are three signals, the sum of which is the same as the “real-world” signal. Modeling General Concepts K. Craig 54 Modeling General Concepts K. Craig 55 – A more convincing example is to observe that a square wave can be represented by a series of sine waves of different amplitudes, frequencies, and phase angles. In the diagram below, a square wave has been approximated with only two sine waves. As more sine waves are added to the series, the approximation becomes better and better. Modeling General Concepts K. Craig 56 – Any real-world signal can be broken down into a sum of sine waves and this combination of sine waves is unique. Any real-world signal can be represented by only one combination of sine waves. – In the diagram, a waveform is represented as the sum of two sine waves. Modeling General Concepts K. Craig 57 – In figure (a) is a three-dimensional graph of this addition of sine waves. The three axes are time, amplitude, and frequency. The time and amplitude axes are familiar from the time domain. The third axis, frequency, allows us to visually separate the sine waves that add to give us the complex waveform. – If we view this three-dimensional graph along the frequency axis, we get the view shown in figure (b). This is the time-domain view of the sine waves. Adding them together at each instant of time gives the original waveform. Modeling General Concepts K. Craig 58 – Now view the three-dimensional graph along the time axis, as in figure (c). Here we have axes of amplitude versus frequency. This is what is called the frequency domain. Every sine wave we separated from the input appears as a vertical line. Its height represents its amplitude and its position represents its frequency. We know each line represents a sine wave and so we have uniquely characterized our input signal in the frequency domain. This frequency domain representation of our signal is called the spectrum of the signal. Each sine wave line of the spectrum is called a component of the total signal. Modeling General Concepts K. Craig 59 Modeling General Concepts K. Craig 60 – It is most important to understand that we have neither gained nor lost information, we are just representing it differently. – You can now see why a sine wave is the second important signal, the step input being the other, used to excite a dynamic system. – Since any real-world signal can be represented by the sum of sine waves, if we can predict the response of a system to a sine wave input of varying frequency, amplitude, and phase angle, then we can predict the response of the system to any real-world signal once we know the frequency spectrum of that real-world signal. Modeling General Concepts K. Craig 61 The Three Basic Element Input-Output Relationships Resistor Damper Inductor Mass Capacitor Spring Modeling General Concepts K. Craig 62 qin = i, v qout = e, f Resistor, Damper 1 1 i= e v= f R B e = Ri f = Bv Capacitor, Spring de i = C = CDe dt 1 e= i CD Inductor, Mass di e = L = LDi dt 1 i= e LD Modeling General Concepts 1 df 1 v= = Df K dt K K f= v D dv f =M = MDv dt 1 v= f MD K. Craig 63 Step Response Modeling General Concepts K. Craig 64 Step Response Modeling General Concepts K. Craig 65 Step Response Modeling General Concepts K. Craig 66 • Step Response and Impulse Response – By a step input of any variable we mean a situation where the system is “at rest” at time t = 0 and we instantly change the input quantity, from wherever it was just before t = 0, by a given amount, either positive or negative, and then keep the input constant at this new value “forever.” – The integral of a step input is a ramp and the derivative of a step input is an impulse. Modeling General Concepts K. Craig 67 The impulse function is explained by the figure, where we approximate the step function by a terminated ramp and then let the rise time of the ramp approach zero. As we let the ramp get steeper and steeper, the magnitude of de/dt approaches infinity, and its duration approaches zero, but the area under it will always be es. If es = 1 (a unit step function), its derivative is called the unit impulse function with an area or strength equal to one unit. The step function is the integral of the impulse function, or conversely, the impulse function is the derivative of the step function. When we multiply the impulse function by some number, we increase the “strength of the impulse”, but “strength” now means area, not height as it does for “ordinary” functions. Modeling General Concepts K. Craig 68 – An impulse that has an infinite magnitude and zero duration is mathematical fiction and does not occur in physical systems. If, however, the magnitude of a pulse input to a system is very large and its duration is very short compared to the system’s speed of response, then we can approximate the pulse input by an impulse function. The impulse input supplies energy to the system in an infinitesimal time. – The step response of a component or system is the time response to a step input of some magnitude. The impulse response of a system is the derivative of the step response and is the time response to an impulse input of some strength. Modeling General Concepts K. Craig 69 • Frequency Response – Linear ODE with Constant Coefficients dn qo d n −1q o dq o + a 0q o = a n n + a n −1 n −1 + " + a1 dt dt dt d mqi d m−1q i dq i + b0qi b m m + b m−1 m−1 + " + b1 dt dt dt – qo is the output (response) variable of the system – qi is the input (excitation) variable of the system – an and bm are the physical parameters of the system Modeling General Concepts K. Craig 70 – If the input to a linear system is a sine wave, the steadystate output (after the transients have died out) is also a sine wave with the same frequency, but with a different amplitude and phase angle. q i = Qi sin(ωt) – System Input: q o = Qo sin(ωt + φ) – System Steady-State Output: – Both amplitude ratio, Qo/Qi , and phase angle, φ, change with frequency, ω. – The frequency response can be determined analytically from the Laplace transfer function: G(s) s = iω Modeling General Concepts Sinusoidal Transfer Function M(ω)∠φ(ω) K. Craig 71 – A negative phase angle is called phase lag, and a positive phase angle is called phase lead. – If the system being excited were a nonlinear or timevarying system, the output might contain frequencies other than the input frequency and the output-input ratio might be dependent on the input magnitude. – Any real-world device or process will only need to function properly for a certain range of frequencies; outside this range we don’t care what happens. Modeling General Concepts K. Craig 72 System Frequency Response (linear scales used) Modeling General Concepts K. Craig 73 Analog Electronics Example RC Low-Pass Filter Time Response & Frequency Response Time Response Vout 1 = Vin RCs + 1 Resistor 15 KΩ Vin Capacitor 0.01 μF Vout Time Constant τ = RC Modeling General Concepts K. Craig 74 Frequency Response Bandwidth = 1/τ Vout K = ( iω ) = Vin iωτ + 1 Modeling General Concepts K∠0D ( ωτ ) + 1 ∠ tan ωτ 2 2 −1 = K 2 ωτ + 1 ( ) 2 ∠ − tan −1 ωτ K. Craig 75 Amplitude Ratio = 0.707 = -3 dB Response to Input 1061 Hz Sine Wave 1 Input Phase Angle = -45° 0.8 0.6 0.4 amplitude 0.2 0 -0.2 Output -0.4 -0.6 -0.8 -1 0 Modeling General Concepts 0.5 1 1.5 2 time (sec) 2.5 3 3.5 4 x 10 -3 K. Craig 76 – When one has the frequency-response curves for any system and is given a specific sinusoidal input, it is an easy calculation to get the sinusoidal output. – What is not obvious, but extremely important, is that the frequency-response curves are really a complete description of the system’s dynamic behavior and allow one to compute the response for any input, not just sine waves. – Every dynamic signal has a frequency spectrum and if we can compute this spectrum and properly combine it with the system’s frequency response, we can calculate the system time response. Modeling General Concepts K. Craig 77 – The details of this procedure depend on the nature of the input signal; is it periodic, transient, or random? – For periodic signals (those that repeat themselves over and over in a definite cycle), Fourier Series is the mathematical tool needed to solve the response problem. – Although a single sine wave is an adequate model of some real-world input signals, the generic periodic signal fits many more practical situations. – A periodic function qi(t) can be represented by an infinite series of terms called a Fourier Series. Modeling General Concepts K. Craig 78 a0 2 ∞ ⎡ ⎛ 2πn ⎞ ⎛ 2πn ⎞ ⎤ q i ( t ) = + ∑ ⎢a n cos ⎜ t ⎟ + b n sin ⎜ t ⎟⎥ T T n =1 ⎣ ⎝ T ⎠ ⎝ T ⎠⎦ T 2 ⎛ 2πn ⎞ a n = ∫ q i ( t ) cos ⎜ t ⎟ dt T ⎠ ⎝ T − 2 T 2 ⎛ 2πn ⎞ b n = ∫ q i ( t ) sin ⎜ t ⎟ dt T ⎠ ⎝ T − Fourier Series 2 Modeling General Concepts K. Craig 79 q i(t) 1.5 Consider the Square Wave: -0.01 +0.01 t -0.5 0 a0 = T ∫ 0.01 −0.5dt + −0.01 ∫ 1.5dt 0 0.02 0 = 0.5 = average value ⎛ 2πn ⎞ a n = ∫ −0.5cos ⎜ t ⎟ dt + ⎝ 0.02 ⎠ −0.01 0.01 ∫ 0 ⎛ 2πn ⎞ 1.5cos ⎜ t ⎟ dt = 0 ⎝ 0.02 ⎠ 1 − cos ( nπ ) ⎛ 2πn ⎞ ⎛ 2πn ⎞ b n = ∫ −0.5sin ⎜ t ⎟ dt + ∫ 1.5sin ⎜ t ⎟ dt = 50nπ ⎝ 0.02 ⎠ ⎝ 0.02 ⎠ −0.01 0 4 4 q i ( t ) = 0.5 + sin (100πt ) + sin ( 300πt ) + " π 3π 0 Modeling General Concepts 0.01 K. Craig 80 – The term for n = 1 is called the fundamental or first harmonic and always has the same frequency as the repetition rate of the original periodic wave form (50 Hz in this example); whereas n = 2, 3, … gives the second, third, and so forth harmonic frequencies as integer multiples of the first. – The square wave has only the first, third, fifth, and so forth harmonics. The more terms used in the series, the better the fit. An infinite number gives a “perfect” fit. Modeling General Concepts K. Craig 81 2 1.5 1 amplitude Plot of the Fourier Series for the square wave through the third harmonic 0.5 0 -0.5 -1 -0.01 -0.008 -0.006 -0.004 -0.002 0 0.002 0.004 0.006 0.008 time (sec) 0.01 4 4 q i ( t ) = 0.5 + sin (100πt ) + sin ( 300πt ) 3π π Modeling General Concepts K. Craig 82 – For a signal of arbitrary periodic shape (rather than the simple and symmetrical square wave), the Fourier Series will generally include all the harmonics and both sine and cosine terms. – We can combine the sine and cosine terms using: A cos ( ωt ) + Bsin ( ωt ) = Csin ( ωt + α ) C = A 2 + B2 −1 A α = tan B – Thus q i ( t ) = A i0 + A i1 sin ( ω1t + α1 ) + A i2 sin ( 2ω1t + α 2 ) +" Modeling General Concepts K. Craig 83 – A graphical display of the amplitudes (Aik) and the phase angles (αk) of the sine waves in the equation for qi(t) is called the frequency spectrum of qi(t). – If a periodic qi(t) is applied as input to a system with sinusoidal transfer function G(iω), after the transients have died out, the output qo(t) will be in a periodic steady-state given by: q o ( t ) = A o0 + A o1 sin ( ω1t + θ1 ) + A o2 sin ( 2ω1t + θ2 ) + " A ok = A ik G ( iωk ) θk = α k + ∠G ( iωk ) – This follows from superposition and the definition of the sinusoidal transfer function. Modeling General Concepts K. Craig 84 Frequency Response Modeling General Concepts K. Craig 85 1 KD t q out q in = A sin ( ωt ) 1 1 = q in = ∫ q in dt + ( q out )initial KD K0 Frequency Response 1 t A sin ( ωt ) K ∫0 A A cos ( ωt ) + = ( q out )initial − Kω Kω A A π sin ⎛⎜ ωt − ⎞⎟ + = ( q out )initial + Kω ⎝ 2 ⎠ Kω q out = ( q out )initial + q out Modeling General Concepts K. Craig 86 Frequency Response Modeling General Concepts K. Craig 87 State-Space Representation • Conventional Control Theory (root-locus and frequency response analysis and design) is applicable to linear, timeinvariant, single-input, single-output systems. This is a complex frequency-domain approach. The transfer function relates the input to output and does not show internal system behavior. • Modern Control Theory (state-space analysis and design) is applicable to linear or nonlinear, time-varying or timeinvariant, multiple-input, multiple-output systems. This is a time-domain approach. This state-space system description provides a complete internal description of the system, including the flow of internal energy. Modeling General Concepts K. Craig 88 – A state-determined system is a special class of lumpedparameter dynamic system such that: (i) specification of a finite set of n independent parameters, state variables, at time t = t0 and (ii) specification of the system inputs for all time t ≥ t0 are necessary and sufficient to uniquely determine the response of the system for all time t ≥ t0. – The state is the minimum amount of information needed about the system at time t0 such that its future behavior can be determined without reference to any input before t0. Modeling General Concepts K. Craig 89 – The state variables are independent variables capable of defining the state from which one can completely describe the system behavior. These variables completely describe the effect of the past history of the system on its response in the future. – Choice of state variables is not unique and they are often, but not necessarily, physical variables of the system. They are usually related to the energy stored in each of the system's energy-storing elements, since any energy initially stored in these elements can affect the response of the system at a later time. Modeling General Concepts K. Craig 90 – State variables do not have to be physical or measurable quantities, but practically they should be chosen as such since optimal control laws will require the feedback of all state variables. – The state-space is a conceptual n-dimensional space formed by the n components of the state vector. At any time t the state of the system may be described as a point in the state space and the time response as a trajectory in the state space. – The number of elements in the state vector is unique, and is known as the order of the system. Modeling General Concepts K. Craig 91 – Since integrators in a continuous-time dynamic system serve as memory devices, the outputs of integrators can be considered as state variables that define the internal state of the dynamic system. Thus the outputs of integrators can serve as state variables. – The state-variable equations are a coupled set of firstorder ordinary differential equations where the derivative of each state variable is expressed as an algebraic function of state variables, inputs, and possibly time. Modeling General Concepts K. Craig 92 G G G G x(t) = f (x, u, t) G G G G y(t) = g(x, u, t) G• G G x(t) = A(t)x(t) + B(t)u(t) G G G y(t) = C(t)x(t) + D(t)u(t) Non-Linear, Time-Varying Linear, Time-Varying • D(t) Direct Transmission Matrix Input Matrix u(t) Inputs B(t) + + State Variables • Σ x(t) ∫ dt State Matrix x(t) Outputs + C(t) + Σ y(t) Output Matrix A(t) Modeling General Concepts K. Craig 93 State-Space to Transfer Function G• G G x(t) = Ax(t) + Bu(t) G G G y(t) = Cx(t) + Du(t) Laplace Transform Y(s) = G(s) U(s) sX(s) − x(0) = AX(s) + BU(s) Y(s) = CX(s) + DU(s) sX(s) − AX(s) = BU(s) Zero Initial Conditions [sI − A ] X(s) = BU(s) −1 X(s) = [sI − A ] BU(s) −1 Y(s) = ⎡⎣C [sI − A ] B + D ⎤⎦ U(s) −1 Y(s) = [ CΦ (s)B + D ] U(s) Define: Φ (s) = [sI − A ] Y(s) = [ CΦ (s)B + D ] = G(s) U(s) Modeling General Concepts K. Craig 94 • The poles of the transfer function are the eigenvalues of the system matrix A. sI − A = 0 Characteristic Equation • A zero of the transfer function is a value of s that satisfies: sI − A − B C D =0 • The transfer function can be written as: sI − A − B C D G(s) = sI − A Modeling General Concepts K. Craig 95 Poles and Zeros of Transfer Functions • Definition of Poles and Zeros – A pole of a transfer function G(s) is a value of s (real, imaginary, or complex) that makes the denominator of G(s) equal to zero. – A zero of a transfer function G(s) is a value of s (real, imaginary, or complex) that makes the numerator of G(s) equal to zero. K(s + 2)(s + 10) – For Example: G(s) = s(s + 1)(s + 5)(s + 15) 2 Poles: 0, -1, -5, -15 (order 2) Zeros: -2, -10, ∞ (order 3) Modeling General Concepts K. Craig 96 • Collocated Control System – All energy storage elements that exist in the system exist outside of the control loop. – For purely mechanical systems, separation between sensor and actuator is at most a rigid link. • Non-Collocated Control System – At least one storage element exists inside the control loop. – For purely mechanical systems, separating link between sensor and actuator is flexible. Modeling General Concepts K. Craig 97 • Physical Interpretation of Poles and Zeros – Complex Poles of a collocated control system and those of a non-collocated control system are identical. – Complex Poles represent the resonant frequencies associated with the energy storage characteristics of the entire system. – Complex Poles, which are the natural frequencies of the system, are independent of the locations of sensors and actuators. – At a frequency of a complex pole, even if the system input is zero, there can be a nonzero output. Modeling General Concepts K. Craig 98 – Complex Poles represent the frequencies at which energy can freely transfer back and forth between the various internal energy storage elements of the system such that even in the absence of any external input, there can be nonzero output. – Complex Poles correspond to the frequencies where the system behaves as an energy reservoir. – Complex Zeros of the two control systems are quite different and they represent the resonant frequencies associated with the energy storage characteristics of a sub-portion of the system defined by artificial constraints imposed by the sensors and actuators. Modeling General Concepts K. Craig 99 – Complex Zeros correspond to the frequencies where the system behaves as an energy sink. – Complex Zeros represent frequencies at which energy being applied by the input is completely trapped in the energy storage elements of a sub-portion of the original system such that no output can ever be detected at the point of measurement. – Complex Zeros are the resonant frequencies of a subsystem constrained by the sensors and actuators. – If n is the number of poles and m is the number of zeros, the system is said to have n-m zeros at infinity if m < n because the transfer function approaches zero as s approaches infinity. If the zeros at infinity are also counted, the system will have the same number of poles and zeros. No physical system can have n < m; otherwise , it would have infinite response at ω = ∞. Modeling General Concepts K. Craig 100 Transfer Function Pole-Zero Example Two-Mass, Three-Spring, Motor-Driven Dynamic System (shown with optical encoders instead of infrared position sensors) Modeling General Concepts K. Craig 101 Physical System Schematic Infrared Position Sensor Motor with Encoder Springs Infrared Position Sensor Rack and Pinion M1 M2 Connecting Bar Linear Bearings Guideway Two-Mass Three-Spring Dynamic System Modeling General Concepts K. Craig 102 Diagram of Physical Model Jmotor Bmotor Tfriction Jpinion X1 Tm θ rp K X2 K M1 B1 Ff1 K M2 B2 Ff2 Two-Mass Three-Spring Dynamic System Physical Model Modeling General Concepts K. Craig 103 Mathematical Model: Transfer Functions and State Space Equations X1 (s) 3.2503s 2 + 4.5887s + 2518.7 = 4 Vin (s) s + 2.3449s3 + 1265.7s 2 + 1414.1s + 284460 X 2 (s) 1259.3 = 4 Vin (s) s + 2.3449s3 + 1265.7s 2 + 1414.1s + 284460 1 0 0 ⎤ ⎡ 0 ⎢ −489.45 −0.93313 244.72 0 ⎥ ⎥ A=⎢ 0 0 1 ⎥ ⎢ 0 ⎢ 387.45 ⎥ 0 774.90 1.4118 − − ⎣ ⎦ ⎡1 0 0 0 ⎤ ⎡0 ⎤ C=⎢ D= ⎢ ⎥ ⎥ ⎣0 0 1 0 ⎦ ⎣0 ⎦ Modeling General Concepts ⎡ 0 ⎤ ⎢3.2503⎥ ⎥ B= ⎢ ⎢ 0 ⎥ ⎢ 0 ⎥ ⎣ ⎦ K. Craig 104 Mathematical Model: Poles and Zeros Poles: Zeros: −0.536 ± 17.1i ⇒ −0.637 ± 31.2i ⇒ X1 ( s ) ⇒ −0.706 ± 27.8i Vin ( s ) X2 (s) ⇒ Vin ( s ) Modeling General Concepts ω = 17.1 rad/s ζ =0.0313 ω=31.2 rad/s ζ =0.0204 ⇒ ω = 27.8 rad/s ζ =0.0254 None K. Craig 105 Frequency Response Plots: Analytical Bode Diagrams X1 Vin -20 -30 Phase (deg); Magnitude (dB) -40 -50 -60 -70 0 -50 -100 -150 10 0 10 1 10 2 Frequency (rad/sec) Modeling General Concepts K. Craig 106 Frequency Response Plots: Analytical X2 Vin Bode Diagrams -20 -40 Phase (deg); Magnitude (dB) -60 -80 0 -100 -200 -300 10 0 10 1 10 2 Frequency (rad/sec) Modeling General Concepts K. Craig 107 Sensitivity Analysis • Consider the function y = f(x). If the parameter x changes by an amount Δx, then y changes by the amount Δy. If Δx is small, Δy can be estimated from the slope dy/dx as follows: dy Δy = Δx dx • The relative or percent change in y is Δy/y. It is related to the relative change in x as follows: Δy dy Δx ⎛ x dy ⎞ Δx = =⎜ ⎟ y dx y ⎝ y dx ⎠ x Modeling General Concepts K. Craig 108 • The sensitivity of y with respect to changes in x is given by: x dy dy / y d(ln y) Sxy = • Thus y dx = dx / x = d(ln x) Δy y Δx = Sx y x • Usually the sensitivity is not constant. For example, the function y = sin(x) has the sensitivity function: x cos ( x ) x dy x x S = = cos ( x ) = = y dx y sin ( x ) tan ( x ) y x Modeling General Concepts K. Craig 109 • Sensitivity of Control Systems to Parameter Variation and Parameter Uncertainty – A process, represented by the transfer function G(s), is subject to a changing environment, aging, ignorance of the exact values of the process parameters, and other natural factors that affect a control process. – In the open-loop system, all these errors and changes result in a changing and inaccurate output. – However, a closed-loop system senses the change in the output due to the process changes and attempts to correct the output. – The sensitivity of a control system to parameter variations is of prime importance. Modeling General Concepts K. Craig 110 – Accuracy of a measurement system is affected by parameter changes in the control system components and by the influence of external disturbances. – A primary advantage of a closed-loop feedback control system is its ability to reduce the system’s sensitivity. – Consider the closed-loop system shown. Let the disturbance D(s) = 0. D(s) R(s) + E(s) Σ B(s) Modeling General Concepts + + Σ G c (s) G(s) C(s) H(s) K. Craig 111 – An open-loop system’s block diagram is given by: C(s) R(s) G c (s) G(s) – The system sensitivity is defined as the ratio of the percentage change in the system transfer function T(s) to the percentage change in the process transfer function G(s) (or parameter) for a small incremental change: C(s) T(s) = R(s) ∂T / T ∂T G T = SG = ∂G / G ∂G T Modeling General Concepts K. Craig 112 – For the open-loop system C(s) T(s) = = G c (s)G(s) R(s) G(s) ∂T / T ∂T G T = = G c (s) =1 SG = ∂G / G ∂G T G c (s)G(s) – For the closed-loop system G c (s)G(s) C(s) = T(s) = R(s) 1 + G c (s)G(s)H(s) ∂T / T ∂T G = S = ∂G / G ∂G T 1 G 1 = = (1 + G c GH) 2 G c G G c (1 + G c GH ) 1 + G c GH T G Modeling General Concepts K. Craig 113 – The sensitivity of the system may be reduced below that of the open-loop system by increasing GcGH(s) over the frequency range of interest. – The sensitivity of the closed-loop system to changes in the feedback element H(s) is: G c (s)G(s) C(s) T(s) = = R(s) 1 + G c (s)G(s)H(s) ∂T / T ∂T H S = = ∂H / H ∂H T −(G c G) 2 −G c GH H = = 2 G cG (1 + G c GH) (1 + G cGH ) 1 + G c GH T H Modeling General Concepts K. Craig 114 – When GcGH is large, the sensitivity approaches unity and the changes in H(s) directly affect the output response. Use feedback components that will not vary with environmental changes or can be maintained constant. – As the gain of the loop (GcGH) is increased, the sensitivity of the control system to changes in the plant and controller decreases, but the sensitivity to changes in the feedback system (measurement system) becomes -1. – Also the effect of the disturbance input can be reduced by increasing the gain GcH since: G (s) C (s) = D (s) 1 + Gc (s) G (s) H (s) Modeling General Concepts K. Craig 115 • Therefore: – Make the measurement system very accurate and stable. – Increase the loop gain to reduce sensitivity of the control system to changes in plant and controller. – Increase gain GcH to reduce the influence of external disturbances. • In practice: – G is usually fixed and cannot be altered. – H is essentially fixed once an accurate measurement system is chosen. – Most of the design freedom is available with respect to Gc only. Modeling General Concepts K. Craig 116 • It is virtually impossible to achieve all the design requirements simply by increasing the gain of Gc. The dynamics of Gc also have to be properly designed in order to obtain the desired performance of the control system. • Very often we seek to determine the sensitivity of the closed-loop system to changes in a parameter α within the transfer function of the system G(s). Using the chain rule we find: T T G Sα = SGSα • Very often the transfer function T(s) is a fraction of the form: N(s, α) T(s, α) = D(s, α) Modeling General Concepts K. Craig 117 – Then the sensitivity to α (α0 is the nominal value) is given by: STα = ∂T / T ∂ ln T ∂ ln N ∂ ln D = = − = SαN − SαD ∂α / α ∂ ln α ∂ ln α α0 ∂ ln α α0 Modeling General Concepts K. Craig 118