Up

  • Controls
  • MPC - Overall Idea

    State Space techniques rely on current state and previous outputs. Here, we want to incorporate future beliefs with knowledge of the model.

    Loss, model, and constraints

    We predict a trajectory with our model, and assign a cost: $$Loss = \sum^T_{t=0}g(x_t, u_t) $$ Where g gives some trajectory loss corresponding to the inputs u and and states x at all times in the trajectory t={0,T} E.G: A weighted sum of errors and actuator demands (like LQR)

    The model gives a predictive representation of the dynamics: $$x_{t+1} = x_t + \delta t * dynamics$$ E.G: $$x_{t+1} = x_t + \delta t * v_t$$

    The constraints encode domains of allowed states and inputs. E.G: $$U_t = [u| a_{min} <= a <= a_{max}]$$ Stay within acceleration bounds $$X_t = [x| p_{x}^2 + p_y^2 <=1]$$ Stay within 1m of origin

    Formulation

    Minimize the trajectory cost that does not violate constraints: $$min_{x_{1:T}, u_{1:T}}$$ subject to $$x_{t+1} = f(x_t, u_t) ; u = [U_t]; x = [X_t]; x_1 = X_0$$

    Practical Solving

    In general, there is no closed form solution. Solving is done in CasADi (Python, C++, Matlab)

    Considerations

  • Long term trajectories are expensive to compute
  • Model errors will accumulate over time
  • Solution: Only run for a short horizon, query the system, and reevaluate. There is a tradeoff between shortsighted behavior and computation(E.G accelerating too close to a turn we can't see and overshooting). A possible solution is a zero-velocity end condition.

  • Complexity increases accuracy, but makes calculation difficult
  • Identifying system characteristics like friction and drag are difficult
  • Solution: Determine unknown parameters by collecting real system behavior, and optimizing parameters relative to the real behavior