05-06-2010 11:44 AM
I am having issues with the implementation of MPC in my work
and need clarifications. I am also suspecting the dimensions of
my state space model, and some other MPC parameters that I might have
not set appropriately. Please I need suggestions for the
05-07-2010 07:54 AM
Vicky Vicky,
I checked your model and the first problem was the D matrix of the model. The number of columns was not matching the number of inputs and the number of row was not matching the number of outputs. If you have it as zero, I would suggest to just make it empty and the API will complete with zeros for you.
The second problem are the initial conditions. You have to match the dimensions of your system, which it seems 2 inputs, 4 states and 2 outputs. Each initial condition has to have all of those parameters with its size matched. It seemed you do not have disturbance, so that input has to be empty.
The last suggestion is to avoid writing the Final initial Conditions to the cluster used to hold initial conditions. When you have an error, those values will be incorrectly initialized and when you try to rerun again, you will run into an error.
After all those changes, I was able to run. Unfortunately, there is some parameter (probably constraint or model definition) that makes the solver to fail. You need to look into the definitions and size of the vectors to be sure that you have everything with the correct dimensions and values.
Hope this helps...
05-07-2010 11:04 AM
Hi Barp, I have made corrections as noticed about my matrix dimensions. It is true there is no disturbance in the system.
And I have properly indicated the set-points and inputs correctly as well, but I still do not have good response when the system
is running in the automatically in the controller mode. But seems good in the manual mode.
Regarding writing the final initial conditions to the cluster that hold initial condition wasn't very clear. I have tried working
on it but Please I need help on it working correctly. Please help me make the corrections and send the VI back.
05-11-2010 07:32 AM
What I meant on the initial conditions was the following: In your code you have the "MPC Final Conditions" of the "CD Implement MPC Controller" connected to a local variable appointing to the initial conditions. You should avoid this since it will change your initial conditions if the solver can't reach a solution. In this case, just create a new controller from the terminal and you can just compare with it.
I looked on the conditions of the VIs but I did not find anything obvious. Do you have a paper that describe the constraints of the system? This would help to define how to pose this problem for the VI.