Lecture 1: Introduction to System Modeling and Control Introduction Basic Definitions Different Model Types System Identification
What is Mathematical Model? A set of mathematical equations (e.g., differential eqs.) that describes the input-output behavior of a system. What is a model used for? Simulation Prediction/Forecasting Prognostics/Diagnostics Design/Performance Evaluation Control System Design
Definition of System System: An aggregation or assemblage of things so combined by man or nature to form an integral and complex whole. From engineering point of view, a system is defined as an interconnection of many components or functional units act together to perform a certain objective, e.g., automobile, machine tool, robot, aircraft, etc.
System Variables To every system there corresponds three sets of variables: Input variables originate outside the system and are not affected by what happens in the system Output variables are the internal variables that are used to monitor or regulate the system. They result from the interaction of the system with its environment and are influenced by the input variables u System y
Dynamic Systems A system is said to be dynamic if its current output may depend on the past history as well as the present values of the input variables. Mathematically, y ( t ) = ϕ[ u ( τ),0 τ t ] u : Input, t : Time Example: A moving mass Model: Force=Mass x Acceleration u M y M y = u
Example of a Dynamic System Velocity-Force: Position-Force: v ( t) = y ( t) = y (0) y ( t) = y (0) + ty (0) + + 1 M t 0 u( τ) dτds u( τ) dτ Therefore, this is a dynamic system. If the drag force (bdx/dt) is included, then 1 M t s 0 0 M y + b y = u 2nd order ordinary differential equation (ODE)
Mathematical Modeling Basics Mathematical model of a real world system is derived using analytical and experimental means Analytical model is derived based on governing physical laws for the system such as Newton's law, Ohms law, etc. It is often assembled into a single or system of differential (difference in the case of discrete-time systems) equations An analytical model maybe linear or nonlinear
Mathematical Modeling Basics A nonlinear model is often linearized about a certain operating point Model reduction (or approximation) may be needed to get a lumped-parameter (finite dimensional) model Numerical values of the model parameters are often approximated from experimental data by curve fitting.
Different Types of Lumped- Parameter Models System Type Nonlinear Linear Linear Time Invariant Model Type Input-output differential or difference equation State equations (system of 1st order eqs.) Transfer function
Input-Output Models Differential Equations (Continuous-Time Systems) y ( n) ( n 1) ( n 1) + a y + + an y 1 1 + any = b1u + + bn 1 u + b u n Discretization Inverse Discretization Difference Equations (Discrete-Time Systems) y ( 1 k) = a1y ( k 1) + + any( k n) + b u( k 1) + + bnu( k n)
Example II: Accelerometer Consider the mass-spring-damper (may be used as accelerometer or seismograph) system shown below: Free-Body-Diagram x x u f s f s M M f d f d f s (y): position dependent spring force, y=x-u f d (y): velocity dependent spring force = Newton s 2nd law Mx M ( y + u ) = f ( y ) f ( y ) Linearizaed model: My + by + ky = d Mu s
Example II: Delay Feedback Consider the digital system shown below: u Delay z -1 y Input-Output Eq.: y ( k ) = y ( k 1) + u( k 1) y ( k ) Equivalent to an integrator: j = = k 1 0 u( j )
Transfer Function Transfer Function is the algebraic input-output relationship of a linear time-invariant system in the s (or z) domain U G Y Example: Accelerometer System m y + by + ky = mu Y ( s) G( s) = = 2 U ( s) ms 2 ms + bs + k, s d dt Example: Digital Integrator y 1 Y ( z ) z ( k ) = y ( k 1) + u ( k 1) G = = 1 u ( z ) 1 z, z Forward shift
Comments on TF Transfer function is a property of the system independent from input-output signal It is an algebraic representation of differential equations Systems from different disciplines (e.g., mechanical and electrical) may have the same transfer function
Mixed Systems Most systems in mechatronics are of the mixed type, e.g., electromechanical, hydromechanical, etc Each subsystem within a mixed system can be modeled as single discipline system first Power transformation among various subsystems are used to integrate them into the entire system Overall mathematical model may be assembled into a system of equations, or a transfer function
Electro-Mechanical Example Input: voltage u Output: Angular velocity ω Elecrical Subsystem (loop method): u R a i a L a dc B ω J u = di a Ra ia + La + eb, eb = dt back - emf voltage Mechanical Subsystem T motor = Jω + Bω
Electro-Mechanical Example Power Transformation: Torque-Current: Voltage-Speed: T = K e motor b = Combing previous equations results in the following mathematical model: K b where K t : torque constant, K b : velocity constant For an ideal motor K = K t ω b t i a u R a i a L a dc B ω di a La + Raia dt Jω + Bω - K t + i a K b = 0 ω = u
Transfer Function of Electromechanical Example Taking Laplace transform of the system s differential equations with zero initial conditions gives: ( Las + Ra ) ( Js + B) Ω I a (s) ( s) + K - K t I a b Ω( s) ( s) = 0 = U ( s) u R a i a L a K t B ω Eliminating I a yields the input-output transfer function Ω(s) U(s) = L a Js 2 + K t ( JRa + BLa ) + BRa + KtKb
Reduced Order Model Assuming small inductance, L a 0 Ω(s) U(s) = Js + ( Kt Ra ) ( B + K K R ) t b a which is equivalent to K K t b R a B Ktu R a ω The D.C. motor provides an input torque and an additional damping effect known as back-emf damping
System identification Experimental determination of system model. There are two methods of system identification: Parametric Identification: The input-output model coefficients are estimated to fit the input-output data. Frequency-Domain (non-parametric): The Bode diagram [G(jw) vs. w in log-log scale] is estimated directly form the input-output data. The input can either be a sweeping sinusoidal or random signal.
Electro-Mechanical Example Transfer Function, L a =0: Ω(s) U(s) = Js + ( Kt Ra ) k = ( B + K K R ) Ts + 1 t b a u R a i a L a K t B ω u t ku 12 10 8 k=10, T=0.1 Amplitude 6 4 2 T 0 0 0.1 0.2 0.3 0.4 0.5 Time (secs)
Comments on First Order Identification Graphical method is difficult to optimize with noisy data and multiple data sets only applicable to low order systems difficult to automate
Least Squares Estimation Given a linear system with uniformly sampled input output data, (u(k),y(k)), then y( k) = a1y ( k 1) + + an y( k n) + b1u ( k 1) + + bnu( k n) + noise Least squares curve-fitting technique may be used to estimate the coefficients of the above model called ARMA (Auto Regressive Moving Average) model.
System Identification Structure Input: Random or deterministic u plant n Noise model Random Noise Output y persistently exciting with as much power as possible; uncorrelated with the disturbance as long as possible
Basic Modeling Approaches Analytical Experimental Time response analysis (e.g., step, impulse) Parametric * ARX, ARMAX * Box-Jenkins * State-Space Nonparametric or Frequency based * Spectral Analysis (SPA) * Emperical Transfer Function Analysis (ETFE)
Real-World Linear Motor Example u: voltage y: position
Experimental Input-Output Data 0.4 0.2 input 0-0.2-0.4 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 4 x 10-3 2 output 0-2 -4 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Time (sec)
ARMA Model Assume a 2nd order ARMA model y ( 2 k) = a1y ( k 1) + a2y( k 2) + b1u ( k 1) + b u( k 2) Least squares fit is used to determine a i s and b i s Matlab commands: %Load input-output data U,Y TH=arx([Y,U],[2,2,1]);
Model Validation 3 x 10-3 Output # 1 Fit: 0.00067122 2 1 0-1 -2-3 0 1000 2000 3000 4000 5000 6000 Yellow: Model output, Magenta: Measured output
Model Step Response 0.03 0.025 0.02 output 0.015 0.01 0.005 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Time (sec)
Frequency Domain Identification Bode Diagram of G ( s ) k = Ts + 1 20log( k ) 20 Gain db 10 0-10 10-1 10 0 10 1 10 2 0 Frequency (rad/sec) 1/T Phase deg -30-60 -90 10-1 10 0 10 1 10 2 Frequency (rad/sec)
Identification Data Method I (Sweeping Sinusoidal): f A i system t>>0 A o Magnitude Method II (Random Input): = Phase A 0, = φ A i db system Transfer function is determined by analyzing the spectrum of the input and output
Random Input Method Pointwise Estimation: Y( ω) G( jω) = U ( ω) This often results in a very nonsmooth frequency response because of data truncation and noise. Spectral estimation: uses smoothed sample estimators based on input-output covariance and crosscovariance. Gˆ( e ) = ( ω) The smoothing process reduces variability at the expense of adding bias to the estimate jω Φˆ Φˆ yu u ( ω)
Random Input Response Matlab Commands to get Bode plot: 2 > % Create Random Input U > % Collect system response Y to input U > Z=detrend([Y,U]); > G=spa(Z); > Gs=sett(G,Ts); %specify sampling time Ts > bodeplot(gs) Input Output 1 0-1 0 1 2 3 4 5 15 10 5 0 0 1 2 3 4 5 Time (sec)
Experimental Bode Plot 10-2 AMPLITUDE PLOT, input # 1 output # 1 10-4 10-6 1/T 10-8 10 1 10 2 10 3 10 4 PHASE frequency PLOT, input (rad/sec) # 1 output # 1 0 phase -200-400 -600 10 1 10 2 10 3 10 4 frequency (rad/sec)
Photo Receptor Drive Test Fixture
Experimental Bode Plot
System Models 25 Magnitude (db) 0 25 50 low order high order 75 0.1 1 10 100 1 10 3 Frequency (Hz) 180 90 Phase (Deg) 0 90 180 0.1 1 10 100 1 10 3 Frequency (Hz)