02-20-2011 04:52 AM
Hello All
I'm trying to measure velocity using an encoder (connected to US digital PCI4E)
I've tried two methods of measuring the velocity:
1. Creating LabView code that make a "Derivative" by knowing the change position and dividing it by dt
2. Using Labview Derivative option from "Time domain math"
When comparing the results I have found that they are not equal and they differ by a factor of about 3.3
Has anyone encountered such a problem?
Any ideas?
Regards,
Gil,
02-20-2011 12:18 PM
can you post the two examples? It seems like a basic scaling problem--easy to fix but, hard to resolve without the code.
02-21-2011 04:51 AM
Hi Jeff,
I'm uploading the vi and a short description
Thanks,
Gil,
02-21-2011 05:02 PM
dfg
The mathematical formula is different, and you should consider what you are trying to actually compute. The LabVIEW Express VI simply averages the current point with the previous point: yi=(xi– xi–1)/dt . The dt is grabbed automatically from the frequency of writing data.
On the formula you programmed directly, the formula seems totally different. The factor discrepancy you found is probably mostly due to the part where you are dividing the position by a wire from the PCIE4_GetPresetValue (right most VI in the red circle on the document provided). Other discrepancies may come from how you are windowing over 5 samples for calculating the value, and you have a saturation condition that selects the previous value, which could do all kinds of crazy things. This metric is hard to follow and I am not sure if it what you intend, but it is very different from the basic calculation of simple linear difference.
02-21-2011 05:16 PM
Eric,
Thanks for your help!
Gil,