Shop OBEX P1 Docs P2 Docs Learn Events
Equation — Parallax Forums

Equation

Jon KeinathJon Keinath Posts: 146
edited 2005-03-31 02:27 in General Discussion
For my JavaBot viewable at jonkeinath.com I am trying to convert an equation (that converts degrees to PSC servo pulse) into something the javelin can handle...

The Equation is Y= - 4.5214x+1153(it's the "bestfit" line for my gathered data) where x is the degree and y is the servo pulse.

Any Help would be appreciated.

Comments

  • BeanBean Posts: 8,129
    edited 2005-03-30 14:04
    What is the range of X ?
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video Display Module" Available Now.

    www.sxvm.com

    "A problem well defined, is a problem·half solved."
    ·
  • Jon KeinathJon Keinath Posts: 146
    edited 2005-03-30 17:09
    0 to 180
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-03-30 17:25
    4.5214 = 452.14/100 = 452/100 = 113/25

    180 * 113 = 20340 (no overflow)

    Y = -((113*x)/25)

    Y += 1153

    That should be it.

    regards peter
  • Jon KeinathJon Keinath Posts: 146
    edited 2005-03-31 02:27
    Thanks, that worked great!
Sign In or Register to comment.