LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HELP: How to implement Model Predictive Control in LabVIEW?

Hi, everyone
 
I have a problem on realizing model predictive control algorithm in LabVIEW 7.1.1.
 
What I have now is a linear model predictive control algorithm designed with Matlab -- Model Predictive Control Toolbox. Under simulation in SIMULINK, it works well.
 
Now I need to implement this algorithm with hardwares such as sensors and actuaors by LabVIEW.  Initially, I try to use the NI Simulation Interface Toolkit (SIT) 2.0 connect the simulink module with my LabVIEW interface to get the model calculation out of matlab, then send them into LabVIEW. It failed, because SIT can only help me design a simulation interface in LabVIEW based on Matlab model. Not the parrallel working mode I need. I am wondering,  does any  people here have experience dealing with the similar problems? 
 
Thanks! Appreciate your time and help!
0 Kudos
Message 1 of 8
(4,929 Views)
I'm unfortunately not familiar enough with the Simulation Interface Toolkit to know everything that it can do, but I do know that it should allow you to target models to Real-time systems that interface with hardware.

LabVIEW also does have a Simulation Module of its own that allows you to create models inside your LabVIEW code that interface with hardware through drivers like NI-DAQmx. Perhaps this might suit you? It also has a tool that translates existing The MathWorks, Inc. Simulink® models into the LabVIEW Simulation code. You might check here for more information.

Otherwise, what exactly do you mean by parallel working mode? Connecting to hardware?

Message Edited by Jarrod S. on 07-06-2006 11:47 AM

Jarrod S.
National Instruments
Message 2 of 8
(4,916 Views)
Thanks Jarrod.
 
With your suggestion, I tried LabVIEW simulation module. It seems the Model Predictive Control (MPC) block I developed in Matlab/SIMULINK cannot be supported by LabVIEW simulation translator. 
 
The parrallel mode means I want to use the input from DAQ card as the input for MPC block (Basically, it is just a control algorithm with I/O), and I would like to use the output from MPC block as my actuator output to external device. However, when I use Simulation Interface Toolkit to import my MPC block from Matlab to LabVIEW. It is completely sealed. I mean I cannot pull the I/O ports out from this block in LabVIEW. That is the problem where I am now.
 
BTW: I found there is optimization function in Simulation module of LabVIEW.  But Why I cannot find that function in my Simulation module (LabVIEW 7.1.1 + Simulation Module 1.0) ?
 
Do I need to upgrade my LabVIEW to 8.0, since I heard about several powerful math functions there. And I am hoping with these math tools, I could realize MPC by myself in LabVIEW.
 
Anyway, Thanks a lot for your help!!!
 
 
0 Kudos
Message 3 of 8
(4,901 Views)
There certainly are a number of new math functions, especially in the area of optimization, that could help you out here. You might check here for more information. I'm not sure what you mean, though, that you "found" an optimization function in the simulation module, but then you can't find one. Are you referring to some documentation where it mentions this?
Jarrod S.
National Instruments
0 Kudos
Message 4 of 8
(4,878 Views)
Yes, I found a lot of new math functions in LV 8.0. And I will work on them try to solve the  problem. Thanks for your help!!!
0 Kudos
Message 5 of 8
(4,863 Views)
Hi,
 
The MPC's I have worked with in the past utilizes MINOS or CPLEX as optimization solver - you might want to look at how TOMVIEW can be used for these purposes - do you know what kind of optimization problem you actually have? Is it a linear problem or quadratic?
 
Best wishes, Marcus
Marcus M. Edvall
Tomlab Optimization Inc.
855 Beech St #121
San Diego, CA 92101-2886
USA

web: http://tomopt.com
e-mail: medREMvall@tomREMopt.coREMm
Office1: (619) 203-2037
Office2: (619) 595-0472
Fax: (619) 245-2476
0 Kudos
Message 6 of 8
(4,856 Views)

Hi, Marcus

Thanks for your information. My problem is Linear Quadratic. I prefer using Sequential Quadratic Programming to solve this MPC. Actually, I do find a constrained NL programming function using SQP in LabVIEW 8.0 Optimization Module. However, as you know, MPC needs the model calculation result each time for the optimization. And that SQP function in LabVIEW is not good enough to realize that as far as I find.

I heard about that TIMVIEW is a perfect LabVIEW based optimization solver. Could you please provide me more information about the application using TOMVIEW for MPC. Thanks a lot!

Xi Zhang

Dept. of Chemical Engineering

Process Control Group

Texas Tech University

Lubbock, TX

xi.zhang@ttu.edu

 

 

0 Kudos
Message 7 of 8
(4,843 Views)
Hi Xi,
 
Assuming your problem is sparse it's probably best to use TOMVIEW /SNOPT - this is the number one sparse SQP solver. If the problem is dense then NPSOL might be better - also of course you can try MINOS (reduced gradient).
 
When you call the solver recursively like you will it's great to use a feature called warm start - the solution process will then be much faster than just supplying a good starting point.
 
Demos are available here: http://tomlab.biz/tomview/
 
You can take a look at qpQG.vi - this is a QP example.
 
Best wishes, Marcus
 
 
Marcus M. Edvall
Tomlab Optimization Inc.
855 Beech St #121
San Diego, CA 92101-2886
USA

web: http://tomopt.com
e-mail: medREMvall@tomREMopt.coREMm
Office1: (619) 203-2037
Office2: (619) 595-0472
Fax: (619) 245-2476
0 Kudos
Message 8 of 8
(4,835 Views)