MPC

정승균·2021년 2월 4일
0

자율주행 제어

목록 보기
6/8
post-thumbnail

1. MPC structure


  • 경로를 계산할 Plant의 model과 plant가 만족해야하는 constraint들을 설정

  • 매 step마다 최적화 알고리즘을 통해 cost function이 최소가 되는 plan을 계산

  • 계산한 plan의 첫번째 control action을 실행하고 반복


2. Model


  • state vector
x=[xyvψδ]T\mathbf{x} = \begin {bmatrix} x & y & v & \psi & \delta \end {bmatrix}^T
  • input vector
u=[aω]T\mathbf{u} = \begin {bmatrix} a & \omega \end {bmatrix}^T
  • 편의상 2D Kinematic bicycle model 사용
x˙=vcosψy˙=vsinψv˙=aψ˙=vtanδLδ˙=ω\dot x = v\cos \psi \\ \dot y = v\sin \psi \\ \dot v = a \\ \dot \psi = v\frac{tan\delta}{L} \\ \dot \delta = \omega \\
  • state-space representation
x˙=Ax+Bu\dot {\mathbf{x}} = {\mathbf{A}}{\mathbf{x}} +{\mathbf{B}}{\mathbf{u}}
A=[0000000000000000000000000]{\mathbf{A}} = \begin {bmatrix} 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \end {bmatrix}

2. Constraints


  • inequality constraints
aamaxδδmaxωωmax|a| \le a_{max} \\ |\delta| \le \delta_{max} \\ |\omega| \le \omega_{max} \\
  • equality constraints
    vehicle model

3. Cost function


min(xxref)TQ  (xxref)+uTR  u\min \quad (\mathbf{x} - \mathbf{x}_{ref})^T \mathbf{Q} \; (\mathbf{x} - \mathbf{x}_{ref}) + \mathbf{u}^T \mathbf{R} \; \mathbf{u}

Q=[q1100000q2200000q3300000q4400000q55]R=[r1100r22]{\mathbf{Q}} = \begin {bmatrix} q_{11} & 0 & 0 & 0 & 0 \\ 0 & q_{22} & 0 & 0 & 0 \\ 0 & 0 & q_{33} & 0 & 0 \\ 0 & 0 & 0 & q_{44} & 0 \\ 0 & 0 & 0 & 0 & q_{55} \end {bmatrix} \quad {\mathbf{R}} = \begin {bmatrix} r_{11} & 0\\ 0 & r_{22}\\ \end {bmatrix}
  • Q 와 R 은 각 항목에 대한 weight 값 -> tuning이 필요함

4. Solver

  • Ipopt

  • CVXGEN

  • ACADO

\min {x(\cdot),u(\cdot),p} & & \int_{t_0}^{t_0 + T} \\ \Vert h( t, x(t), u(t), p ) - \eta(t) \Vert_Q^2 \; \mathrm{d}t + \Vert m( x(t_0+T), p, t_0+T ) - \mu \Vert_P^2 \\ \textrm{subject to:} & & x(t_0) = x_0 \\ \forall t \in [t_0, t_0 + T]: & & 0 = f( t, x(t), \dot x(t), u(t), p ) \\ \forall t \in [t_0, t_0 + T]: & & 0 \geq s( t, x(t), u(t), p ) \\ & & 0 = r( x(t_0+T), p, t_0+T )

0개의 댓글