Ni.com is currently experiencing issues that may cause some pages to fail.

Support teams are actively working on the resolution.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with 3D LU Table from the Control Design and Simulation Module

Hi,

 

I have with help of other members here on the forum created a matrix and gridlines for a 3D lookup table where I am using the 3D LU table component from the control & simulation palette.

 

The whole idea is that the gridlines for the x, y & z axis and the output values (w) are read from in total 4 different CSV files. Then the user just writes the inputs manually

 

The implementation works good and the Vi runs without errors. 

 

The problem is that it gives wrong output values and I really do not know why. I have sorted all input values for the 3D LU block according to how it is instructed in the documentation. The output values that i recieve do exists in my CSV file and the LU table though, but it is for completely different input values

 

Another thing which is worth mention that I also created a 2D LU table, there it works perfectly fine, I got exactly the outputs that I want.

 

Do anyone see any obvious errors in my VI for the 3D LU table or how I have sorted the input values for the 3D LU block?

 

I have attached all related CSV files and the VI for the 3D Lu table and the 2D LU table in the attached zip-file

0 Kudos
Message 1 of 10
(1,217 Views)

It probably would have helped to keep the discussion all in one place.

 

Since I don't have the simulation module, I cannot see what's there. Do you get the correct values when using regular primitives as shown eariler?

 

You still have way too much code! I thought you are aware the "index array" is resizeable, right?

 

altenbach_0-1655130058295.png

0 Kudos
Message 2 of 10
(1,204 Views)

Why I created a new thread was because if I specify that it is related to the simulation module 🙂

 

Here is how my block looks like in the simulation loop 

antje668_0-1655132084329.png

 

And yes, when i arrange my inputs like this: 

antje668_1-1655132131476.png

It works perfectly fine, i get the output that I want which is making me even more confused.

 

The reason I want the 3D LU table to work from the simulation module is that I want to have an interpolation between some the values, and interpolation is included in that block 🙂

0 Kudos
Message 3 of 10
(1,191 Views)

Sorry, I cannot test, but I would verify that the XYZ corresponds the the correct order of dimensions of the 3D array indices. Maybe you need to swap the X and Z arrays, for example. Check the help here.

 

You say that the values are wrong. How wrong? Can you guess? Can you test with some trivial sample data (e.g. a 2x2x2 LUT with all different values and arrays [0,1] for the xyz arrays). Should be easy to troubleshoot.

0 Kudos
Message 4 of 10
(1,182 Views)

I have been trying with a trivial example (2 x 2 x 2) But when I add a page to the array (3 x 2 x 2) then all of a sudden I got this error message: 

antje668_0-1655301249769.png

 

Even though I have added a index to the LUT Z array, see this figure: 

antje668_1-1655301343186.png

 

 

And if it is of interest, here is how the array looks like, now with three pages: 

 

Page 1: 

antje668_2-1655301415296.png

 

 

Page 2: 

antje668_3-1655301441777.png

 

Page 3: 

antje668_4-1655301469046.png

 

So If I have interpreted what is being instructed in the documentation, which I think I have been doing, this error should not occur. So I really don not know why I got that error message actually...

0 Kudos
Message 5 of 10
(1,138 Views)

I guess you simply need to know how [x,y,z] corresponds to [row, column, page] of the 3D array. Have you tried any other permutation?

0 Kudos
Message 6 of 10
(1,133 Views)

So I spend the day yesterday trying to figure out how the 3D Lu table VI is working.

 

I strongly suspect the documentation which can be seen here is incorrect.

 

I will show one example which consists of two pages that I have written by hand.

 

The first example shows how I want the LU array to be constructed with its corresponding index values for the pages ( LUT Z), rows (LUT X) and columns (LUT Y), in order t make in to make it easy for myself I just set the index values to 0, 1, 2 etc...

 

288086666_331847005783945_6332182733776243478_n.jpg

 

The other page which will be attached below illustrates how the array should be constructed in Labview in order to navigate in the table with the index values of x, y, z. For example if I want 21 from the LUT i set x to 2, y to 0 and z to 1.

 

286738967_350709593837928_8967279284866705205_n.jpg

 

This is very confusing and I really don not see any pattern on how LabVIEW interprets the data array. 

 

A much easier way would of course be to have the data array in the LU table according to how it is formatted how I want it to be (page 1) and just change the interpretation of the x,y and z coordinates but for that I have not figure out how to do that, I don't even think it is possible actually.

 

I would really appreciate if someone could point out how the permutation works for the 3D LU table 

0 Kudos
Message 7 of 10
(1,115 Views)

Now I am really just speculating but could the problem be that the LUT data is a 3D array, whilst the LUT wants a 3D matrix?

0 Kudos
Message 8 of 10
(1,103 Views)

@antje668 wrote:

Now I am really just speculating but could the problem be that the LUT data is a 3D array, whilst the LUT wants a 3D matrix?


 

The only "matrix" datatype  in LabVIEW is a just glorified 2D array that is typedef'd to trigger certain linear algebra operations.

There is no 3D matrix datatype and even if there was, it would be identical to a 3D array.

 

Did you really try all possible permutations?

0 Kudos
Message 9 of 10
(1,099 Views)

Alright I understand.

 

Yes I have tried all 6 possible combinations of x, y, z and  the output from the LUT is not what i expect it to be.

0 Kudos
Message 10 of 10
(1,090 Views)