PDA

View Full Version : Derivitive Math Function



TG
07-25-2005, 02:15 PM
I want to calculate the slope of a 0-5 volt signal. This signal will move all through 0-5v. Is there a way to calculate the derivitive of this signal with a STAMP?

Andy Lindsay (Parallax)
07-25-2005, 03:16 PM
I did a post·entitled PID Control Intro with the BASIC Stamp (http://forums.parallax.com/showthread.php?p=529609)·on the Stamps in Class forum a while back.· It has background on the derivative calculation.· You will also need an analog to digital converter (ADC).· If you do a search for ADC0831 on the Parallax site, you will find the product page and lots of resources on how to use it to measure voltage.

Tracy Allen
07-26-2005, 02:47 PM
In the simplest form, you measure the voltage at two points in time, and then divide the difference in voltage by the interval. It is particularly easy if the samples are regular intervals, say once per second. Then it is just subtraction of the two voltages.

To be meaningful, the interval has to be short enough that the change in voltage is well approximated by a straight line between the two sample points.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com (http://www.emesystems.com)