Hello readers. I am new to this whole world of programming. I have an arduino uno and a project in mind. I want to have a robot arm that runs on a continuous loop. I plan to have the arm reach out, grab a marble, and then drop the marble at the top of a ramp. By the time the arm reaches the starting point, the marble will be back in the starting position ready to be grabbed again. I want to be able to have this running on a continuous loop to be put on display in my room. I will be using four 9gram servos and a 6volt power pack from the bread board. I am struggling with what the code should look like, and I would appreciate any feedback. Thank You!!
Do you need a servo for that, or just a belt running around a couple of pulleys to lift the ball back up?
I would suggest this, and hack the interface to have Arduino control the movements.
I saw a website where position tracking was added to allow automated feedback also, vs just relying on time.
Limit switches could also be used so you know where a joint is to start an action.
http://www.owirobots.com/store/catalog/robotic-arm-and-accessories/owi-535-robotic-arm-edge-kit-110.html
Google this "owi-535 hack" and check the first 2 hits.
Your arm has two positions: Bottom of ramp and Top of ramp. Each of those has a set of angles for the various servos. Determine those angles by experiment.
Your gripper has two positions: Open and Closed. Those should be fairly obvious.
Open gripper.
Move to bottom of ramp.
Close gripper.
Move to top of ramp.
Open gripper.
Repeat.
Add delays as necessary.
Add additional intermediate positions if the motion hits anything.
Add loops and delays (like in the ServoSweep example) to make the motion smoother if desired.
johnwasser:
Your arm has two positions: Bottom of ramp and Top of ramp. Each of those has a set of angles for the various servos. Determine those angles by experiment.Your gripper has two positions: Open and Closed. Those should be fairly obvious.
Open gripper.
Move to bottom of ramp.
Close gripper.
Move to top of ramp.
Open gripper.
Repeat.Add delays as necessary.
Add additional intermediate positions if the motion hits anything.
Add loops and delays (like in the ServoSweep example) to make the motion smoother if desired.
Thank you for this feedback! I am aware of how to make this possible and I have found the angles and degrees to get the job done, but I do not know how to write the code for this. When I try and write a code, the servos start shaking and never does what I want it to.
Hi,
Welcome to the forum.
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
We need to see your code so we can advise you.
How are you powering the servos, each can draw up to 1A, you cannot use the 5V pin of the Arduino.
What mdel Arduino are you using?
Thanks.. Tom...
BrianKahl2017:
When I try and write a code, the servos start shaking and never does what I want it to.
The Arduino runs very quickly and can redirect the servos hundreds or even thousands of times per second. You will need to add delays to give your servos a chance to reach their destination.
Start with a very simple sketch controlling only one servo: Open gripper. Wait one second. Close gripper. Wait one second. If the gripper doesn't open and close properly then you have a wiring problem and you will have to fix that first.
If the gripper works properly, go back to the full arm motion but add a half second delay after every servo.write(). Does the arm follow the path you commanded? If not, more wiring problems! If it follows the desired path, reduce or eliminate the delays until it gets to the right place in good time.