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

Calculating angles,calculating velocity

  1. Aug 29, 2010 #1
    i am trying to calculate angles and velocity.
    i believe i have to use PID (never done before)
    i have a sensor that is giving a relative angular rotation in degrees per a second
    i can sample this a 300htz
    but how can i figure out if i have turned xo and i how can i reduce the cumulative error

    i have a sensor that is giving acceleration in g's
    i can sample this a 300htz
    but how can i figure out if i am moving @ x ms-2 and i how can i reduce the cumulative error


    if this is in the wrong spot please move it
  2. jcsd
  3. Aug 29, 2010 #2


    User Avatar

    Staff: Mentor

    Welcome tol the PF, Brad. I went ahead and moved your question to General Engineering for now.

    What are the outputs of these sensors like? Are they a byte or two that you are sampling at 300Hz? Or do they offer some sort of pulse outputs or serial data?

    Are you familiar with integration in calculus? that's how you go from a rate to a position. In your case, it would be a discrete integration, basically multiplying the rate by the delta time interval to get the quantity. As for minimizing the error, you might want to use the mean value theorem, or maybe some other type of predictive filtering of the data.

    What are your thoughts on how to minimize the errors?
  4. Aug 29, 2010 #3
    the output is a 10bit dac where 0 is -300o/s and 1024 is 300o/s and 512 is 0o/s

    the output is a 10bit dac where 0 is -1.5g and 1024 is 1.5g and 512 is 0

    i believe that
    proportional integral derivative
    something along the lines of
    where the tuning parameters are:

    Proportional gain, Kp

    Larger values typically mean faster response since the larger the error, the larger the proportional term compensation. An excessively large proportional gain will lead to process instability and oscillation.

    Integral gain, Ki

    Larger values imply steady state errors are eliminated more quickly. The trade-off is larger overshoot: any negative error integrated during transient response must be integrated away by positive error before reaching steady state.

    Derivative gain, Kd

    Larger values decrease overshoot, but slow down transient response and may lead to instability due to signal noise amplification in the differentiation of the error.
    Last edited: Aug 30, 2010
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - Calculating angles calculating Date
Enqiry about an electrical motor's power Feb 7, 2018
How to calculate heat transfer? Jan 4, 2018
Calculation of actual spray angle and coverage Sep 30, 2015
Calculate turning angle - 2 wheels car May 21, 2015
Yaw angle calculation Jan 13, 2015