hi all i am new here and i am trying to get 2 dc wheeled motors to be controlled by 2 channels only. ok now here is the hard part. i have a 10 channel radio and i want to be able to make my robot go forward by pushing one stick (the right stick) in the up position witch will make both motors turn in one direction. the more i move the stick the faster they turn. and now when i have the speed set i want to be able to slow one motor down (or speed up)by also moving the same stick left or right. so what im saying is i want to be able to control forward and reverse and left or right in the same stick witch is 2 channels. anyone have any detailed thoughts?
yes thanks i want to steer like a tank. but i want to be able to control with one stick. it is a futaba 10 channel radio and i want to use the right stick only for forward/reverse and left /right. that way i can use my other stick for other things. does anyone have a diagram of wire hook up from rx to arduino and complete code to do this? the board i have for motor power accepts pwm also. sorry i am new to arduino. thanks
dactylicxx: but i want to be able to control with one stick.
That's what @raschemmel's code snippet does.
You have not explained how you plan to connect the transmitter to your Arduino.
If you have the Rx connected to the Arduino you need to connect the two relevant channels to two of the I/O pins and use the pulseIn() function to "measure" the width of the pulses.
thanks for the replys. i will be using a 10 channel reciever plugging in the 2 channels that use the right stick on the transmitter witch would be alerion and elevator. the 2 signal wires from the rx would goto the arduino (channel 1 on the rx is left/right(alerion)and channel 2 is forward/reverse(elevator)then 2 wires from the arduino to the motor control board that will accept pwm input for control.
as i said im am new to arduino and just looking for help
It would make life a lot easier for people who may be interested in helping you if you wrote all your comments in a single post until you get the next reply. If you want to add more to an existing post just click the modify button.
it also clearly states in my first post “i am trying to get 2 dc wheeled motors to be controlled by 2 channels only” what part of that do you not understand? lol
I think it’s more a question of what part you don’t understand. I explained the general principle in my earlier post. What part of that did you not understand?
the 2 signal wires from the rx would goto the arduino (channel 1 on the rx is left/right(alerion)and channel 2 is forward/reverse(elevator)then 2 wires from the arduino to the motor control board that will accept pwm input for control.
You also need a GND connection.
What Arduino pins are you planning to use?
What motor control board are you planning to use? Please post a link to its datasheet?
A computer project requires extremely precise specification. The generalities that humans understand are quite useless.
If you just want someone to write a program for you then you should ask your question in the Gigs and Collaborations section. If you are interested in writing the program yourself people will try to help you here.
You had 90 % of the code, (for about 5 or 10 minutes) but that wasn't good enough. What do you have now ?
thanks for the reply robin2. grounds and other wires are no problem for me to connect. just need help on how to make the code. it does not matter to me witch pins are used. i attached the manual for the motor controller. i have found some code but one channel controls one motor and the other channel controls the other…that would require me to use both transmitter sticks. i would like to only use one.
CK1122.pdf (775 KB)
Are you sure you can’t do the mixing in the transmitter? There’s probably not much support though. I mean, if it can mix 3 servos to control a Helicopter, it can’t mix two motors?
well that is a good question. i will load up the code i have and see if that works. thanks
dactylicxx: i have found some code but one channel controls one motor and the other channel controls the other......that would require me to use both transmitter sticks. i would like to only use one.
I don't understand this. My understanding is that each potentiometer in the transmitter controls a separate channel. Each joystick has two pots so it controls 2 channels. If you have code that takes data from 2 channels, isn't that exactly what you need?
yes that is true but i can not use that code to use a single stick to control the way i would like it. let me try to explain. ok if i push the right stick on the transmitter up that will make both motors go in the forward direction. the more i push it the faster they spin. the netural posistion they will both stop. if i pull the stick down from the netural posistion it will make both motors turn in the reverse direction. the more i pull it down the faster they will spin. now if i move the same stick to the left the right side motor will go forward and the left will go reverse. and vice versa for moving the stick to the right. now if my robot was moving forward by pushing the stick up if i also move the stick to the left it would slow down the left motor to make a left turn. do you understand now what i mean?
That's exactly how I control my Tug Boat with two motors. I just ended up using a "v-tail mixer" to run an airplane. The v-tail mixer combines the aileron and rudder servos. The mixer doesn't care if it's controlling servos or motor controllers.
dactylicxx: now if i move the same stick to the left the right side motor will go forward and the left will go reverse. and vice versa for moving the stick to the right. now if my robot was moving forward by pushing the stick up if i also move the stick to the left it would slow down the left motor to make a left turn. do you understand now what i mean?
Your description is not very clear, but I think this is just happening (or not happening) because the code interpreting the stick movements is not suitable for what you want.
It seems like it is getting the data from the receiver correctly, but then it is not doing what you want with that data.
As usual - post your code - and use code tags (the # button)
so it looks like this.
ok thanks for the help everyone i now have it working the way i want with one stick of the controller to move in all directions. i just had to set the mixing up in my radio after i had the code all uploaded to the arduino and everything hooked up. and a very big thanks to rmetzner49 for sugesting to use mixing. :D
dactylicxx: i just had to set the mixing up in my radio
Glad you have it working.
It should be possible to do that "mixing" within the Arduino code rather than in the Tx.
I guess I must have missed why he needs the Arduino at all.
I want to do the same as you did. I'm just wondering where I can get the sketch to upload to my Arduino Uno board?