03-27-2019 02:25 PM
@BAJ19 wrote:
The sampling rate is approximately 30Hz as you said (see my reply to GerdW) and we can calculate time manually but is there any communication between arduino and labview regarding the sampling rate?. and Is there a way to measure the time (or samples) automatically since the impact will be done multiple times.
Your Arduino program is sending data. I don't know how your code runs, but it certainly outputs a lot of data per line, and also seems to output some "header" lines (judging by the data in Header.txt, which seems to come from Arduino).
Do you have any control over what Arduino sends to you? There seems to be a lot of redundant and potentially unnecessary fields. For one, you can eliminate all of the text fields (such as "X(Yaw): "). Second, there seems to be redundant information -- you have X, Y, Z as Roll, Pitch, Yaw, and as eul (which I assume are Euler angles, look identical to R, P, Y). I'm further guessing that q are a quarternion representation (also redundant), etc. If your sensor is a 6-DOF sensor, you only need to send 6 numbers! Less data per line means (potentially) more samples/second. Of course, you might not have much choice, as you might be using "canned code" from a third party that just gives you all these numbers. Too bad -- 3D accelerometers are pretty cheap and simple (though calibration can be an interesting Problem-to-be-solved).
I don't know how you "time" your study. I presume you set up the hammer, then do "something" to trigger it. If I were designing this, I would do the following:
Bob Schor
03-28-2019 12:20 PM
Thanks Alot!!
I modified my arduino code to not send redundant information and increased my sampling rate to 60hz :). Whatever I do after that doesn't increase my rate anymore. Maybe limitation using serial visa?
03-28-2019 12:26 PM
Thanks Alot GerdW!
Like you and Bob said, I modified my arduino code and stopped useless data being sent from it and now my sampling rate is 60Hz, an improvement but I will try to get it to 100Hz as specified by the sensor.
In the end i used the trigger and gate function to measure how many samples (using "number of waveform samples" vi) between the two level threshold and then do numeric calculation to obtain the travel time, since we know what the sampling period is. Thanks 🙂
03-28-2019 12:27 PM
Well, you could attach another "data dump" and we'll give suggestions ... Hard to make recommendations without data.
Bob Schor
03-30-2019 05:45 AM
Sure!
Here is what I am getting after I modified the code. Much cleaner and uses way less data. Got my sampling rate all the way up to 152Hz now :). Don't know what else I can do to improve transfer rate now.
03-30-2019 12:53 PM
Much better. You still have a few places for improvement:
Bob Schor