LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Design Model Predictive Controller in LabVIEW

Hello Everyone,

I have a heat water system  consists from two tanks hot and cold. The system has two inputs flow of water and the temperature of the water, and  the output  signals which go to valves. I want to design MPC controller in LabVIEW. I went through the examples in labVIEW and I read the control and simulation manual. the examples are only for simulation and the manual has no enough explaining.

if I want to implement MPC in real-time, do I have to simulate the system along with real time implementation or it depents if I like to do simulation separately or not. It is confussing to me is it necessary to find the model of the system and convert to state space?

Thank you  for any advice.

0 Kudos
Message 1 of 7
(4,274 Views)

Sounds like you need a course on Control Theory.  You'll have to learn the "how to's" yourself.  I'd advise setting aside time to get a good understanding of the Theory (if you can't take a class, you probably can find material on the Web), then use what you've learned to design some LabVIEW Code.  If you get stuck in your code, post the code (attach VI's please) and ask your questions.

 

Bob Schor

0 Kudos
Message 2 of 7
(4,219 Views)

Thank you Bob for your reply.

I am Instrumentation and Control student, and I'm familiar with the control theory, but never implemented advanced control system MPC in LabVIEW. I want to perform it in my project rather than PID controller.

 

thanks

JAWAD

0 Kudos
Message 3 of 7
(4,183 Views)

Hi Bob,

I tried to design model predictive controller for my system which is a unit to test the efficiency of solar collectors. I went through the example in the LabVIEW for MPC and I read the NI control design user manual. All the examples and explanation about simulation there is no enough details about real time implementation of MPC. I did research online I found some papers about MPC in LabVIEW but all of them in simulation as well. I tried to implement it in my code according to my understanding which I am not sure if it correct or not. It did not work. Please find the attached Vi of the system, the MPC code in the bottom in the third loop. please if you can advice me about it what is wrong and how it should be. I am really appreciate your help.

Thanks

Jawad Mezaal

0 Kudos
Message 4 of 7
(4,100 Views)

Hi Jawad,

You mentioned going through an example in LabVIEW for MPC.  Were you successful in running that example?  If so, perhaps comparing your own non-working code to that of the example (or building off of the examples you've looked at) could be helpful. I am afraid that the forums won't be able to help that much if you can't narrow down what's "not working" to something more specific than your entire project.  

 

What particular functionality are you having trouble implementing?  Is there a VI that is not performing as you expected?  If you need more information about the expected behavior of the various VIs used in an implementation of MPC in LabVIEW, I would recommend using the LabVIEW Help documentation found inside of LabVIEW (Ctrl+H, Help>>LabVIEW Help.., etc.).  

 

Once you have a good idea of what you should be seeing with your code, and a specific question concerning why it's not working, it will be much easier for other forum members to help out when you're stuck.

 

Highest Regards,

Paul
0 Kudos
Message 5 of 7
(4,082 Views)

Hi Paul,

Thank you for your comment and the explanation. Actually, the examples that I mentioned going through are from LabVIEW examples which all about simulation. to implement MPC in real time, a difference should be from these examples.I could not find any work online on how to Implement MPC in real-time. If you see the posted VI which I tried to perform, it is building on the MIMO example in LabVIEW example. first of all, I am not sure if the structure of VI order is correct for real-time. This is the first time I try to perform MPC and in LabVIEW in particular. 

I think if I see any well-implemented example in real time, I can get rid of confusion.  

The LabVIEW help documentation in Ctrl+H does not provide clear enough information as each VI in predictive control is so complicated. 

Thanks

 

Jawad Mezaal

Murdoch University

0 Kudos
Message 6 of 7
(4,061 Views)

Hi Jawad,

In addition to hitting Ctrl+H for a simple explanation in the Context Help window, you can get more details by right-clicking the element on the front panel or block diagram and selecting "Help".  This can also be reached by clicking the "detailed help" link at the bottom of the Context Help window.  Note that, in addition to extensive documentation for each function, you can find documentation on various concepts used to implement control systems with the Control Design and Simulation Module.  This is a great place to find resources on what each of the VIs is doing to help you understand the examples you've seen so far and better translate the methods used in those examples into your application.

 

I'm not sure what your concern is when you say that you are looking for an exampe of MPC "in real time," as opposed to simulation. Do you mean using the code on a RT system vs a Windows-based system, or using the code with real hardware vs simulated hardware?

 

Are you able to use your MPC with a simulated input successfully?  This might be a good intermediate step to verify that things are working.

 

As a final thought:  have you seen this YouTube video made by Hans-Petter Halvorsen?  He walks through MPC in LabVIEW in quite a bit of detail and it might help fill in some holes between LabVIEW's functionality and the theory.  

Highest Regards,

Paul
0 Kudos
Message 7 of 7
(4,042 Views)