LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Min/Max for computing damping

Solved!
Go to solution

Hey guys, I'm attempting to find the damping ratio of a free vibration curve. I'm going to use the logarithmic decrement method. I understand that I need to get the min max of 2 cycles within my FV curve.

 

How to I "point" to different cycles in my curve? IE. I want to get the min/max of cycle 1 (before the decay), and then the 6th cycle after.

 

Can anyone give me some direction?

0 Kudos
Message 1 of 16
(3,987 Views)

Look at the Peak Detector VI.  You can set it to look for peaks and valleys.  It will give you an array of amplitudes and locations for the peaks  (or valleys when you chang the input).  Now you can look at your 0th and 5th elements of that array for the 1st and 6th peaks.

Message 2 of 16
(3,972 Views)

That seems like a good solution...my only problem is that I have many maximum peaks. See pic. How would I go about distiguishing these and only getting the last max? (before decay)

0 Kudos
Message 3 of 16
(3,963 Views)

I guess I could so some comparison and see what location gives the greatest percentage of deviation between points. Then I would know where my decay starts?

0 Kudos
Message 4 of 16
(3,943 Views)

That's what I would do.

Message 5 of 16
(3,925 Views)

Get the array of peaks. Eliminate the subset where the amplitudes are constant (clipped). Fit an exponential curve to the amplitudes and locations of the peaks. Damping is one of the outputs of the Exponential Fit.vi.

 

Lynn

Message 6 of 16
(3,915 Views)

is there an example on how to eliminate the amplitudes that are constant? Or something similar?

0 Kudos
Message 7 of 16
(3,909 Views)

Not that I know of.

 

It is just a basic math problem you are applying to an array of data.  You already described what you want to do.  See if the current peak is within some tolerance range you define of the previous peak.

Message 8 of 16
(3,891 Views)

I guess my problem is my imagination. I understand I need to point to the 0 index and then look at 1 index, and compare the two to see if there's been a 5% change. If there hasn't, go to number 3 and compare with number 2...If it HAS I then pull #2 as my peak. I'm lost when it comes to the code. Would a for loop with indexing be ideal (so I can tie my iterations to my indexes)? Or should I not use a for loop. This array is static...It shouldn't be this hard for me...ugh.

0 Kudos
Message 9 of 16
(3,856 Views)

Yes. Use a For Loop.  You can store the previous value in an shift register.

 

You've described what you've wanted to do in words, now start laying it out in code and try it out.

 

You can also use the derivative functions which will calculate the delta between values within the array.

 

Message 10 of 16
(3,827 Views)