LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with system identification

Solved!
Go to solution

Hello!

 

I've attached a VI I'm currently working on. The problem is that the system identification part doesn't work. After the iterations in the for loop the error "The signal length is too small for computation, or the stimulus and response signals are not of the same length" occurs. I've tried out some different ways of fixing this, like in the VI attached with array subset, so that I can determine the length of the both signals. Really don't know how to fix this, does anyone have any ideas?

 

Best regards 

 

Oscar

0 Kudos
Message 1 of 8
(3,547 Views)

Oscar,

 

how many samples does your "Sweep Signal" has? I would expect it to be LESS than 50k samples.....

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 8
(3,538 Views)

It is supposed to be 50k samples, but I'm not really sure. If I check it with array size, both the response and stimulis signal displays 1. Because it is 1D arrays or am I totally wrong? 

0 Kudos
Message 3 of 8
(3,527 Views)

Hi,

You've built them as arrays, but it should be possible to pass through a single waveform as you have selected to only have the last value as the tunnel mode out of the for loop. The waveforms should contain the 50k samples that you've selected, and the array input is not needed. 

 

Nic

--------
Nico
Systems Engineer

Certified TestStand Architect Certified LabVIEW Architect

0 Kudos
Message 4 of 8
(3,514 Views)

A couple of questions:

  1. Why is the top half of this loop being repeated?  It does not change from sample to sample as the inputs do not change.  It will also only provide the last set of points even if the user changes data during the FOR loop.
  2. If you are making these outputs conditional (is this the last loop?), why not use a WHILE loop?  Also, place a CASE statement around the top half allowing it to be performed only once during the entirety of the loop rather than every time it loops.
Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
Message 5 of 8
(3,505 Views)
Solution
Accepted by topic author OscarGott

Uh, wow, giving it a closer look i have to tell you that you have a LOT of incorrect and unnecessary code in your VI.

And you seem to have a complete misunderstanding of the waveform data type.....

 

Why is that?
1. You generate a waveform using Ramp by Samples and putting that array into a waveform as Y and defining a dt. However, the number of samples in the waveform is not fixed to 50k. And THIS number is what the analysis function later on looks into! Granted, the default values end up with 50k samples in the waveform.

2. You take the same array of Ramp by Samples, make a complete new computation on the values (loop, sine, window) and REPLACE the original Y of the waveform. This is called Rube-Goldberg code.

3. You now pass the waveform data to your output device. However, you pack this waveform into a 1d array of waveforms. This array has of course exactly ONE element. Ever. You never increase the number of waveforms in that array.

4. You take the array into an conditional output tunnel type "Last Value". The condition you implemented is always false for each iteration before the last one. As you never terminate the loop before the last iteration (e.g. 15 "Measurements") the condition on that terminal is Rube-Goldberg (as it is for input waveform tunnel as well!).

5. Your input waveform data array will also contain only exactly ONE element (waveform). It should include 50k samples as your DAQ Assistant is configured for that number.

6. You obviously think that your Array Subset functions will extract SAMPLES rather than WAVEFORMS. This is wrong, it will extract waveforms.

 

How to resolve this:

1. Remove the initial Y storage of the waveform data (output). Just write Y only once.

2. Remove the build array function from output to tunnel.

3. Remove conditional terminal of waveform tunnels and its logic (measurement variable).

4. Configure Convert From Dynamic Data to convert to a scalar waveform.

5. Remove both Array Subset functions.

 

It should now work as long as you make sure that Samplerate x Sweep Time is always 50k.

 

EDIT: Minions is correct: You should also either move the waveform generation for output out of the loop (only repeating actual output on the device in the loop) or you have to modify the code to take 'i' (Iterator) of the loop into account for sweeping...

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 6 of 8
(3,500 Views)

Thanks a lot!

 

As you probably notice I'm pretty new in labview. I've implemented your notes and everything seems to work just fine. Really kind of you!

 

Best regards,

 

Oscar

0 Kudos
Message 7 of 8
(3,485 Views)

Oscar,

If a solution has been provided that solved your problem.  Please close out the thread by marking that response as the solution and any others that helped add to the solution as KUDOS.  Good Luck.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
Message 8 of 8
(3,481 Views)