LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with Matrix Mathematics

Solved!
Go to solution

I am trying to get the engineering units of force and moment off of a load cell but can't get the matrix mathematics to work.  And If that can be done, have the output displayed on a waveform graph and later save to an excel document for reports.

I have ZERO experience with labview so I'm just trying to get  life out of the sensor.  I have tried to "transpose" the 1-D array so that it might work in the AxB matrix multiplication VI.  In the A portion of the AxB operator is my Calibration matrix and the B input is the signal from the sensor and in the birds nest are array outputs to the front panel to show signals.

 

I have Error -20039 code off the AxB matrix multiplication.

 

 

0 Kudos
Message 1 of 14
(510 Views)

Hi DePeppers,

 


@DePeppers wrote:

I am trying to get the engineering units of force and moment off of a load cell but can't get the matrix mathematics to work. 


Why do you need matrix operations to convert a (voltage?) signal to engineering units?

 


@DePeppers wrote:

I have tried to "transpose" the 1-D array


A 1D array doesn't have any "direction", it is a vector. You are using LabVIEW, not Matlab…

 


@DePeppers wrote:

In the A portion of the AxB operator is my Calibration matrix and the B input is the signal from the sensor and in the birds nest are array outputs to the front panel to show signals.

 

I have Error -20039 code off the AxB matrix multiplication.


Can you please downconvert to LV2019 (File->Save for previous) and attach again?

 

On the error: why don't you read the error explanation? It's pretty clear: "Possible reason(s):

Analysis: (Hex 0xFFFFB1B9) The number of columns in the first matrix is not equal to the number of rows in the second matrix or vector."

(Basic rules for matrix math…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 14
(472 Views)
Solution
Accepted by topic author DePeppers

Your "matrix" (actually a 2D array is 11x11 and you are trying to multiply it with a 1D array that has six elements.

(It is a good habit to always resize the array to show one more row/column than the data size or show the scrollbars. Container size has nothing to do with the array size!)

 

altenbach_0-1738917722005.png

 

I am pretty sure "reshape array" does not do what you think it does. Do you have a link to a website that explains what you are trying to do with the six voltage values? Makes very little sense. (...and please don't maximize the diagram to the screen)

 

Message 3 of 14
(461 Views)

Once the dimension match, there are no more errors.

(I simulate some data with 6 values and take the 6x6 subset of the matrix.

 

altenbach_0-1738919979338.png

 

0 Kudos
Message 4 of 14
(447 Views)

Thank you for pointing this out to me.  Whenever I had made the 2-D array I had the container indexed to 5 & 5 whenever I had initialized the values.  And when I did this I overlooked the autofill of the other cells with values making it automatically an 11x11 matrix.

0 Kudos
Message 5 of 14
(366 Views)

I am trying to create a VI to record data from a sensor.  The sensor has three channels for load in lbs. and another three for moment in in-lb.

0 Kudos
Message 6 of 14
(359 Views)

@DePeppers wrote:

I am trying to create a VI to record data from a sensor.  The sensor has three channels for load in lbs. and another three for moment in in-lb.


Can you explain the scaling math and the need for linear algebra here?

0 Kudos
Message 7 of 14
(342 Views)
Solution
Accepted by topic author DePeppers

@DePeppers wrote:

Thank you for pointing this out to me.  Whenever I had made the 2-D array I had the container indexed to 5 & 5 whenever I had initialized the values.  And when I did this I overlooked the autofill of the other cells with values making it automatically an 11x11 matrix.


A very important habit for array diagram constant is to resize the container to always show the first invalid row column (OR show the scrollbars if the array is large). An additional problem in your case is that the default value for the element seems to be nonzero (23.7666). Confusing!

0 Kudos
Message 8 of 14
(334 Views)

Thank you for your help.  What I had been trying to do was create a VI to record data from a force and torque sensor.  But I do not have the right NI module to do that (I have a NI 9205 when something like https://www.ni.com/en-us/shop/category/strain-pressure-and-force.html?srsltid=AfmBOopFfH5VP7_N9VVSMn...

0 Kudos
Message 9 of 14
(328 Views)

Hardware is irrelevant for the math!

 

I understand that you get six readings.

 

I am trying to understand the reason for the matrix multiplications. Where do the matrix values come from? What do they mean? How does the result depend on the raw readings?

0 Kudos
Message 10 of 14
(314 Views)