LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array summation and average

Hello,

              I have problem with array summation and average value and because of this variation, the efficiency of the program is drop down by 20%. I have no idea about controlling this jitter.

 

Problem

--------------

I am continuously acquiring the data from 6008 and then calculated the summation of acquired data. These data is taken from a device that is already connected to labview by SERIAL communication(RS232). So, according to the summation value I will adjust some parameters into serial device.

I have taken a threshold on the summation value i.e.. 0.1. When the summation value is 0.1 or more I will some value to my serial device and below than this value indicates some other thing.

Here I am facing one issue that as I am acquiring data continuously from 6008 which update the summation value of array. As long as, the summation value is greater than 0.1, I have no issues. Sometimes, my summation value is moving to and from 0.1 to 0.09 which makes inefficient. My program follow the value which it detects here, if suppose it is 0.09 it will indicate some other thing. At the same time if run again my code, this time it hit 0.1 and write some thing to serial device. Here, I need some efficient idea to catch one value even if I run my code many times.

 

*I can't go for finite acquisition mode.

 

Please help me.

0 Kudos
Message 1 of 11
(4,126 Views)

We cannot troubleshoot without seeing some code.

0 Kudos
Message 2 of 11
(4,120 Views)

Hello,

 I am just posting the array summation Vi here. I am using this logic in another vi. I am using the array summation value as condition value to " write something to SERIAL device".

0 Kudos
Message 3 of 11
(4,116 Views)

Please shed some light on me. I have been waiting for update.

0 Kudos
Message 4 of 11
(4,097 Views)

Can you repeat your problem without useless terms like "some thing" and "some other thing". Please be much more specific. What is your definition of "inefficient"?

 

It is not clear what your problem is and the VI you have attached does not help. For example, where does the threshold occur? Why are you building a 2D array just to tear it apart a nanosecond later?

0 Kudos
Message 5 of 11
(4,083 Views)

Ok.

I have some motors which have noise when they are running. I can communicate with those motors by SERIAL. I have done spectral analysis on every motor and tried one month to remove noise frequencies after the band of good frequencies. That method wasn't succeed in better way because the noise frequencies are spread with small magnitude levels all over the spectrum and also between the good frequency bins. So I decided to take this off with the help of magnitudes. I get the data from each motor by a sensor and analyze(I told about this before i.e.. Threshold 0.1(means noise) or 0.09(no-noise))in labview and adjust SERIAL device at the same time. Because of this jitter(especially when it comes near to threshold value after several noise removal adjustments serial writes) my efficiency is drop down to 20%. If my software hits 0.09--then program shutdown and it says no noise but actually the value is moving to and from with in millisecond.

 

I think whole night about this and I came with one idea. Now, I am getting 250 element array which having magnitude's. Especially, the jitter is coming due to some fluctuations in the spectrum of some range. Now, I will do the summation or average for that specific region and try it out. How can I extract that specific magnitudes from 250 elements?

 

Thanks for your suggestion about useless "Build array" in my code. You know I am bit poor in using array's. I changed it now. Can give me some suggestions now.

0 Kudos
Message 6 of 11
(4,062 Views)

You mention jitter at your control point, this sounds like you have a problem with your control method. You need to apply a dead band,
something like:

 

Take action when the noise goes above 0.1

Stop action when noise goes below 0.09

 

Take a look at the example program. Move the signal slider arround the theshold and look at the control outputs.

 

By the way in your program the label/caption on some of your charts don’t match in your diagram and on your front panel.

0 Kudos
Message 7 of 11
(4,051 Views)

I don't understand your code but it seems that you understand my problem very well. In my case, if control method encounter more than 0.1 or itself then it control the device. If the control method encounter 0.09 or less then it give a popup message. Problem is, my summation array is continuously updated for each iteration and calculate the summation of that array. When ever the summation value changes very fast to and from 0.1 to 0.09, my efficiency is drop down to 20%. I know that exactly at this point the noise is coming and going off always. This is been the noise removal point. I am going to use again one array here to save these values for each iteration and after some milliseconds time, I will look for maximum value in it for 0.1. I don't know, how to do this. I will try now. The array should erase and fill with new values on each iteration.

0 Kudos
Message 8 of 11
(4,049 Views)

When you say ‘summation value’ do you mean LowPeaks or High peaks in your vi?

 

Have you tried adding averaging to the PSD vi, take a look at the Help for PSD there are various option to try.

 

I had ment to add some explanation to my code but I was distracted by something then I forgot. I’ll update it soon.

0 Kudos
Message 9 of 11
(4,045 Views)

Hello I am only looking at "low peaks" summation. Even the average is also moving in the same fashion. You don't care about high peaks.

0 Kudos
Message 10 of 11
(4,036 Views)