Go Down

Topic: Servo Control (Read 1 time) previous topic - next topic

cubiclegnome

Oct 15, 2010, 06:34 am Last Edit: Oct 15, 2010, 06:35 am by cubiclegnome Reason: 1
I've read somewhat conflicting posts and I'm curious to know how well the duemilanove or uno can control servos.  I'm looking to move 2-3 small servos (hs-55) smoothly and slowly without jitter.  Is this possible and fairly easily accomplished with the Arduino, or would I be better suited with something like a Pololu Maestro?

Ohm

Yeah that shouldn't be a problem with the Arduino, you may be better off with something like a roboduino as the pin outs make the servos much easier to work with.

Can't say I've used that other product you've mentionefd

Korman

#2
Oct 15, 2010, 02:45 pm Last Edit: Oct 15, 2010, 02:46 pm by Korman Reason: 1
Cubiclegnome,

what Ohm posted above is correct, 2 or 3 servos are no problem, even hooking up 12 don't increase the jitter. The reason for this is, that the Servo library controls the servos sequentially just like old style rc-receiver.

However you have to be careful, the jitter is produced by interrupt functions taking too long to run. The clock update for millis() and the Serial receivers are rather harmless, the add in the worst case 1 or 2 µs to the PWM signal, which is 0.1 or 0.2 % of the movement rate. Most servos I've seen can't keep a postion with that precision anyway and are far worse.

Korman

cubiclegnome

Thanks for the quick replies.  Other than the Roboduino and a few shields, are there any other duinos that have built in servo headers?

vinceherman

I used a prototyping shield to make my own.


That sits on a Mega and lets me run 18 servos.

retrolefty

Keep in mind that while an Arduino can CONTROL many servos, most people have problems trying to reliably power more then one directly from a Arduino board. External regulated +5vdc is a better way to power servos. I budget one amp current capacity per servo for the external power supply and have never had a problem.

cubiclegnome

I haven't delved into any of the actual programming for the Arduino yet.  How difficult is it to simultaneously move multiple servos, compared to moving one at a time?  

zoomkat

Quote
I haven't delved into any of the actual programming for the Arduino yet.


Why not? Have you tried the servo sweep program? If you are serious about your project, you should start trying some actual coding. Otherwise this is turning into another game of "20 questions".
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

cubiclegnome

Zoomkat,

Assuming I had unlimited amounts of free time and money, I might consider learning to program something I haven't even decided to buy yet.  Unfortunately I dont.  So, I'd like to be sure the device does what I would like it to do before spending the cash and devoting the time.

For those that are offended by questions,  my apologies.

zoomkat

Quote
Assuming I had unlimited amounts of free time and money, I might consider learning to program something I haven't even decided to buy yet.  Unfortunately I dont.  So, I'd like to be sure the device does what I would like it to do before spending the cash and devoting the time.


Just wanted to confirm you are playing "20 questions".  ;)  
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

fkeel

Its no trouble really. There are lots of code samples available which you can just use and then slowly modify so that they suit your liking.

I got myself a mega and a sensor shield, and I am extremely happy with my input/output options --> most of the time I dont even need a breadbord, as I can just directly plug everything in.

check out this link if you dont  know what I'm talking about
http://www.emartee.com/product/41953/Arduino-Sensor-Shield-V5.0
(the regular version. you can get it for arduino mega as well... asuming you want to control loooots of servos :-D )
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

Korman

#11
Oct 15, 2010, 10:02 pm Last Edit: Oct 15, 2010, 10:03 pm by Korman Reason: 1
Cubiclegnome,

you also should consider, that you (and everyone else for the matter) only gets a limited attention span. To put it bluntly, people are only willing to spend so much time helping you. If your requests are more interesting or entertaining, you will get more time by more people, if one comes across as an illiterate dolt, less time will be spent.

Now if  you waste the attention you can get with boring questions or things that can be figured out easily by typing related words into Google, you will get less once you really run into serious problems and need advice. I'm not saying that your first question didn't have some merits, but it's a good idea to consider helpful answers from the internet as a resource to use wisely.

At least that's how I work and it seems I'm not the only one.

Drive carefully, 90% of the people are caused by accidents.

Korman

vinceherman

Quote
How difficult is it to simultaneously move multiple servos, compared to moving one at a time?


Controlling multiple servos at the same time is not difficult.

For my hexapod, I break the total movement into small slices of time.  I calculate where I want the servos to be at that point in time, then wait.  When the time rolls around, I tell all the servos to move to the calculated positions.
Then I start over.  Calculate where I want the servos to be at the next time point.  Wait for that time.  Tell the servos to move.

Kind of like the servo sweep tutorial, where is uses the delay between each iteration of the loop.  But instead of a delay, I have the main loop do nothing until the millis tell me that the next time point has arrived.

That, and a little bit of array work to deal with the multiple servos easily, and you are off to the races.


retrolefty

Quote
So, I'd like to be sure the device does what I would like it to do before spending the cash and devoting the time.


One problem is your question is a little too broad and not focused. There is virtually nothing a Arduino can't do with servos, however an Arduino as shipped does absolutely nothing other then possibly blink pin 13 LED. So not knowing your skill level in C programming or your patience in learning to program, it's really hard for any of us to tell you if the Arduino is the best solution for you needs.

Lefty

Go Up