Math help Please!!!!!
Sputnik
Posts: 2
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
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
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 -->
·· 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
DUH, I dont know why I couldnt figure that out, ADD and SUBTRACT.
THANKS