ModelPredictiveControl v.0.21.0
I’m super excited to announce two new major features:
- linear model adaptation of controller/estimator at runtime
- model linearization at non-equilibrium points
These features allow adaptive MPC based on online parameter estimation (e.g. recursive system identification). Furthermore, successive linearization MPC can now be implemented with minimal effort. It’s a great feature since e.g. MATLAB also supports it, but the analytical expressions of the Jacobians are required (hidden in the “Successive Linearizer” block). This is not the case here with the AD-based linearize function. Also, similar functionalities are available for the MovingHorizonEstimator.
A massive and long refactoring of the operating points and the mathematical notation was required to support linearization at non-equilibrium points. It was totally worth it since the successive linearization MPC on the pendulum is about 125 times faster than the NMPC counterpart, with similar closed-loop performances! It’s a great application of Julia’s AD tools and its first class linear algebra library!
BREAKING CHANGE
All the keyword arguments related to initial values e.g. σP0, x0 and x̂0 now require an underscore e.g. σP_0, x_0, x̂_0 (to clearly differentiate from deviation vectors around operating points)
- Added:
setmodel!for runtime model adaptation of controller/estimator based onLinModel - Added:
linearizeandsetop!now support non-equilibrium points - Added: successive linearization MPC with the new
setmodel!andlinearizefunctions - Added: successive linearization MHE with the new
setmodel!andlinearizefunctions - Added:
linearize!method for in-place model linearization (to reduce allocations) - Added: 6 args.
LinModelconstructor now support scalars (similarly tossfunction) - Added:
ExtendedKalmanFilternow compute the Jacobians in-place (to reduce allocations) - Changed:
structstate dataxand state estimatex̂renamed tox0andx̂0 - Debug:
ExplicitMPCwith non-Float64now works - Debug: accept integers in
linearizearguments - Debug: call
empty!onJuMP.Modelto support re-construction of MPC instances - Doc: new
setmodel!,setop!andlinearizefunction documentation - Doc: example of model adaptation with successive linearization on the pendulum (very efficient!)
other changes, since my last post on discourse:
- Added: print info on controller and estimator constraint softening (slack var.
ϵ) - Added: custom estimator for the approximation of the arrival covariance in the MHE
- Added: improve performance of
LinMPCand MHE with new JuMP batch update methods - Various allocation reductions
- Changed: MHE now default to an
UnscentedKalmanFilterfor the arrival covariance estimation (instead of an EKF) - Debug: MHE with
NonLinModelupdate covariance with the correct state estimate