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 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:
http://autopilot.cvs.sourceforge.net/viewvc/autopilot/onboard/rev2/servo.c?revision=1.4&view=markup
--
Trammell
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.
-spec
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 received this message because you are subscribed to the Google Groups "NYCResistor:Microcontrollers" group.
To post to this group, send email to nycresistormi...@googlegroups.com.
To unsubscribe from this group, send email to nycresistormicrocon...@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.
-spec
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 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?
Moto
There are high-end robot servos that do exactly that. HiTec makes a
few "Robot Servos":
http://www.servocity.com/html/hsr-8498hb_hmi_robot_servo.html
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.
--
Trammell
I did smth. like this a few years ago, but didn't finish it.
I believe this is the latest version of my code:
https://whatever.metalab.at/projects/MarbleMadness/Arduino/ServoMatrixInterrupt/ServoMatrixInterrupt.pde
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.
-Marius