I am interested in learning some basics in robotics for making small scale robots. My first challenge here is to find out how to run as many servos as possible from an arduino or pololu controllers, in case I have money to build hexapods or humanoids in future. All small factor controllers seem to be limited in number of motors that can control (2-12 servos), unless I use arduino mega (48 servos).
I have used daisy chained shift registers to control 32 LEDs using PWM from a regular Arduino. As far as I understand, servos use PWM but within a certain range of frequency. Can shift registers or LED PWM drivers be used for servos, or are there any specific ICs??
> [...] Can shift registers or LED > PWM drivers be used for servos, or are there any specific ICs??
You can use a 4017 decade counter to drive up to 10 servos per 16-bit PWM output. Here's some code I wrote a few years ago to drive 20 servos from a Mega163:
On Apr 14, 2011 6:28 PM, "Moto" <ra...@mac.com> wrote:
> Hello,
> I am interested in learning some basics in robotics for making small scale
robots. My first challenge here is to find out how to run as many servos as possible from an arduino or pololu controllers, in case I have money to build hexapods or humanoids in future. All small factor controllers seem to be limited in number of motors that can control (2-12 servos), unless I use arduino mega (48 servos).
> I have used daisy chained shift registers to control 32 LEDs using PWM
from a regular Arduino. As far as I understand, servos use PWM but within a certain range of frequency. Can shift registers or LED PWM drivers be used for servos, or are there any specific ICs??
Software PWM should be easier than driving LEDs because the duty cycle it's much lower for servos. The shift-register may work as long as theres no glitch during updates. You could also conceivably use a pwm led driver. Just a matter of getting the pwm clock right and pulling the open collector outputs high through a resistor.
> Software PWM should be easier than driving LEDs because the duty cycle it's much lower for servos. The shift-register may work as long as theres no glitch during updates.
I don't think a shift register will work here since each servo needs a different pulse width. It isn't pwm, it only cares about the time the signal is high.
>> Software PWM should be easier than driving LEDs because the duty cycle it's much lower for servos. The shift-register may work as long as theres no glitch during updates.
> I don't think a shift register will work here since each servo needs a different pulse width. It isn't pwm, it only cares about the time the signal is high.
> -- Trammell > -- > You received this message because you are subscribed to the Google Groups "NYCResistor:Microcontrollers" group. > To post to this group, send email to nycresistormicrocontrollers@googlegroups.com. > To unsubscribe from this group, send email to nycresistormicrocontrollers+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/nycresistormicrocontrollers?hl=en.
On Apr 14, 2011 7:23 PM, "Trammell Hudson" <hud...@osresearch.net> wrote:
> Ah, I see how you could do it with a shift register, but you need two
pins. One for data and one to clock it into the register.
Right. You have to update the word for each count in the pwm cycle.
Also of interest is the open servo project. Servo electronics are replaced with a microcontroller based driver and take position commands via a serial bus.
> > Ah, I see how you could do it with a shift register, but you need two pins. One for data and one to clock it into the register.
> Right. You have to update the word for each count in the pwm cycle.
> Also of interest is the open servo project. Servo electronics are replaced with a microcontroller based driver and take position commands via a serial bus.
> -spec
> -- > You received this message because you are subscribed to the Google Groups "NYCResistor:Microcontrollers" group. > To post to this group, send email to nycresistormicrocontrollers@googlegroups.com. > To unsubscribe from this group, send email to nycresistormicrocontrollers+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/nycresistormicrocontrollers?hl=en.
It is easy to control up to 10 servos because each servo needs a 2 ms window for control and 20 ms between control pulses. You can do more but the software requires more effort. After you run out of pins you need a bigger uc or something like shift registers. Shift registers add to the timing problems. Using a thru hole pic processor you can build a board with maybe 20 - 30 output pins for less than 20 bucks.
Hardware pwm does not do a good job for servos in most cases because there is not enough resolution in the 1 to 2 ms ( 5 to 10 % duty cycle ) control window.
> I am interested in learning some basics in robotics for making small > scale robots. My first challenge here is to find out how to run as > many servos as possible from an arduino or pololu controllers, in case > I have money to build hexapods or humanoids in future. All small > factor controllers seem to be limited in number of motors that can > control (2-12 servos), unless I use arduino mega (48 servos).
> I have used daisy chained shift registers to control 32 LEDs using PWM > from a regular Arduino. As far as I understand, servos use PWM but > within a certain range of frequency. Can shift registers or LED PWM > drivers be used for servos, or are there any specific ICs??
Thanks a lot for all your insights. I'd try using TLC5940 PWM driver first. I also found out about openservo board which has it's own AVR controller and can be controlled with I2C. Looks interesting, but it's rather costly.
On a separate note, servos have potentiometer to detect it's own angle of rotation, right? I am wondering if that can be used to "teach" the robot movements by moving servo joints by hand. I don't think existing three wires can be used for that purpose, but adding extra connections to the pot or the board maybe possible? Does anyone have an experience on something like that?
> It is easy to control up to 10 servos because each servo needs a 2 > ms window for control and 20 ms between control pulses. You can do > more but the software requires more effort. After you run out of > pins you need a bigger uc or something like shift registers. Shift > registers add to the timing problems. Using a thru hole pic > processor you can build a board with maybe 20 - 30 output pins for > less than 20 bucks.
> Hardware pwm does not do a good job for servos in most cases because > there is not enough resolution in the 1 to 2 ms ( 5 to 10 % duty > cycle ) control window.
> russ
> On 4/14/2011 6:28 PM, Moto wrote: >> Hello,
>> I am interested in learning some basics in robotics for making >> small scale robots. My first challenge here is to find out how to >> run as many servos as possible from an arduino or pololu >> controllers, in case I have money to build hexapods or humanoids in >> future. All small factor controllers seem to be limited in number >> of motors that can control (2-12 servos), unless I use arduino mega >> (48 servos).
>> I have used daisy chained shift registers to control 32 LEDs using >> PWM from a regular Arduino. As far as I understand, servos use PWM >> but within a certain range of frequency. Can shift registers or >> LED PWM drivers be used for servos, or are there any specific ICs??
>> Thanks in advance. >> Moto
> -- > You received this message because you are subscribed to the Google > Groups "NYCResistor:Microcontrollers" group. > To post to this group, send email to nycresistormicrocontrollers@googlegroups.com > . > To unsubscribe from this group, send email to nycresistormicrocontrollers+unsubscribe@googlegroups.com > . > For more options, visit this group at http://groups.google.com/group/nycresistormicrocontrollers?hl=en > .
> On a separate note, servos have potentiometer to detect it's own > angle of rotation, right? I am wondering if that can be used to > "teach" the robot movements by moving servo joints by hand.
There are high-end robot servos that do exactly that. HiTec makes a few "Robot Servos":
You can disable the normal servo PWM and switch them to a multi-drop bus protocol that allows a single daisy chain to control 128 servos via a command protocol. One of the commands is a torque-limiting mode that allows you to move the servos by hand and have it report the position data. This is great for building humanoid robots where you want to sequence poses.
The other nice thing about the robot servos is that they have idler pulleys on the backside so that it is easy to build joints out of them.
> I don't > think existing three wires can be used for that purpose, but adding > extra connections to the pot or the board maybe possible?
That is doable to an extent as well. I've made some "four-wire" servos using that technique, but the data is quite poor and there is no way to disable the motor drive for normal servos. So it is only useful for sort of telling if the servos are doing what they have been commanded to do.
It should, in theory, be able to control 128 servos from an Arduino and 16 shifting registers. I only tested it with 32 servos, AFAIR. Due to heavy interrupt usage, you might not have a whole lot of CPU time left though.