Lecture 13 - Handling Nonlinearity • Nonlinearity issues in control practice • Setpoint scheduling/feedforward – path planning replay - linear interpolation • Nonlinear maps – – – – B-splines Multivariable interpolation: polynomials/splines/RBF Neural Networks Fuzzy logic • Gain scheduling • Local modeling EE392m - Winter 2003 Control Engineering 13-1 Nonlinearity in control practice Here are the nonlinearities we already looked into • Constraints - saturation in control – anti-windup in PID control – MPC handles the constraints • Control program, path planning • Static optimization • Nonlinear dynamics – dynamic inversion – nonlinear IMC – nonlinear MPC One additional nonlinearity in this lecture • Controller gain scheduling EE392m - Winter 2003 Control Engineering 13-2 Dealing with nonlinear functions • Analytical expressions – models are given by analytical formulas, computable as required – rarely sufficient in practice • Models are computable off line – pre-compute simple approximation – on-line approximation • Models contain data identified in the experiments – nonlinear maps – interpolation or look-up tables • Advanced approximation methods – neural networks EE392m - Winter 2003 Control Engineering 13-3 Path planning • Real-time replay of a pre-computed reference trajectory yd(t) or feedforward v(t) • Reproduce a nonlinear function yd(t) in a control system θ1 Y1 = yd (θ1 ) θ Y = y (θ ) Path planner, d 2 2 t yd(t) Y = 2 , Θ = data arrays Y ,Θ M M θ n Yn = yd (θ n ) Code: 1. Find j, such that θ j ≤ t ≤ θ j +1 2. Compute θ j +1 − t t −θ j + Y j +1 yd (t ) = Y j θ j +1 − θ j θ j +1 − θ j EE392m - Winter 2003 Control Engineering 13-4 Linear interpolation vs. table look-up • linear interpolation is more accurate • requires less data storage • simple computation EE392m - Winter 2003 Control Engineering 13-5 Empirical models • Aerospace - most developed nonlinear approaches – automotive and process control have second place Example • Aerodynamic tables • Engine maps – jet turbines – automotive • Process maps, e.g., in semiconductor manufacturing • Empirical map for a attenuation vs. temperature in an optical fiber EE392m - Winter 2003 TEF=Trailing Edge Flap Control Engineering 13-6 Approximation • Interpolation: – compute function that will provide given values Y j in the nodes θ j – not concerned with accuracy in-between the nodes • Approximation – compute function that closely corresponds to given data, possibly with some error – might provide better accuracy throughout EE392m - Winter 2003 Control Engineering 13-7 B-spline interpolation • 1st-order – look-up table, nearest neighbor • 2nd-order – linear interpolation yd (t ) = ∑ Y j B j (t ) j • n-th order: – Piece-wise n-th order polynomials, matched n-2 derivatives – zero outside a local support interval – support interval extends to n nearest neighbors EE392m - Winter 2003 Control Engineering 13-8 B-splines • Accurate interpolation of smooth functions with relative few nodes • For 1-D function the gain from using high-order B-splines is not worth an added complexity • Introduced and developed in CAD for 2-D and 3-D curve and surface data • Are used for defining multidimensional nonlinear maps EE392m - Winter 2003 Control Engineering 13-9 Multivariable B-splines • Regular grid in multiple variables • Tensor product B-splines • Used as a basis of finite-element models y (u, v ) = ∑ w j ,k B j (u ) Bk ( v ) j ,k EE392m - Winter 2003 Control Engineering 13-10 Linear regression for nonlinear map • Linear regression y ( x ) = ∑θ jϕ j ( x ) = θ T ⋅ φ ( x ) j • Multidimensional B-splines • Multivariate polynomials ϕ j ( x1 ,K, xn ) = ( x1 ) k1 ⋅ K ⋅ ( xn ) kn x1 x=M xn y = θ 0 + θ1 x1 + θ 2 x2 + θ 3 ( x1 ) 2 + θ 4 x1 x2 + K • RBF - Radial Basis Functions ( ) ϕ j(x) = R x − cj = e EE392m - Winter 2003 −a x −c j 2 Control Engineering 13-11 Linear regression approximation [ Y = y (1) K y ( N ) • Nonlinear map data – available at scattered nodal points • Linear regression map ] x (1) K x ( N ) [ ] Y = θ T ⋅ φ ( x (1) ) K φ ( x ( N ) ) = θ T Φ • Linear regression approximation – regularized least square estimate of the weight vector −1 T ˆ θ = (ΦΦ + rI ) Φ Y T • Works just the same for vector-valued data! EE392m - Winter 2003 Control Engineering 13-12 Nonlinear map example - Epi • Epitaxial growth (semiconductor process) – process map for run-to-run control EE392m - Winter 2003 Control Engineering 13-13 Linear regression for Epi map • Linear regression model for epitaxial grouth y = c0 x1 p1 ( x2 ) + c1 (1 − x1 ) p2 ( x2 ) p1 = w0 + w1 x2 + w3 ( x2 ) 2 + w4 ( x2 )3 c0 x1 p1 = w0c0 x1 + w1c0 x1 x2 + w3c0 x1 ( x2 ) 2 + w4c0 x1 ( x2 )3 { { { { θ1 θ2 θ3 θ4 c1 (1 − x1 ) p2 ( x2 ) = v0c1 (1 − x1 ) + v1c1 (1 − x1 ) x2 + v3c0 (1 − x1 )( x2 ) 2 + w4 c0 (1 − x1 )( x2 )3 { { { { θ5 θ6 θ7 y ( x1 , x2 ) = ∑θ jϕ j ( x1 , x2 ) = θ T ⋅ φ ( x1 , x2 ) θ8 j EE392m - Winter 2003 Control Engineering 13-14 Neural Networks • Any nonlinear approximator might be called a Neural Network – – – – RBF Neural Network Polynomial Neural Network B-spline Neural Network Wavelet Neural Network Linear in parameters • MPL - Multilayered Perceptron – Nonlinear in parameters – Works for many inputs 1 y ( x ) = w1,0 + f ∑ w1, j y j , y1j = w2,0 + j 1 f ( x) = 1 + e− x EE392m - Winter 2003 y f ∑ w2, j x j j y=f(x) x Control Engineering 13-15 Multi-Layered Perceptrons • Network parameter computation – training data set – parameter identification [ Y = y (1) K y ( N ) ] x (1) K x ( N ) y ( x ) = F ( x ;θ ) • Noninear LS problem V =∑ y ( j) 2 − F ( x ;θ ) → min ( j) j • Iterative NLS optimization – Levenberg-Marquardt • Backpropagation – variation of a gradient descent EE392m - Winter 2003 Control Engineering 13-16 Fuzzy Logic • Function defined at nodes. Interpolation scheme • Fuzzyfication/de-fuzzyfication = interpolation • Linear interpolation in 1-D ∑ y µ ( x) y( x) = ∑ µ ( x) j j ∑ µ ( x) = 1 j j j j j • Marketing (communication) and social value • Computer science: emphasis on interaction with a user – EE - emphasis on mathematical computations EE392m - Winter 2003 Control Engineering 13-17 Neural Net application • Internal Combustion Engine maps • Experimental map: – data collected in a steady state regime for various combinations spark of parameters advance – 2-D table RPM • NN map – approximation of the experimental map – MLP was used in this example – works better for a smooth surface EE392m - Winter 2003 Control Engineering 13-18 Linear feedback in a nonlinear plant • Simple example y = f ( x ) + g ( x )u yd Controller u = −k ( x )( y − yd ) + u ff ( x ) u y Plant • Linearizing property of feedback for k ( x ) >> 1 −1 y = yd + (1 + k ( x ) g ( x ) ) ( f ( x ) + g ( x )u ff − yd ) Example: • Control design requires varying k ( x ), u ff ( x ), yd ( x ) process gain • These variables are scheduled on x EE392m - Winter 2003 Control Engineering 13-19 Gain scheduling Nonlinear • Single out several system regimes - model vec( A) linearization or vec( B ) experiments Y = vec(C ) • Design linear controllers in these regimes: vec( D ) setpoint, feedback, feedforward • Approximate controller dependence on the Linear interpolation: regime parameters Y ( Θ) = ∑ Y jϕ j ( Θ) j EE392m - Winter 2003 Control Engineering 13-20 Gain scheduling - example • Flight control • Flight envelope parameters are used for scheduling • Shown – Approximation nodes – Evaluation points • Key assumption – Attitude and Mach are changing much slower than time constant of the flight control loop EE392m - Winter 2003 Control Engineering 13-21 Local Modeling Based on Data Heat Loads • Data mining in the loop • Honeywell product Multidimensional Data Cube Relational Database Heat demand Outdoor Query point ( What if ? ) temperature EE392m - Winter 2003 Time of day Control Engineering Forecasted variable Explanatory variables 13-22