LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array subset output malfunction


@northwood wrote:

Honestly, I removed indexing because otherwise my input and output to the loop won't work. 

 




Of course not..  For the reason I attempt to explain above..  You'll have an array of clusters, whereas you was to extract the magnitude and phase from the different clusters. 

 

But you still have not explained what the ouput of the FOR loop should be...   Should it be a large array of magnitude and phase based on each iteration of the loop?  If so, then concatenating every iteration should do the trick, but I tried that and the Phase ? magnitude FRF waveforms look even more strange.  And there are 449 elements in the concatenated array, roughly 1/2 the number of elements from the original signal.

0 Kudos
Message 21 of 37
(1,005 Views)

@northwood wrote:


I find this rather odd, because when I use Matlab to make the Bode plot I can't really get them to match. 



What do you mean?

 

Does yor Matlab code work?  If so, can you post it so we can look at it to understand what you are trying to do with the FOR loop?

0 Kudos
Message 22 of 37
(1,003 Views)

@Ray.R wrote:

Ah yes... thanks ALtenback...  I remember..

 

The problem is thjat if you simply enable indexing, you get an array of clusters.  You then need to figure out what to do with the array of clusters.

As Altenbach asked, what should be the output of the FOR Loop?  What are you expecting?


So I have an array of clusters going into the loop and array of clusters coming out of the loop?  I think FRF is just output one array?  Pretty sure.

 

I am not exactly sure what Labview thinks a "cluster" is, that doesn't make a whole lot of sense to me yet.

 

I am on a crash course, aren't I?  LOL, I appreciate all the help guys!

0 Kudos
Message 23 of 37
(1,001 Views)

This is what the plots should look like, they have the same gains, but my resolution is so poor coming from the FRF that I can't get the pole in the middle.

 

m1=1;

m2=1;

k1=100;

k2=100;

c1=10;

c2=10;

 

A=[0 1 0 0;

...

    (-k1-k2)/m1 (-c1-c2)/m1 k2/m1 c2/m1;

...

    0 0 0 1;

...

    k2/m2 c2/m2 -k2/m2 -c2/m2];

B=[0 0 0 1/m2]';

C=[1 0 0 0;0 0 1 0];

D=[0 0]';

 

sys=ss(A,B,C,D)

[num,den]=ss2tf(A,B,C,D)

sys1=tf(num(1,:),den)                

%x1

sys2=tf(num(2,:),den)       %x2

bode(sys2)

0 Kudos
Message 24 of 37
(996 Views)

the smileys cracked me up.

 

should be

sys1=tf(num(1,: ),den)                

%x1

sys2=tf(num(2,: ),den)                

%x2

0 Kudos
Message 25 of 37
(995 Views)

OK, you are making this very hard for us, spoonfeeding us small bits of vague information with every post. This gets us nowhere!

 

 

Please do the following:

  • create indicators on the three wires going into the FOR loop in question (right-click...create indicators).
  • Run your simulation until these indicators contain typical data.
  • right-click the terminals of these new indicators and "change to constant". This will create diagram constants containing your raw data. (Wires will break, because they have two sources (diagram constant and simulation loop, ignore the broken wires for now)).
  •  Delete the simulation loop (i cannot run it because I don't have the toolkit).
  • Now we have isolated the problem to a simple for loop with known inputs and we can see what you actually have.
  • Save the VI under a new name and attach it here.
0 Kudos
Message 26 of 37
(992 Views)

I apologize, I am not purposely spoon feeding information.  I am learning as I go.  The first time I made a for loop I think it took me 4 or 5 hours for a simple one.  Here is the file as requested.

 

I am trying to get more resulotion out of the graphs to match my matlab code.  This is going to be hard since I am using Pink Noise as an input.  Looking at the Coherence Graph it can be seen that the input/output of the simulation loop are best coherence from 0-100rad/s or 0-~300Hz.   

 

I don't think it was my for loop, I think it has something to do with my signal generator or sampling rate.  Not really sure how I can get better resolution.  This may be something beyond labview.

 

Troubleshooting ways I have learned today.

1.  Probing

2.  Create indicator and watch what happens at each point.

3.  Isolate the problem (Thank You altenbach)

 

All things I should know from being a mechanic but didn't fully understand how to do in this program.

 

0 Kudos
Message 27 of 37
(985 Views)

Can you give us a real numeric value for the step size? We are missing the custom control.

0 Kudos
Message 28 of 37
(982 Views)

I am using a step size of 0.001

0 Kudos
Message 29 of 37
(980 Views)
Thanks. I have to look at it later, currently I am on the road....
0 Kudos
Message 30 of 37
(969 Views)