Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Numerical integration of angular velocity

  1. Dec 18, 2008 #1
    OK...this is a really trivial question, but I hope someone can help me here. I am working on building a segway-style robot that balances on two wheels, but I am having some difficulties integrating the data I receive from my gyro sensor. The sensor gives me the angular velocity, and I know that to find the actual tilt angle I need to use something like RK4. However, I have not taken differential equations, just Calculus AB, and I am having trouble understanding exactly what Runge-Kutta integration does. I looked all over the place, from Mathworld to Wikipedia, and I feel that I am close to getting it, but the f(x,y) keeps throwing me off. Could someone please explain in more basic terms what I need to be doing?


    I realize that I need to be a bit more specific. If my first 5 seconds of data are represented as ordered pairs (time t, angular velocity at time t) and I know that the angle is 0 at time t, how would I integrate (0,0), (1, 3), (2, 5), (3, 3), (4, 2), (5, 6) using, say, RK4? If you need more information, let me know.
    Last edited: Dec 19, 2008
  2. jcsd
  3. Dec 20, 2008 #2
    Never mind...I figured out how to use Heun's method for what I wanted to do, and it is a lot faster and simpler than RK4 and accurate enough to be useful. I am really glad I found this forum; there is so much information available and I will definitely use it in the future.
  4. Jun 13, 2009 #3
    Hey, can u explain me how u integrated using the Heuns method. I am also working on a similar robot, with similar data input, i.e of form (time, angular velocity). Can u please help me out?
  5. Jun 18, 2009 #4
    Is it about calcilating the area under a given curve?
    Just plot the points and estimate the area.
    Use trapezoidal rule? Simpson ? etc
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook