Need help with FFT of sensor data
Show older comments
Hello.
For my thesis, I am required to analyse one of the five links of 5 DOF robotic arm. The said link has also been designed in solidworks and was imported in Ansys software to find first 4 natural frequencies/mode shapes through Finite Element Analysis (FEA). The natural frequencies are as follows :
- 0.05934
- 188.22
- 476.19
- 558.74
Ansys also provides the Displacement Time data which can be exported for further analysis. I am currently trying to obtain a magnitude - frequency graph through FFT to find the natural frequencies of the link through exported data.
My understanding is, if I can recreate the natural frequencies given by Ansys through my MATLAB program, I will be able to find acceptable natural frequencies of any link by aquiring acceleration time data through sensors. But in order to do that, I need a program that finds close to accurate natural frequencies through FFT.
I have made/replicated a program, which is attached, by researching online. However, I am obtaining peaks at incorrect frequencies. Furthermore, my plot does not cover all the frequencies on the X-Axis as well.
Summary : I want to make a program that can give me a Magnitude Frequency graph through FFT for a link of a 5 DOF robotic arm. I want to recreate the results comparable or similar to precalculated and correct values of natural frequencies through my program. However, the results through my program are incorrect.
I am sure I must be doing something wrong but I cannot seem to figure it out.
Would appreciate any and all help.
Cheers.
X=readmatrix('accl.xlsx') %importing data
fs=20; % sampling frequency
L=138; % length of signal
nfft=2^nextpow2(L); % next power of 2 from length of freq signal
f=(fs/2)*linspace(0,1,nfft/2+1);
timefft = fft(X(:,2),nfft)/L;% frf of displacement
fre=2*abs(timefft(1:nfft/2+1));% frf of displacement
figure(1),plot(f,fre); grid on % fig A
% Natural frequencies without any scale adjustment
frf=fft(X(:,2));
figure(2),plot((abs(frf))); % fig B
12 Comments
David Goodmanson
on 11 Jun 2024
Hi Huzaifah,
If the list of expected frequencies is in Hz, then you are attempting to resolve a waveform at several hundred Hz using a sampling rate of 20 Hz, which is not possible. Is the list not in Hz?
Huzaifah
on 11 Jun 2024
Aquatris
on 11 Jun 2024
fs is he sampling rate of your data but the point is you cannot see a natural frequency of 188 Hz using a data sampled at 20 Hz. The information is lost. You can only see up-to 10 Hz frequencies (can be more with some interesting techniques) when you have a data sampled at 20 Hz. Check Nyquist-Shannon sampling theorem if you want to understand more.
Generally, you want to sample 10 times faster than the frequency components you want to see in a signal. For instance if you want to capture 100 Hz dynamics, you should use 1 kHz sampling rate etc.
Huzaifah
on 11 Jun 2024
Mario Malic
on 11 Jun 2024
There is no sampling in Ansys, you probably are using harmonic analysis. What you should be doing is modal and experimental modal analysis. Please read more about it, since there is a lot to write about.
First of all, what is this accelerometer data you mentioned in your question. How did you obtain it? If you are just acquiring data while the robot arm is moving while doing it's job, that is definitely not the way to obtain the natural frequencies. If this is an impulse response of the structure in the time domain, there is something wrong with it, you should have kept recording the signal to capture the complete response until it (almost) decays. Also, your you say you show displacement FRFs, but your file says accel. There was no integration anywhere in the code, and for FRF, you need to also have the input signal. So, what you are showing is just the acceleration in the frequency domain.
Sincere apology for my unstructured and rough comment, I just think you have to start slow in this topic.
Huzaifah
on 11 Jun 2024
Alexander
on 11 Jun 2024
If I understand correctly you have time domain data from a simulation (Ansys). My advice: Re-run the simulation and force a constant (!) sample rate of about 0.0002s (instead more or less 0.05s). With the result you can perform a fft easily.
Mario Malic
on 12 Jun 2024
Edited: Mario Malic
on 12 Jun 2024
Please do let me know more about how Ansys calculates the natural frequencies - You are free to look for this information on your own. ANSYS has a nice tutorial that I saw if you search for ANSYS modal analysis.
Why the exported displacement time data cannot be used to recalculate the expected frequencies?
If you think about your structure, it can be complex or simple - it doesn't matter. Take first form of vibration (not the rigid body mode), for example - how can you tell where to take the displacement from? If you take the displacement from one point only, and you see it's peak in frequency domain on the frequency of the first mode, it is not a sign that it is the first mode. What if you choose the point which is an anti-node, you won't see the peak at all.
So, you have to obtain data (read below) from multiple points, overlay them and find frequencies where most peaks coincide. So, you have to carefully choose multiple points on the structure.
What is this data that I am speaking about? FRFs are OUTPUT/INPUT ratio in the frequency domain. To excite the structure, you typically would use an impact hammer (impulse excitation), or shaker (random excitation) which is INPUT, and measure the response at different points which is OUTPUT. To display mode shapes, you do that by overlaying imaginary component of all FRFs. Then you will see the curves peaking (not all of them, and this is normal) at the specific frequencies.
As I am writing this now, I realised, that you probably have to do a random excitation on your model in ANSYS to obtain the response. However, I am not sure what type of analysis you should be doing, my thought is that you do a static one with such excitation.
I believe if I can do that, sensor data will give better results too and I will be assured that its not my program I need to worry about incase of wrong results.
If you have done your experiment correctly, then it's always your model that needs to be fixed.
Hope this helps, good luck with your work!
Ansys can find the natural frequencies from the physical properties of the parts, mass stiffness inertia height width lengths etc. So when you have a part in ansys, you define the material properties. Those material properties are then used along with the geometry information to find the natural frequencies.
Here are a few suggestions:
- Make sure your sampling rate is constant
- Make sure your sampling rate is at least 5 kHz
- Make sure the excitation you apply to the system has enough frequency content (if you apply an excitation force that is a single sine wave, e.g., sin(30*time), then you will only see a single peak at 30 in your fft.) So impulse force might work best for you due to its simplicity.
Mathieu NOE
on 13 Jun 2024
- 28-_Experimental_Modal_Analysis.pdf
- 29.pdf
- br0507.pdf
- Modal Impact Postprocessing.pdf
- s-v-jan2001_modal_analysis_tcm18-189939.pdf
- 28-_Experimental_Modal_Analysis.pdf
- 29.pdf
- br0507.pdf
- Modal Impact Postprocessing.pdf
- s-v-jan2001_modal_analysis_tcm18-189939.pdf
- 28-_Experimental_Modal_Analysis.pdf
- 29.pdf
- br0507.pdf
- Modal Impact Postprocessing.pdf
- s-v-jan2001_modal_analysis_tcm18-189939.pdf
FYI attached some publications about experimental modal analysis
and this one too : excitation-techniques-dos-and-donts.pdf (modalshop.fr)
Huzaifah
on 16 Jun 2024
Aquatris
on 17 Jun 2024
The excitation needs to be physical on the structure.
As long as your trajectory has the desired frequency content you do not need an additional excitation.
You cannot follow an arbitrary trajectory and assume it will give you all the information. You should design the trajectory carefully. There are different methods to find the 'optimal trajcetory' to be used in robot identification, most of which involve solving some form of optimization problem and might be advanced for you if you are not familiar with it. So you might consider manually designing a trajectory that has the frequency content you want without hitting the motion limits.
Answers (0)
Categories
Find more on Structural Mechanics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!