LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mpc controller / model predective control / Commande prédictive

I want to design an MPC controller. I started with MPC example

 As i have perturbations in my system which is an active suspension system.

I made the identification of my experimental bench. I had a second order system, I discretized it and got a second order function ( numerator and denumerator ) , I used also the example in Labview to setup my programme with a transfer function ((CDEx MPC Transfer Function Models)).   

I have an error with control signal, i can not figure out why i have this error.

the file is attached 

Any suggestion ?

0 Kudos
Message 1 of 7
(2,731 Views)

I  added some modification to the function to appear in the interface .

i attached the file vi .

0 Kudos
Message 2 of 7
(2,715 Views)

Hello,

 

The error is occuring because you are trying to pass a 2D array (table) into an input that only accepts a 1D array (list). If you hover over the broken wire, it will give you more information about the datatypes that are expected.

 

Are you trying to add U(k) and d (the distrurbance)? If so, you should replace the build array function with an add which will add the values at the respective array locations together to make a final array that is the same size of the original arrays. (ie. array1 = {1,2,3,4} + array2 = {5,6,7,8} == array 3 = { 6, 8, 10, 12}).

 

However, if you are trying to add d to the end of u(k), you could right click your build array function and choose concatanate inputs which would give you array 3 = {1,2,3,4,5,6,7,8}. 

 

Please let me know what you are trying to do with u(k) and d and if you have any follow up questions. 

Applications Engineer
National Instruments
0 Kudos
Message 3 of 7
(2,690 Views)

I realized that it is replaced by error and i should use the other one.

but the problem is with the system (second order itself).

I see this error code    Discrete State-Space in fromTF2SSstep1.vi/Control & Simulation Loop in the error box with the code: -2318

 

 

I disconnected the input to system and i put a constant but it show just zeros in the output .At the other hand i put some constants (to the system) at the example:  CDEx MPC Transfer Function Models in Labview .The system gives outputs different from zero .

 

So the problem could be by the second order function that i put at the place of the first order in the original example but i cannot find out where and what the change that i should do to have a response at the system output.

 

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

Error -2318 states that "The dimensions of the parameter vectors of this function do not match."

 

What do you mean by "I realized that it is replaced by error and I should use the other one."? Did you change the array to Concatanate Inputs or did you add the two arrays together? What is your goal? Do you want an array that alternates between values of u(k) and d or that contains the sum of u(k) and d?

 

Can you attach a screenshot of your updated VI and a description of what you want to happen between u(k) and d? I am not very familiar with MPC Transfer Functions but have experience with LabVIEW and CD&Sim. 

 

Applications Engineer
National Instruments
0 Kudos
Message 5 of 7
(2,653 Views)

I concatenates the d and u 

and it works 

it seems that the problem was with used function (i changed them) and now it works with a second order.

0 Kudos
Message 6 of 7
(2,639 Views)

Ok. So Concatanate inputs is giving you your desired output? I'm not sure if your question has been answered at this point.

Applications Engineer
National Instruments
0 Kudos
Message 7 of 7
(2,636 Views)