NI VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Veristand phar lab custom C controller

Solved!
Go to solution

Hello Kouki,

i am not clear on what you are trying to implement.
My issue was running the nl-opt toolbox on dedicated hardware (PXI)
I never succeeded in implementing matlab code to the PXI, due to toolbox dependencies.
Thus i resorted to do all my programming in C code, with the NL-opt toolbox.

For implementing NMPC within matlab i suggest to either code from scratch (build own optimizer and MPC algorithm), use the matlab optimization toolbox (thus only coding the MPC part) or look for a NMPC toolbox (i believe this exist).

But for implementing NMPC on dedicated PXI hardware, i suggest to avoid matlab and build your code in C.

best regards,
Tom

0 Kudos
Message 11 of 16
(304 Views)

Dear ThomJ, 

Thanks for your answer. But for this state, my problem is haw used NLOP library to optimized the Nonlinear model predictive control problem in Simulink. I have used s-function for coding the MPC part AND NLOP library for optimisation. Please if you have any information tell me. Thank you.

 

Best regrate 

KOUKI

0 Kudos
Message 12 of 16
(300 Views)

If i understand correctly you are trying to implement C code in simulink using the s-function block.

i have no experience in exporting the nlopt library to matlab, and i suggest you try the mathworks forums for more help.

or try to use matlab toolboxes for your optimization, i believe either matlab or the community will have already ported most if not all of the algoritmhs available in the NL Opt library

Best of luck.

0 Kudos
Message 13 of 16
(297 Views)
 

Dear ThomJ, 

Thanks for the reply,

When you are used Nl-opt toolbox in C code for solving the optimisation problem of nonlinear predictive control, you have used "NLOPT_GN_ISRES"   NLOPT algorithm?

Best regrate 

KOUKI

0 Kudos
Message 14 of 16
(279 Views)
Highlighted

Hi Kouki,

I have applied BOBYQA.

Best regards,
Tom

0 Kudos
Message 15 of 16
(273 Views)

Thanks for the reply Tom.

Best regards,

KOUKI

0 Kudos
Message 16 of 16
(264 Views)