Im starting a project for my final year at school - I want to build a robot arm with is controlled by a joystick. I need some guidance and maybe some explanation on how to get my servo to be controlled by the joystick. I will be having 5 servos - one at the base - 2 supporting the frame, one at the elbow and the final one with my robot claw. I dont know which joystick to get which will be able to control all these servos - or even if its possible for the joystick to control all these 5 servo's functions - Also how the codes would work? I've played around with one servo and was able to make it work but the prospect of 5 servo seems out of my reach
Any help would be really appreciated - Thanks
-This is what im trying to achieve: Experiment with joystick and robot arm - YouTube
I would find a joystick with a few numbered buttons, the more buttons, the better. Keep in mind, you may also need to get a USB shield, otherwise you may need to scrap the motherboard and just directly solder the buttons and pots.
Tilting the joystick forward and back, would raise and lower the arm, and side to side would rotate the base. The buttons would control the other servos by how long they are pressed.
Zee12:
I want to build a robot arm with is controlled by a joystick. I need some guidance and maybe some explanation on how to get my servo to be controlled by the joystick.
Buy an RC transmitter/receiver pair - or a servo tester, if you prefer it to be less obvious that you're using standard off-the-shelf parts.
Unless there's more to this project then you're letting on - for example, some reverse kinematics - the electronics side should be a lazy afternoon's work.
Instead of the individual pots, you may want to get the below joysticks. If you want to control your arm somewhat like a large excavator, you would use two joysticks. I've ordered sky lanterns from the below vendor located in the US and they arrived within a week.
depending on how many buttons the joystick has, he could use these as shift keys, so stick axes l<>r does pan at base, but while button one is pushed it does claw open/close instead for example however this would allow only one motion at a time, although using two joysticks - one for each hand would enable a greater combination of simultaneous movements such as pan at base while raising arm and opening claw.
2 joystick will be enough for 5? though i intend to use 2of the servos as one? using a y-cable i will connect the 2 servos to act as one for my suporting arm (moving up and down) ?
Why not just get a game controller, like a PS2 controller. You have two joysticks, plenty of buttons for button combinations, and you don't need to make any platforms or cases to mount the pieces to. There is a working library in the Arduino playground (a few actually), that I myself have used in the past. It only uses pins 10-13 too.
my teacher wants me to use just a joystick to control the servos - i initially wanted to control them with a ps2 controller - but he says it can all be controlled by one joystick ( see this video someone did it - thats exactly what i want to achieve Experiment with joystick and robot arm - YouTube )
Ok, well that is done with case statements. Every time he press the joystick, it switches the case statement. Its easy to do yea, but then that means you need to know what case statement your in, so you will need some kind of display.
The code will work exactly how krazydarcy described it.
Get reading from joystick and two buttons.
If button_One is held down, and joystick moves, do action 1.
else if button_two is held down, and joystick moves, do action 2.
else do action 3.