View Single Post
Old 18 Aug 2007, 17:24 (Ref:1991456)   #8
Rubinho
Racer
 
Join Date: Aug 2003
United Kingdom
Cambridge, UK
Posts: 167
Rubinho should be qualifying in the top 10 on the grid
Quote:
Originally Posted by tobias_funke
In Pi Maths make a new channel with whatever channel name and units you want. Set the frequency rate to the same as the 'Speed' sampling rate. The channel 'code' only needs:

deriviate ([Speed] , ignore)

NB: It's case sensitive. And make sure you get the units right. If speed is in km/h you need to divide it by 3.6 to get it to m/s and by 9.81 to get the resulting trace go G.
The actual syntax is:

derivative([Speed], Ignore)

The Ignore tells Toolbox what to do in the case of a discontinuity in the data. Not so much of an issue in logged data but there may well be missing data points in live telemetry streams for example. In this case it interpolates the missing points and carries on calculating the derivative. Your other options for the second argument are Reset i.e. stop calculating the current derivative and start again when there's a discontinuity or NoData i.e. return no derivative at all when the data is missing but hold the value and continue calculating it when the data "reappears".

Rather than putting "fudge factors" in the channel to account for units, Toolbox can do all that for you. If you open the advanced maths channel options you can tell Toolbox to automatically convert [Speed] into metres per second when it reads the input channel. If you set the Quantity of the math channel to be Acceleration and Unit to be metres per second^2 then all the units issue is taken care of. Then if you want to see it in G for example you can tell Toolbox to display the output of your math channel as a different unit by setting it in the Channel Properties. It is much better to let Toolbox handle your units "under the hood".
Rubinho is offline  
__________________
"Ah," said Dirk "it is a rare mind indeed that can render the hitherto non-existent blindingly obvious."
Quote