Let's Make Robots!

Driving servos

Here ( http://letsmakerobots.com/node/80 ) Frits had mentioned that either Arduino or PICAXE can control such and such number of servos. I'm pretty new to microcontroller world, so maybe my question will sounds a bit stupid... but I don't really get what we mean by saying "can only control X servos"? Does it actually mean, "platform X can have up to N serial outputs"? Because, AFAIK that's what servos are, aren't they?

Now, I can understand that PICAXE has also limitations due to the built-in Basic interpreter; but why Arduino?

Maybe I'm just misinterpreting the concept of how the servos work though...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
thanks, do you think thw chip would need a 2nd power source? 2 servos and 2, 3volt motors.?

Maybe... If you need all three servos to move at once and at their top speed/torque... yes. If speed/torque etc isn't important then no. If you fire your servos at once (Steppenwolf reference somewhat intended) then they may fight for current and not operate as quickly as they would on another power source.

Try them all on the same power source as the processor and then move to P2 if needed.

yea i was thinking the same thing, but figured it out and it easy to add 2nd power source.
Documentation says so, but I hav enever had any problems with only one power source.
tryed it and it seems to work well, need to figure out how to work my robot by heart cause it is are TPE project ( french school thing ), bits of code are eady to learn but putting them together to make the robot work is the hard part. thanks for all your help ! 
I was wondering , how do i connect a 2nd or even 3rd servo to the picaxe 28X1 ? and would anybody know how to programe each servo ? I whant to add a simple arm to my robot with an electromagnet at the end of it so it will be able to pick up cans.
The man who smiles when things go wrong has thought of someone to blame it on. - Robert Bloch

You put them on a different output pin and call them as such:

servo 0, 100

servo 1, 100

servo 2, 100

This would make servos on output pin 0, 1 and 2 and move to position 100.

Make sure you are using the right type of servo.  There are analog servos and there are digital servos.  Technically all servos use a digital pulse input to know where to position the arm/wheel, but on a digital servo it also has an internal micro controller that determines the desired position and sends its own pulses at a much faster rate to the motor.  This is just supposition, but that internal microcontroller might make the digital servos less forgiving on the accuracy of the pulses sent to it.  Also, with the increased pwm rate between the microcontroller and motor the digital servos pull more power so check to be sure you're not putting too much of a load on your power supply.

check the pin layout like anachro mentioned....aside from that, it could be a bad servo.....

I've run 5 different types of servoes form an 08m(as well as an 18x and 14m) without issue. the only thing I've noticed is that the throw is slightly different from one to the other when I was testing them.

You could through a cap in the mix as well(connected between the + and - ) to smooth some of the jitter or use a seperate power source. Using a 470uf cap  worked for me.

According to the data for that servo, you should be able to drive it with normal 5V pulses.  Are you running your PICAXE from 5Volts?  If you are, then it's possible that there's a mix-up with either which pin you're driving, or the pin setup, or the software that's generating the servo pulses.  If you have an oscilloscope, check for pluses of about 1-2ms width, every 20ms or so.  If you haven't, then the first thing to do is to make sure that the pin you've chosen is set up as an output (and not as an input).  Then, how about a little diagnostic test with an LED?  If you slow down your pulse generation code by a factor of, say, 100 then you should see 100-200ms pulses every 2 seconds, which is slow enough to check with an LED/resistor.

But you don't say how you're generating the pulses -- your own pulse-timing code?  Or a PICAXE library routine?  Or something else?