Shop OBEX P1 Docs P2 Docs Learn Events
Math help Please!!!!! — Parallax Forums

Math help Please!!!!!

SputnikSputnik Posts: 2
edited 2006-06-15 05:20 in BASIC Stamp
Im trying to mix 2 R/C signals. Like a v-tail mixer for those who know.

Im having trouble making one signal exactly the opposite of the other. I cannot figure out the math needed.


What I need to do is for the servo outputs to be the same with elevator and be exactly OPPOSTIE in proportion with the aileron.

If the servo is center at 1.5ms and I move the stick right and get 2.0ms to one output,I need the other servo to be 1.0ms so they move opposite of each other.

It has to be proportional though. I can do it with the whole numbers used in the example above with IF..Then's, just cannot figure out how to make it proportional.

Ive tried subtracting from the variable the incoming pulse is stored in but I can only subtract whole numbers, and with the center pulse at 1.5ms, if I subtract 1 its at .5ms an servos cannot go that low.

This type of control is often used in 2 motor drive/steer robots, but I dont know how to implement it PROPORTINALLY the BS2.

I hope you understand what I am saying. Any help would be VERY MUCH appreciated.

Thanks

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-06-15 04:08
    Sputnik -

    I suspect there is a posting here on the Basic Stamp portion of this forum which addresses your question, but I can't gain access to it for some unknown reason. I keep my own Stamp message archives, and it tells me that an attachement to the following message should have your answer, but you'll have to find someone more adept than I am to seek it out for you:

    Posting Date: 04/24/2006
    Subject (Topic): Can a BS2 act as a Servo mixer?
    Reply Author: Chris Savage (Parallax)

    Message Text: (available upon request)

    Every time this happens it burns the heck out of me. The resource is here, but you can't get access to it! I also thought the Parallax/Google search engine searched the Stamp Forums as well, but that no longer seems to be the case <sigh>.

    Sorry I wasn't able to be of any more help than that.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-06-15 04:11
    Sputnik,

    ·· The file Bruce refers to is attached to this message.· I don't know if it does exactly what you want, but it does mix servo channels.· It was designed to allow a standard R/C controller to control the BOE-Bot.· I hope this helps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • SputnikSputnik Posts: 2
    edited 2006-06-15 05:20
    Ahh, I had seen that file before and I looked but could not find it....THANKS

    DUH, I dont know why I couldnt figure that out, ADD and SUBTRACT.


    THANKS
Sign In or Register to comment.