Re: [Gumstix-users] Calculating speed from rate

 Re: [Gumstix-users] Calculating speed from rate From: - 2006-04-26 21:10:09 Attachments: Message as HTML ```acceleration derivates from speed, that derivates from position. So dx/dt=3Dv and dv/dt=3Da then a=3Dd=B2x/dt=B2 (or x'') continous fonctions are the limit of discrete thing when T -> infinity, so better results with higher frequency, and try to find a way to do your calculation as regularly as possible (gpio interrupts with a counter that triggers it ? or linux gives things similar .. ?). whith discrete data, I think you should do something like : v(i) =3D (x(i) - x(i-1)) / (t(i) - t(i-1)) and a(i) =3D (v(i) - v(i-1)) / (t(i) - t(i-1)) Tell me I'm wrong somewhere ! On 4/26/06, Demetris Zavorotnichenko wrote: > > I have a gyro connected to the microcontroller. > > I get Raw analog data from the gyro. > > the Zero state is 50 > > if the gyro is turned to one side the value goes down > > if gyro turns to the other side the value goes up > > > How do i calculate the speed of the turn? > > I actually want to make a simple code of direction with the gyro. So when > i > turn the device left i don't get the acceleration value but the position > substantial to previus position. > > How do i do this? > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > gumstix-users mailing list > gumstix-users@... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > -- J=E9r=F4me Multrier TinyCoach, un projet KaliBee ```