Hi, I'm currently trying to implement MPC through an ACADO generated S-Function of an embedded dSPACE system (muAutobox). I followed the V1 example in the attached file (by Rien Quirynen) , using a script that auto generates an S-Function.
What I don't understand here is the fact that the predicted outputs out of acado_solver_sfun are fed back into the inputs of acado_solver_sfun. This forces the use of a unit delay to overcome the algebraic loop. As far as I'm concerned there's no need in MPC to use the predicted outputs as an input for the next iteration. Normally, I would think that one MPC step only relies on the current time measurements of the states.
So I have two questions:
Why are these predicted states included as an input for the next iteration?
How do I alter the S-Function such that these predicted output states are not needed anymore? My application requires the MPC to be quick so the unit delay block is undesired here.
This is the file that creates the S-Function, I feel that I would need to make some changes here:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2019-04-18
Hi,
I'm by all means no expert, but I have been playing with the S-functions in the zip-file a bit.
I think the feedback of the predicted states are due to the solver shifting the previous trajectories to form an initial guess of the next solution. There's more information on that in the zip-file I seem to remember.
I would suggest that you use the V2 S-function. Once understood it is really quite easy to work with and modify. Also, there is no feedback loop of trajectories, only measured state. I think it would be much harder to modify the autogenerated one.
There is also a third S-function in the ACADO_root/interfaces/matlab/examples/code_generation/nmpc/robot/ which is quite similar to V2 but without support for OD and number of iterations etc.
/Alex
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm new to using Acado and simulink. I'm working on a similar project and using the same acado codes found in the zip file. I have two questions please:
1) What do you recommend to do to fully understand the codes and their simulink interface?
2) When I try to run the code, I get an error:
"undefined function 'DifferentialState' for input arguments of type 'char'.
Error in ACADO_simulink (line 9)
DifferentialState x1 theta v1 dtheta"
why am I getting this error and how to make it run?
I'm still a beginner so thank you for your help.
Regards,
Ali.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I'm currently trying to implement MPC through an ACADO generated S-Function of an embedded dSPACE system (muAutobox). I followed the V1 example in the attached file (by Rien Quirynen) , using a script that auto generates an S-Function.
This is an excerpt of the Simulink model:
https://imgur.com/a/eX5YyUC
What I don't understand here is the fact that the predicted outputs out of acado_solver_sfun are fed back into the inputs of acado_solver_sfun. This forces the use of a unit delay to overcome the algebraic loop. As far as I'm concerned there's no need in MPC to use the predicted outputs as an input for the next iteration. Normally, I would think that one MPC step only relies on the current time measurements of the states.
So I have two questions:
This is the file that creates the S-Function, I feel that I would need to make some changes here:
Thanks in advance!
Best,
Alex
Hi,
I'm by all means no expert, but I have been playing with the S-functions in the zip-file a bit.
I think the feedback of the predicted states are due to the solver shifting the previous trajectories to form an initial guess of the next solution. There's more information on that in the zip-file I seem to remember.
I would suggest that you use the V2 S-function. Once understood it is really quite easy to work with and modify. Also, there is no feedback loop of trajectories, only measured state. I think it would be much harder to modify the autogenerated one.
There is also a third S-function in the ACADO_root/interfaces/matlab/examples/code_generation/nmpc/robot/ which is quite similar to V2 but without support for OD and number of iterations etc.
/Alex
Hi,
I'm new to using Acado and simulink. I'm working on a similar project and using the same acado codes found in the zip file. I have two questions please:
1) What do you recommend to do to fully understand the codes and their simulink interface?
2) When I try to run the code, I get an error:
"undefined function 'DifferentialState' for input arguments of type 'char'.
Error in ACADO_simulink (line 9)
DifferentialState x1 theta v1 dtheta"
why am I getting this error and how to make it run?
I'm still a beginner so thank you for your help.
Regards,
Ali.