From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to emplement Model Predictive Control

Hi,

I have to controle a MIMO system whose model could change over time.

It's an 8dof robot with 8 actuators, and a sensor that gives 3d velocity, position, roation rate, and orientation.

Actually I'm using autotunnig PID, and considering my MIMO system like multiple SISO systems. It works correctly for some dof but not for others.

It seems that Model predictive control is the right way to do that.

What are the steps to emplement correctly a MPC?

Thanks

0 Kudos
Message 1 of 10
(4,607 Views)

Hello Neil84

 

The LabVIEW Control Design and Simulation module comes with several examples on how to implement Model Predictive Control algorithms. You might want to check them

 

Hope this helps

Javier Gutierrez

Product Marketing

0 Kudos
Message 2 of 10
(4,597 Views)

Hi Javier,

thank you for answer.

Actually I'm looking to the examples, and specially "update MPC constroller" and "aircraft trajectory tracking".

As the model of the robot changes over time, I tried to give, with the second Vi, different state matrix in model an system and it reacts correctly however if set point is over 2 or under -2 the controller can't estimate the response. Why? Is there saturations in the controller?

About the first VI, if model and system are different, the tracking dont react correctly.

 

0 Kudos
Message 3 of 10
(4,552 Views)

Hello Neil84

 

I don't fully understand what your questions are. But let me give it a try

 

When you change the model, where is the setpoint. Depending on the constrain methods your are using, if the setpoint is outside of the range, the optimizer doesn't know how to bring it back. In that case you need to reset the controller (only when you change the model). As for the second question, what new model are you applying?Can you put an example?

 

Javier

0 Kudos
Message 4 of 10
(4,536 Views)

Does the MPC controller designed in Labview can be used for a nonlinear process? Does anyone have a video or tutorial where I can understand how to develop a mpc controller with Labview. I have found just 1 tutorial that has no usefull information about all the elements Labview has of MPC and how to wire them correctly. The user manual is not helpful too.

 

I would apprecciate if any one could help designing a mpc controller for this state space system:

 

A=[-0.001118 0.00109;0.001597 -0.003519];

B=[2.415;0];

C=[0 1;1 0];

D=[0;0];

 

u_min=0;

u_max=7.5e-4;

x_min=0;

x_max=0.7;

0 Kudos
Message 5 of 10
(3,871 Views)

Hello

 

Unfortunelately, there are no tutorials on how to create MPC controllers with LabVIEW, so your best bet is to reffer to the shipping examples.

 

As for if the MPC controller supports nonlinear systems, the answer is no. But the software has been design so that all components can be updated on the fly, so you could linearize your system around some working points and update your plant SS when those are reached.

 

One of the shipping examples that show how to design an MPC (given MPC parameters and SS model, Cost Weighting Parameters, Constrains, Initial condition, etc) and how to update it on they fly is found in the shipping examples->Control Design and Simulation->Control Design->MPC->CDex Update MPC Controller.vi

 

I hope this helps

 

Javi

 

0 Kudos
Message 6 of 10
(3,861 Views)

Thank you very much.

 

The thing is I need to implement a MPC controller in a real two tank system. The controller I already designed it in MATLAB with MPT toolbox, but the communication with the plant is with Labview, so I do not know how to implement it if the MPC toolkit of Labview does not support a nonlinear system such as the two tanks. I do not know if there is a way of communicating MATLAB with Labview for this purposes. I have read it is possible, but I'm not so sure if it would be for this objective. Do you know how can I complete my task? I would appreciate any help or ideas you could give me.

0 Kudos
Message 7 of 10
(3,856 Views)

Hello

 

Can anyone help about this question. I design the mpc controller for a linear proccess, but I can implement it on a nonlinear proccess, I mean after the block "Implement MPC controller" can I wire that control action to a nonlinear system, and the output of this nonlinear system connect it to the the block mentioned before. Its possible to do that?

 

Thanks in advanced

0 Kudos
Message 8 of 10
(3,834 Views)

Hi

 

There are two approaches for your problem

 

1- If you already have designed a non-linear MPC in Matlab/Simulink you might want to run code in Matlab/Simulink and adding the I/O in LabVIEW. There are tools like the Simulaiton Interface Toolkit that would allow you to make the communcation between the two systems.

 

2- You can connect input/outpus of your non-linear system with your linear MPC controller. Be aware that the behaviour might not be as expected depending on how nonlinear your process it.

 

Javi

0 Kudos
Message 9 of 10
(3,824 Views)

Thank you very much Javi, I will try designing the MPC controller over the a linearized model and implement it on the nonlinear proccess. But I have a problem designing the controller with the linear model. I am using the example "CDEx MPC with Dual Constraints" to start working over it. So I just change each matrix (A,B,C,D) and the rest of the parameters (constraints, set point), but when I run it it doesn't works fine and it shows to me 2 control signals when the system just have one. Something similar occur with the outputs, according to the model I have 2 outputs but the chart only shows me 1. And the constarints seems to do nothing (umin = 0 - umax = 5e-4; ymin = [0;0]; ymax = [0.69;0.59];). I attach the file hoping you can help me please because I've been trying also on several examples for this state space model and having no result. 

 

Please help me with this problem, because I do not have no where to ask.

0 Kudos
Message 10 of 10
(3,814 Views)