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.

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 17
(1,461 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 17
(1,457 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 17
(1,454 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 17
(1,436 Views)

Hi Kouki,

I have applied BOBYQA.

Best regards,
Tom

0 Kudos
Message 15 of 17
(1,430 Views)

Thanks for the reply Tom.

Best regards,

KOUKI

0 Kudos
Message 16 of 17
(1,421 Views)

I compiled a quite simple model with the VeriStand 2020R4 toolchain (selecting the windows target) and add the following custom code to avoid resolution of __setusermatherr symbol at load time (it's just an empty stub).

 

The model seems to work on Windows (test done with a simple custom scheduler not VeriStand).

 

There are no more bad entries reported by DLL checker for LV2017, but I currently have no Pharlaps target to test it in real time.

 

thumble_0-1617272494977.png

 

0 Kudos
Message 17 of 17
(1,011 Views)