1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

Calculating velocity from position in a noisy enviroment

Discussion in 'Embedded' started by James254, May 30, 2009.

  1. James254

    James254 Guest

    Hi,

    I've got a problem with calculating velocity from position data. Here's what
    I've got

    * A variable resistor that tells you the position of the object to be
    tracked
    * An A-D converter that samples the resistor every 10ms
    * I can track the position of the object and output a control signal to my
    motor to stop it at the desired point
    * Inertia keeps the object moving and I get oscillations
    * I believe I can calculate velocity simply by saying V = (
    Position(Current) - Position(Previous) ) / Sampling Time
    * When I examine my calculation by outputing it to a port I get wild
    positive and negative variations due to noise from the variable resistor
    * I can't add an external filter to the system, I must deal with the noise
    in software.
    * I've tried a several types of filter (Averaging and simple low pass
    filters) but the signal is still too noisy.

    Do you have any suggestions?

    Thanks in advance,
    James
     
    James254, May 30, 2009
    #1
    1. Advertisements

  2. * I've tried a several types of filter (Averaging and simple low pass
    A more typical filter would be the alpha beta (gamma) filter
    http://en.wikipedia.org/wiki/Alpha_beta_filter
    Not more complicated then a simple IIR and therefore
    appropriate for a microprocessor.
    Software can?t fix bad sensors.

    MfG JRD
     
    Rafael Deliano, May 30, 2009
    #2
    1. Advertisements

  3. James254

    Jon Kirwan Guest

    Since the OP can (and it seems to me, should) prepare a process/system
    model for his case, the Kalman filter seems better in this case. (And
    more work to do.)

    Jon
     
    Jon Kirwan, May 30, 2009
    #3
  4. James254

    Jon Kirwan Guest

    Alpha-beta appears inferior to me if the OP can work out a model. If
    not, then it all boils down to an ad-hoc, static arrangement anyway
    and I agree.

    Jon
     
    Jon Kirwan, May 31, 2009
    #4
  5. James254

    Walter Banks Guest

    Is the A/D under software control?

    Regards,
     
    Walter Banks, May 31, 2009
    #5
  6. James254

    James254 Guest

    Hi Walter,

    The A/D converter is built into the microcontroller so I guess that yes it
    is under software control.

    Kind regards,
    James
     
    James254, May 31, 2009
    #6
  7. James254

    Walter Banks Guest

    Which processor a/d ?
    Where I am coming from is it is possible in some cases to build
    some filtering into the analog conversion from the pot. This makes
    the problem both earlier ad likely have a better frequency response
    than more complex processing after the conversion.

    Feel free to contact me off line

    Regards,
     
    Walter Banks, May 31, 2009
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.