01-25-2009 10:12 PM
I'm trying to do something simple but haven't found the answer to my problem.
I have a loop that takes torque as an input and calculates acceleration; see attachment.
I'm trying to calculate velocity using acceleration.
I used continuous integration function of Time Domain Math, plugged acceleration in as the signal but the velocity it outputs isn't correct.
If the acceleration is 1 in/s^2, the velocity that is calculated is tens of thousand in/s within 1 second. That's not right.
What am I doing wrong?
Thanks |
01-26-2009 03:40 AM
I don't think you are specifying the time correctly. As you are only passing in the value and no time information to the express vi. I would recommend looking at some of the lower level more simplistic integration VIs which are more straight forward to understand. Especially the point by point integration function, this may do more what you want.
the integral is effectively the area under a graph, and it is hard to have the area under a single point, try creating waveforms and integrating them instead.
I hope I have given you a few Ideas, if you could post your actual code I could get a better understanding of what you are trying to do and then I could maybe suggest a more specific solution.
best regards
01-27-2009 12:20 AM
I thought that I would have have to pass time in since I'm using the Time Domain Math function.
I did try to pass time in along with acceleration but that still didn't work right. Maybe I have to create a waveform like you said. I don't know what that is exactly since I'm not well versed in LabView but I'll look into it.
If I use the regular integration function it needs a dt input. What's the best way to create a dt input? Do I have to create an array and continuously store initial and final times from a counter in my while loop?
I can post my code later if needed. I don't have labview up right now.
Thanks
01-28-2009 07:42 AM
So I tried creating a waveform but when I pass time and acceleration into the waveform builder the wires break. I'm not familiar with using them.
Here's a new question: how do I calculate dt between while loop iterations? If I can calculate that, I think I can use the regular integration function.
Calculating dt doesn't look like a straightforward thing though. Are there any easy ways to do that?
Thanks
01-30-2009 12:58 AM
Hello,
What is the source of your data exactly? If you are aquiring acceleration data as a signal then you can pass it into the Inegral express VI that you are using. If however you have just a integer input for acceleration, then perhaps use one of the Mathscript VI's, or the Numeric Inegral. Or even just break it into the sum equation. Either way, it is crucial to know the dt.
Anna K.
01-30-2009 02:37 AM
Time dt isn't very hard to do:
Send time as input to loop through a shift register. (T1)
Get time in loop (T2) and calculate dt (T2-T1)
Send T2 as output to shift register.
Now you'll get the previous loops time as input on this loop.
/Y