Offline
Newbie
Karma: 0
Posts: 7
|
 |
« on: February 25, 2013, 04:05:46 pm » |
Hi guys, I need help programming a robotic arm. The arm is a Robix kit that contains 6 servos, but if i can get 3 servos working, it is good enough. I also want to control it with a ps2 analouge controller. So far i need a robotic arm that can turn left/right up/down and activate a pincher. Any help will be great  I am a noob btw, and i need it for a school project 
|
|
|
|
|
Logged
|
|
|
|
|
(USA)
Offline
Full Member
Karma: 0
Posts: 244
|
 |
« Reply #1 on: February 25, 2013, 04:37:40 pm » |
Would be glad to help but could you please give us a link to the kit.
Also, what Arduino are you using.
Btw once the first servo is working the other 5 will be easy!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #2 on: February 25, 2013, 06:43:00 pm » |
Thanks for showing interest The link : http://www.robix.com/contents.htmlI am also using an Ardiuno uno, i got like a couple days ago
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #3 on: February 25, 2013, 07:00:17 pm » |
Can I use the Bill Porter schematic for hookin up my ps2 analouge controller?
|
|
|
|
|
Logged
|
|
|
|
|
(USA)
Offline
Full Member
Karma: 0
Posts: 244
|
 |
« Reply #4 on: February 25, 2013, 07:28:58 pm » |
To be honest I don't know how to use the ps2 controller but I can show you how to move your servos. To control a servo you will need to use all three wires coming from it. The yellow one should be connected to a pwm pin on your Arduino. The black wire is ground and the red is live. You will need a 5v power supply. If you try to pull power from you Arduino you will destroy it. A battery pack or a wall wort should do the trick. Simply put the positive wire from the power source to the positive wire of your servo. Do the same with the ground wire. Try just one servo to start with and use the code below. Once you get it working try to adapt the program to control 6 servos if you can't I will show you how. #include <Servo.h> Servo myservo
void setup() {
myservo.attach(9); // plug the servo into pin 9
} void loop() { myservo.write(45);
delay(1200);
myservo.write(180);
delay(1200); }
|
|
|
|
« Last Edit: February 25, 2013, 07:33:05 pm by Drew Davis »
|
Logged
|
|
|
|
|
(USA)
Offline
Full Member
Karma: 0
Posts: 244
|
 |
« Reply #5 on: February 25, 2013, 07:35:12 pm » |
Also, make sure the servo you use is not connected to the arm!
If you can give me the link to the controller and the receiver I will look at them and see if I can figure out how to program it.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #6 on: February 25, 2013, 07:55:39 pm » |
http://www.billporter.info/2010/06/05/playstation-2-controller-arduino-library-v1-0/I was actually planning to do the cheapest way possible without a transmitter and a receiver. A direct link with the controller and arduino, and then the arduino to the servo(s) This video helped me a little, but i still need to control it with a ps2 controller. The trial run with one servo was successful, thank you 
|
|
|
|
|
Logged
|
|
|
|
|
(USA)
Offline
Full Member
Karma: 0
Posts: 244
|
 |
« Reply #7 on: February 25, 2013, 08:15:30 pm » |
I get it now. That is much easier to program then if it was wireless. It so cool… I want one  From what I can see you will need 5 servos and 5 buttons. 1. up 2. down 3. left 4. right 5. pincher. What buttons on the controller do you want to use for those motions. I was thinking the group of buttons on the left of the controller for motion and maybe one of the ones on the back side to activate the pinch? Chose which one you want and we can start programing. Also do you have any experience in C?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #8 on: February 25, 2013, 08:29:28 pm » |
I have absolutely no experience in C, I am a junior in high school and I am just starting off  . Ive seen a couple of tutorials on youtube but none really help me out. Although I have no experience this field really intrigues me and sheer amount of things one can create with an arduino. 
|
|
|
|
|
Logged
|
|
|
|
|
|
|
(USA)
Offline
Full Member
Karma: 0
Posts: 244
|
 |
« Reply #10 on: February 25, 2013, 08:34:25 pm » |
Look into the robofest competition thats what got me started!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #11 on: February 25, 2013, 08:44:28 pm » |
im good with using the left pad to control movement, and the bumpers on the back of the joystick for the pincher  Thank you so much guys 
|
|
|
|
|
Logged
|
|
|
|
|
(USA)
Offline
Full Member
Karma: 0
Posts: 244
|
 |
« Reply #12 on: February 25, 2013, 09:13:27 pm » |
I have 2 midterm tests this week so I don't know if I will be able to wright up an example for you this week. Unless somebody gets to it faster I should have something during spring break (next week).
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #13 on: February 25, 2013, 10:26:48 pm » |
ok man, anything is greatly appreciated
|
|
|
|
|
Logged
|
|
|
|
|
New Jersey
Offline
Edison Member
Karma: 26
Posts: 2455
|
 |
« Reply #14 on: February 26, 2013, 07:35:28 am » |
Search the forums for posts by Zoomkat - his test code for servos should get you started with one axis and once you have that it should be easy enough to add others.
|
|
|
|
|
Logged
|
|
|
|
|
|