Lecture Notes Advanced Control Systems

advanced control and system engineering and advanced control system previous question papers
HelenBoyle Profile Pic
HelenBoyle,Greece,Researcher
Published Date:14-07-2017
Your Website URL(Optional)
Comment
UC Berkeley Lecture Notes for ME233 Advanced Control Systems II XuChenandMasayoshiTomizuka Spring2014ME 233, UC Berkeley, Spring 2014 Xu Chen Introduction Big picture Syllabus Requirements Big picture ME 233 talks about advanced and practical control theories, including but not limited to: I dynamic programming I optimal estimation (Kalman Filter) and stochastic control I SISO and MIMO feedback design principles I digital control: implementation and design I feedforward design techniques: preview control, zero phase error tracking, etc I feedback design techniques: LQG/LTR, internal model principle, repetitive control, disturbance observer I system identicati fi on I adaptive control I ... Introduction ME233 0-1Teaching staff and class notes I instructor: I Xu Chen, 2013 UC Berkeley Ph.D., maxchenberkeley.edu I office hour: Tu Thur 1pm-2:30pm at 5112 Etcheverry Hall I teaching assistant: I Changliu Liu, changliuliuberkeley.edu I office hour: M, W 10:00am – 11:00am in 136 Hesse Hall I class notes: I ME233 Class Notes by M. Tomizuka (Parts I and II); Both can be purchased at Copy Central, 48 Shattuck Square, Berkeley Introduction ME233 0-2 Requirements and evaluations I website (case sensitive): I www.me.berkeley.edu/ME233/sp14 I bcourses.berkeley.edu I prerequisites: ME C 232 or its equivalence I lectures: Tu Thur 8-9:30am, 3113 Etcheverry Hall I discussions: Fri. 10-11am, 1165 Etcheverry Hall I homework (20%) I two in-class midterms (20% each): Mar. 4, 2014 and Apr. 15, 2014; one-page handwritten summary sheets allowed I one final exam (40%): May 15 2014 (Th), 7 pm -10 pm; open notes Introduction ME233 0-3Prerequisites (ME 232 table of contents) I Laplace and Z transformations I Models and Modeling of linear dynamical systems: transfer functions, state space models I Solutions of linear state equations I Stability: poles, eigenvalues, Lyapunov stability I Controllability and observability I State and output feedbacks, pole assignment via state feedback I State estimation and observer, observer state feedback control I Linear Quadratic (LQ) Optimal Control, LQR properties, Riccati equation Introduction ME233 0-4 Remark ME233 will be webcasted: I Berkeley’s YouTube channel (http://www.youtube.com/ucberkeley) I iTunes U (http://itunes.berkeley.edu/) I webcast.berkeley (http://webcast.berkeley.edu) links will be posted on course website when available Introduction ME233 0-5References (also on course website) I Probability I Bertsekas, Introduction to Probability, Athena Scientific I Yates and Goodman, Probability and Stochastic Processes, second edition, Willey I Linear Quadratic Optimal Control I Anderson and Moore, Optimal Control: Linear Quadratic Methods, Dover Books on Engineering (paperback), 2007. A PDF can be downloaded from: http://users.rsise.anu.edu.au/%7Ejohn/papers/index.html I Lewis and Syrmos, Vassilis L., Optimal Control, Wiley-IEEE, 1995 I Bryson and Ho, Applied Optimal Control: Optimization, Estimation, and Control, Wiley I Stochastic Control Theory and Optimal Filtering I Brown and Hwang, Introduction to Random Signals and Applied Kalman Filtering, Third Edition, Willey I Lewis and Xie and Popa, Optimal and Robust Estimation, Second Edition CRC I Grewal and Andrews, Kalman Filter, Theory and Practice, Prentice Hall I Anderson, and Moore, Optimal Filtering, Dover Books on Engineering (paperback), New York, 2005. A PDF can be downloaded from: http://users.rsise.anu.edu.au/%7Ejohn/papers/index.html I Astrom, Introduction to Stochastic Control Theory, Dover Books on Engineering (paperback), New York, 2006 I Adaptive Control I Astrom and Wittenmark, Adaptive Control, Addison Wesley, 2nd Ed., 1995 I Goodwin and Sin, Adaptive Filtering Prediction and Control, Prentice Hall, 1984 I Krstic, Kanellakopoulos, and Kokotovic, Nonlinear and Adaptive Control Design, Willey Introduction ME233 0-6ME 233, UC Berkeley, Spring 2014 Xu Chen Lecture 1: Dynamic Programming General problem Multivariable derivative Discrete-time LQ Dynamic programming (DP) introduction: I history: developed in the 1950’s by Richard Bellman I “programming”: “planning” (has nothing to do with computers) I a useful concept with lots of applications I IEEE Global History Network: “A breakthrough which set the stage for the application of functional equation techniques in a wide spectrum of fields...” Lecture 1: Dynamic Programming ME233 1-1I observation: if node C is on the optimal path, the then path from node C to node E must be optimal as well Essentials of dynamic programming I key idea: solve a complex and difficult problem via solving a collection of sub problems Example (Path planning) goal: obtain minimum cost path from S to E 6 A B 1 2 S E 1 4 2 1 3 C D Lecture 1: Dynamic Programming ME233 1-2 Essentials of dynamic programming I key idea: solve a complex and difficult problem via solving a collection of sub problems Example (Path planning) goal: obtain minimum cost path from S to E 6 A B 1 2 S E 1 4 2 1 3 C D I observation: if node C is on the optimal path, the then path from node C to node E must be optimal as well Lecture 1: Dynamic Programming ME233 1-2forward computation dist(C)=2 dist(A)=1 dist(B)=1+6=7 dist(D)=5 dist(E)=6 Essentials of dynamic programming 6 A B 1 2 S E 1 4 dist(E),minimum cost S→E 2 1 3 C D I solution: backward analysis dist(E)=min dist(B)+2,dist(D)+1 dist(B)=dist(A)+6 dist(D)=mindist(B)+1,dist(C)+3 dist(C)=2 dist(A)=min1,dist(C)+4 Lecture 1: Dynamic Programming ME233 1-3 Essentials of dynamic programming 6 A B 1 2 S E 1 4 dist(E),minimum cost S→E 2 1 3 C D I solution: backward analysis forward computation dist(E)=mindist(B)+2,dist(D)+1 dist(C)=2 dist(B)=dist(A)+6 dist(A)=1 dist(D)=mindist(B)+1,dist(C)+3 dist(B)=1+6=7 dist(C)=2 dist(D)=5 dist(A)=min1,dist(C)+4 dist(E)=6 Lecture 1: Dynamic Programming ME233 1-3Essentials of dynamic programming 6 A B 1 2 S E 1 4 2 1 3 C D I summary (Bellman’s principle of optimality): “From any point on an optimal trajectory, the remaining trajectory is optimal for the corresponding problem initiated at that point.” Lecture 1: Dynamic Programming ME233 1-4 General optimal control problems I general discrete-time plant: x(k+1)=f (x(k),u(k),k) n state constraint: x(k)∈X⊂R m input constraint: u(k)∈U⊂R I performance index: N−1 J =S(x(N))+ L(x(k),u(k),k) ∑ k=0 S & L–real, scalar-valued functions; N–final time (optimization horizon) I goal: obtain the optimal control sequence o o o u (0),u (1),...,u (N−1) Lecture 1: Dynamic Programming ME233 1-5Dynamic programming for optimal control I define: U ,u(k),u(k+1),...,u(N−1) k I optimal cost to go at time k: ( ) N−1 o J (x(k)),min S(x(N))+ L(x(j),u(j),j) ∑ k U k j=k ( " ) N−1 =minmin L(x(k),u(k),k)+ S(x(N))+ L(x(j),u(j),j) ∑ U u(k) k+1 j=k+1 ( " ) N−1 =min L(x(k),u(k),k)+min S(x(N))+ L(x(j),u(j),j) ∑ U u(k) k+1 j=k+1  o =min L(x(k),u(k),k)+J (x(k+1)) (1) k+1 u(k) o I boundary condition: J (x(N))=S(x(N)) N I The problem can now be solved by solving a sequence of o o o o problems J , J ,...,J , J . 1 N−1 N−2 Lecture 1: Dynamic Programming ME233 1-6 Solving discrete-time finite-horizon LQ via DP I system dynamics: x(k+1)=A(k)x(k)+B(k)u(k), x(k )=x (2) 0 o I performance index: n o N−1 1 1 T T T J = x (N)Sx(N)+ x (k)Q(k)x(k)+u (k)R(k)u(k) ∑ 2 2 k=k 0 T T T Q(k)=Q (k)0, S =S 0, R(k)=R (k)0 I optimal cost to go:   1 1 o T T o J (x(k))=min x (k)Q(k)x(k)+ u (k)R(k)u(k)+J (x(k+1)) k k+1 2 2 u(k) 1 o T with boundary condition: J (x(N))= x (N)Sx(N) N 2 Lecture 1: Dynamic Programming ME233 1-7Facts about quadratic functions I consider 1 T T T f (u)= u Mu+p u+q, M =M (3) 2 I optimality (maximum when M is negative definite; minimum when M is positive definite) is achieved when ∂f o −1 =Mu+p =0⇒u =−M p (4) ∂u I and the optimal cost is 1 o o T −1 f =f(u )=− p M p+q (5) 2 Lecture 1: Dynamic Programming ME233 1-8 o o From J to J in discrete-time LQ N N−1 I by definition:  1 o T J (x(N−1))= min x (N)Sx(N) N−1 u(N−1) 2  h i 1 T T + x (N−1)Q(N−1)x(N−1)+u (N−1)R(N−1)u(N−1) 2 I using the system dynamics (2) gives 1 o T J (x(N−1))= min x (N−1)Q(N−1)x(N−1) N−1 2 u(N−1) T T +u (N−1)R(N−1)u(N−1)+A(N−1)x(N−1)+B(N−1)u(N−1) ×SA(N−1)x(N−1)+B(N−1)u(N−1) I optimal control by letting ∂J /∂u(N−1)=0: N−1 h i −1 o T T u (N−1)=− R(N−1)+B (N−1)SB(N−1) B (N−1)SA(N−1)x(N−1) z state feedback gain: K(N−1) Lecture 1: Dynamic Programming ME233 1-9?Optimality at N and N−1 at time N: optimal cost is 1 1 o T T J (x(N))= x (N)Sx(N), x (N)P(N)x(N) N 2 2 at time N−1: 1 o T J (x(N−1))= min x (N−1)Q(N−1)x(N−1) N−1 2 u(N−1) T T +u (N−1)R(N−1)u(N−1)+A(N−1)x(N−1)+B(N−1)u(N−1) ×SA(N−1)x(N−1)+B(N−1)u(N−1) optimal cost to go by using (5) is n 1 o T T J (x(N−1))= x (N−1) Q(N−1)+A (N−1)SA(N−1) N−1 2  h i −1 T T T −(...) R(N−1)+B (N−1)SB(N−1) B (N−1)SA(N−1) x(N−1) 1 T , x (N−1)P(N−1)x(N−1) 2 Lecture 1: Dynamic Programming ME233 1-10 Summary: from N to N−1 at N: 1 1 o T T J (x(N))= x (N)Sx(N)= x (N)P(N)x(N) N 2 2 at N−1: 1 o T J (x(N−1))= x (N−1)P(N−1)x(N−1) N−1 2 with (S has been replaced with P(N) here) T P(N−1)=Q(N−1)+A (N−1)P(N)A(N−1) h i −1 T T T −(...) R(N−1)+B (N−1)P(N)B(N−1) B (N−1)P(N)A(N−1) and state-feedback law h i −1 o T u (N−1)=− R(N−1)+B (N−1)P(N)B(N−1) T ×B (N−1)P(N)A(N−1)x(N−1) Lecture 1: Dynamic Programming ME233 1-11Induction from k+1 to k I assume at k+1: 1 o T J (x(k+1))= x (k+1)P(k+1)x(k+1) k+1 2 I analogous as the case from N to N−1, we can get, at k: 1 o T J (x(k))= x (k)P(k)x(k) k 2 with Riccati equation T P(k)=A (k)P(k+1)A(k)+Q(k) h i −1 T T T −A (k)P(k+1)B(k) R(k)+B (k)P(k+1)B(k) B (k)P(k+1)A(k) and state-feedback law h i −1 o T T u (k)=− R(k)+B (k)P(k+1)B(k) B (k)P(k+1)A(k)x(k) Lecture 1: Dynamic Programming ME233 1-12 Implementation I optimal state-feedback control law: h i −1 o T T u (k)=− R(k)+B (k)P(k+1)B(k) B (k)P(k+1)A(k)x(k) I Riccati equation: T P(k)=A (k)P(k+1)A(k)+Q(k) h i −1 T T T −A (k)P(k+1)B(k) R(k)+B (k)P(k+1)B(k) B (k)P(k+1)A(k) with the boundary condition P(N)=S. o I u (k) depends on I the state vector x(k) I system matrices A(k) and B(k) and the cost matrix R(k) I P(k+1), which depends on Q(k+2), A(k+1), B(k+1), and P(k+2)... N−1 I iterating gives: u(0) depends onA(k),B(k),R(k),Q(k+1) k=0 In practice, P(k) can be computed offline since they do not require information of x(k). Lecture 1: Dynamic Programming ME233 1-13ME 233, UC Berkeley, Spring 2014 Xu Chen Lecture 3: Review of Probability Theory Connection with control systems Random variable, distribution Multiple random variables Random process, filtering a random process Big picture why are we learning this: We have been very familiar with deterministic systems: x (k +1) =Ax (k) +Bu (k) In practice, we commonly have: x (k +1) =Ax (k) +Bu (k) +B w (k) w where w (k) is the noise term that we have been neglecting. With the introduction of w (k), we need to equip ourselves with some additional tool sets to understand and analyze the problem. Lecture 3: Review of Probability Theory ME233 3-1Sample space, events and probability axioms I experiment: a situation whose outcome depends on chance I trial: each time we do an experiment we call that a trial Example (Throwing a fair dice) possible outcomes in one trail: getting a ONE, getting a TWO, ... I sample space Ω: includes all the possible outcomes I probability: discusses how likely things, or more formally, events, happen I an event S : includes some (maybe 1, maybe more, maybe none) i outcomes of the sample space. e.g., the event that it won’t rain tomorrow; the event that getting odd numbers when throwing a dice Lecture 3: Review of Probability Theory ME233 3-2 Sample space, events and probability axioms probability axioms I PrS≥0 j I PrΩ =1 I if S∩S =∅ (empty set), then PrS∪S =PrS +PrS i j i j i j Example (Throwing a fair dice) the sample space: Ω =getting a ONE, getting a TWO,..., getting a SIX z z z ω ω ω 1 2 6 the event S of observing an even number: 1 S =ω ,ω ,ω 1 2 4 6 1 1 1 1 PrS = + + = 1 6 6 6 2 Lecture 3: Review of Probability Theory ME233 3-3Random variables to better measure probabilities, we introduce random variables (r.v.’s) I r.v.: a real valued function X (ω) defined on Ω;∀x∈R there defined the (probability) cumulative distribution function (cdf) F (x) =PrX≤x I cdf F (x): non-decreasing, 0≤F (x)≤1, F (−∞) =0, F (∞) =1 Example (Throwing a fair dice) can define X: the obtained number of the dice X (ω ) =1, X (ω ) =2, X (ω ) =3, X (ω ) =4,... 1 2 3 4 can also define X: indicator of whether the obtained number is even X (ω ) =X (ω ) =X (ω ) =0, X (ω ) =X (ω ) =X (ω ) =1 1 3 5 2 4 6 Lecture 3: Review of Probability Theory ME233 3-4 Probability density and moments of distributions I probability density function (pdf): dF (x) p (x) = dx Z b Pr(aX≤b) = p (x)dx, ab a sometimes we write p (x) to emphasize that it is for the r.v. X X I mean, or expected value (first moment): Z ∞ m =EX = xp (x)dx X X −∞ I variance (second moment): Z h i ∞ 2 2 Var X =E (X−m ) = (x−m ) p (x)dx X X X −∞ p I standard deviation (std): σ = Var X   2 2 I exercise: prove that Var X =E X − (EX ) Lecture 3: Review of Probability Theory ME233 3-5Example distributions uniform distribution I a r.v. uniformly distributed between x and x min max I probability density function: p (x) X 1 Matlab function: rand p (x) = 1 x −x max min x ¡x max min x x min max x I cumulative distribution function: x−x min F (x) = , x ≤x≤x min max x −x max min I mean and variance: 2 1 (x −x ) max min EX = (x +x ), Var X = max min 2 12 Lecture 3: Review of Probability Theory ME233 3-6 Example distributions Gaussian/normal distribution I importance: sum of independent r.v.s→ a Gaussian distribution I probability density function: 1 √ σ 2π X 2 1 (x−m ) X √ p (x) = exp − 0.607 √ 2 σ 2π X 2σ σ 2π X X m −σ X X m m +σ X X X I pdf fully characterized by m and σ . Hence a normal X X distribution is usually denoted as N (m ,σ ) X X I nice properties: if X is Gaussian and Y is a linear function of X, then Y is Gaussian Lecture 3: Review of Probability Theory ME233 3-7Example distributions Gaussian/normal distribution Central Limit Theorem: if X , X , ... are independent identically 1 2 2 distributed random variables with mean m and variance σ , then X X n (X −m ) ∑ k X k=1 Z = √ n 2 nσ X converges in distribution to a normal random variable X∼N (0,1) example: sum of uniformly distributed random variables in 0,1 X1 = rand(1,1e5); X2 = rand(1,1e5); X3 = rand(1,1e5); Z = X1 + X2; fz,x = hist(Z,100); w_fz = x(end)/length(fz); fz = fz/sum(fz)/w_fz; figure, bar(x,fz) xlabel ’x’; ylabel ’p_Z(x))’; Y = X1 + X2 + X3; % ... Lecture 3: Review of Probability Theory ME233 3-8 Multiple random variables joint probability for the same sample space Ω, multiple r.v.’s can be defined I joint probability: Pr (X =x,Y =y) I joint cdf: F (x,y) =Pr(X≤x,Y≤y) 2 ∂ I joint pdf: p (x,y) = F (x,y) ∂x∂y I covariance: Cov (X,Y ) = Σ =E(X−m )(Y−m ) =EXY −EX E Y XY X Y Z Z ∞ ∞ = (x−m )(y−m )p (x,y)dxdy X Y −∞ −∞ I uncorrelated: Σ =0 XY I independent random variables satisfy: F (x,y) =Pr(X≤x,Y≤y) =Pr(X≤x)Pr(Y≤y) =F (x)F (y) X Y p (x,y) =p (x)p (y) X Y Lecture 3: Review of Probability Theory ME233 3-9Multiple random variables more about correlation correlation coefficient: Cov (X,Y ) ρ (X,Y ) =p Var (X )Var (Y ) X and Y are uncorrelated if ρ (X,Y ) =0 I independent⇒uncorrelated; uncorrelated;independent I uncorrelated indicates Cov (X,Y ) =EXY −EX EY =0, which is weaker than X and Y being independent Example X–uniformly distributed on −1,1. Construct Y: if X≤0 then Y =−X; if X 0 then Y =X. X and Y are uncorrelated due to 1 I EX =0, EY = 2 I EXY =0 however X and Y are clearly dependent Lecture 3: Review of Probability Theory ME233 3-10 Multiple random variables random vector I vector of r.v.’s:   X Z = Y I mean:   m X m = Z m Y I covariance matrix:   h i Σ Σ T XX XY Σ =E (Z−m )(Z−m ) = Z Z Σ Σ YX YY   Z Z 2 ∞ ∞ (X−m ) (X−m )(Y−m ) X X Y = p (x,y)dxdy 2 (Y−m )(X−m ) (Y−m ) −∞ −∞ Y X Y Lecture 3: Review of Probability Theory ME233 3-11Conditional distributions I joint pdf to single pdf: Z ∞ p (x) = p (x,y)dy X −∞ I conditional pdf: p (x,y ) 1 p (xy ) =p (xY =y ) = 1 1 X X p (y ) Y 1 I conditional mean: Z ∞ EXy = xp (xy )dx 1 1 X −∞ I note: independent⇒p (xy ) =p (x) X 1 X I properties of conditional mean: EEXy =EX y Lecture 3: Review of Probability Theory ME233 3-12 Multiple random variables Gaussian random vectors Gaussian r.v. is particularly important and interesting as its pdf is mathematically sound Special case: two independent Gaussian r.v. X and X 1 2         2 2 2 2 1 1 − x −m / 2σ − x −m / 2σ 1 X 2 X X X 1 2 1 2 p(x ,x )=p (x )p (x )= √ e √ e 1 2 X 1 X 2 1 2 σ 2π σ 2π X X 1 2 ( )       −1 T 2 1 1 σ 0 x −m x −m 1 X X 1 X 1 1 1 = exp − √  2 2 x −m x −m 0 σ 2 2 2 X X 2 X 2 σ σ 2π 2 X X 1 2 T We can use the random vector notation: X = X ,X 1 2   2 σ 0 X 1 Σ = 2 0 σ X 2 and write   1 1 T −1 p (x) = exp − X−m Σ X−m X √  √ X X 2 2 2π detΣ Lecture 3: Review of Probability Theory ME233 3-13

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.