Menu

Implementation of Moving Horizon Estimator in the MATLAB interface

2013-03-21
2013-04-02
  • Esten I Grøtli

    Esten I Grøtli - 2013-03-21

    Hi,

    I have some questions mainly related to how to implement a Moving Horizon Estimator (MHE) in the MATLAB interface:

    1. Is the same functionality possible through the MATLAB interface as with the C++ code base?
    2. How can the OutputFcn() in MATLAB be chosen to be something else than the full state vector? It is not clear to me from the help menu. In the C++ code base I see it is possible to write for instance:
      OutputFcn g;
      g << xB;
      g << 500.0
      vB + F;*
    3. How can an estimator be included in the Controller class of the MATLAB interface? I see from the help menu that the usage of the Controller class is: Controller(controllaw[, reference] .
      With the C++ code base it is possible to write:
      OutputFcn identity;
      DynamicSystem dynamicSystem( f,identity );
      Process process( dynamicSystem,INT RK45 );
      RealTimeAlgorithm alg( ocp );
      DynamicFeedbackLaw feedbackLaw( alg,0.05 );
      Estimator trivialEstimator;
      StaticReferenceTrajectory zeroReference;
      Controller controller(
      feedbackLaw,trivialEstimator,zeroReference );
    4. If a MHE is to be included with the simulation environment, is there a way to easily handle the fact that measurements are not available for the full horizon in the beginning of the simulation?
    5. Is it ok to use OCP(tStart,tEnd) with a negative start time tStart?

    Can I also request that you include one or two examples/tutorial with MHEs in the future?

    Thanks!

     
  • Rien Quirynen

    Rien Quirynen - 2013-03-25

    Hello,

    First of all: the only thing the MATLAB interface does is translating your problem formulation to the C++ syntax. This means that all things that are possible in the C++ interface of ACADO, should also be possible in the MATLAB interface. Or at least that is the principle, because we are just a few developers/PhD students in this project.
    So currently, the MATLAB interface is sometimes more powerful than the C++ interface and the other way around.

    An example: instead of working with DifferentialEquation/OutputFcn objects, you can often just use arrays of expressions in the MATLAB interface (behind the scene it will then create these objects itself).

    Now, to get to your question: on which C++ example is your request for MHE implementation in the MATLAB interface based? I myself haven't implemented MHE in ACADO, so I don't know how it would look like in C++ (maybe somebody else can help here).
    But you can make any OutputFcn in MATLAB too like this:
    h = acado.OutputFcn;
    h(:) = [ ... ]; <-- write here your vector of expressions

    And why exactly would you want to define OCP(tStart,tEnd) with tStart a negative start time? How does that help you?

    Rien

     
  • Esten I Grøtli

    Esten I Grøtli - 2013-04-02

    Hi,

    thank you for your response, that clarified question 1. and 2. in the original post.

    I haven't found a C++ example on MHE either, but if I am allowed to make a request I would like to see a closed-loop simulation like this one, http://acado.sourceforge.net/doc/html/example_015.html
    except that some states are not measured and their estimates need to be constructed by MHE. I see that there is already a MHEalgorithm C++ class: http://acado.sourceforge.net/doc/html/classMHEalgorithm.html
    Alternatively, a MHE implementation of the overhead crane example in your paper "Fast auto generated ACADO integrators and application to MHE with multi-rate measurements".

    Now to my question 5. above: The reason why I asked if I can define an OCP with a negative start time, is that the the moving horizon estimation cost function is based on previous measurements. So relative to the current time in the simulation environment, these measurements are taken at negative time instants.

     

Log in to post a comment.

MongoDB Logo MongoDB