View Full Version : 16 servo controller

06-21-2010, 03:01 PM
i want to make a 16 servo controller and a pc based software.
what kind of hardware and software should i use ??
for the pc software i can do with VB.
i dont know what kind of hardware should i use the cost must be the cheapest.
what is the maximum number of servos that can be controlled with common mcu like atmega 8,32,128 etc.

06-21-2010, 08:29 PM
You will need one pin, if needed two pins, on the MCU for a simple serial communication with the PC.

For the servo controlling itself you will need another 16 output pins. So any MCU with a minimum 16 I/O pins and an inbuilt USART communication will suffice for your project.

If cost is a major factor, I would recommend going a 8051 microcontroller for your project. Atmega8 is currently selling at around Rs 130 - 165 while a AT89S52 at around Rs 30 - Rs60.

How do you wish to communicate with the computer? Serial or USB?
By my reckoning, you will spend more on the hardware for communication than on the MCU for controlling servos.

06-21-2010, 08:49 PM
i have atmega32 and atmega8 development boards with usb and serial communication.
my question is how many servos can i control i need atleast 8 servos to run on timers.
if it is not possible in above microcontrollers then in which mcu can i do it

06-22-2010, 12:09 PM
It depends on how much precision you require on those servos running from timers.

An McU with 2/3 timers, and 16 GPIO pins is sufficient for servo driving if the software is done properly and the clock is about 20MHz.
The software in this case will be heavily interrupt driven, and will have to be optimized such that there are no time wasting tasks.
Algorithm: On each timer tick interrupt, check the PWM variables vs maintained/incremented variables and toggle the gpio pin if the incremented counter matches.
Of course this is the cheapest solution.

If you are looking for precision of dedicated timers then here are some McUs-
Atmel - ATmega1281, AT90PWMxxx
Renesas- R5F71250AD50FA

06-22-2010, 01:16 PM
--> A very good knowledge and work experience with timers. Or else, everything will jitter.
--> If you do not plan to do anything more than servo controlling, you can go for a normal 28 pin chip for controlling 16 servos.
--> Run a servo motor with a 555/556. Understand jitter. Understand how the motor behaves. If possible, use a scope.

This step may seem to be unnecessary - But a very good way to understand how servos work.

Controlling a set of servos (say, 16) with own-made software and hardware is not easy for a beginner. Start with controlling one servo - without interrupts.
Once you have done that, add the number of servos. You cannot use in built PWM channels of lower end PICs ( I dont know about AVRs) as the PWM frequencies do not match, and duty cycle variations are only over 2ms.

Of course, if you just want to get the thing done, I think the codes are available on the net.
But if you need to wirte a good code with no jitter and faster responce, you need to know much more on theri behaviour - ( more than 1ms = 0, 1.5ms = 90, 2ms = 180)

--> And last, i hope I dont see this product in your web page- ready to sell !!

06-22-2010, 01:27 PM
ok thanks for the explanation.

Can anyone give me the exact avr model no.
It is ok for me if it can 8 serovs

06-22-2010, 01:33 PM
there is nothing like 'exact model no'

If you have a micro with 8 free IO lines and executes at least one timer cycle in 1 us, you can use it to control 8 servos. The performance will be fairly decent.
in fact, most of the controllers in the market with pin count >14 can meet your requirement.

06-22-2010, 01:47 PM
is it possible to hold its position on gpio.
only on timer out puts it is possible to hold its position.
i have atmega 8 and 32 how many can i control on it with timers.
i know atmega32 has 3 timers

06-22-2010, 06:03 PM
DO this first:

make a square wave of 25% duty cycle with a frequency of 50Hz using whatever controller you have.
Doing this will solve your doubts. Dont jump directly to 16 servo controlling.

12-23-2012, 10:38 PM
It is best to use Arduino board. The hardware part will be tension less. You can control as many 14 to 20 servo. One thing you have to keep in mind is powering the servos separately and not from the main board.

03-13-2013, 05:36 PM
Hi guys,

I want to build a robot with all facilities..It should be handled by remote and can anyone guide me in building the robot?? Thanks..

03-13-2013, 05:41 PM
I want to build a robot with all facilities..
What do you mean by that ?

06-17-2013, 01:21 PM
Well , Controlling max servos depends on your algorithm and hardware. Also since these algos are interrupt driven u need to have a good clock speed of >20-25Mhz or your resolution will be less. In 2010 I had made a 48ch servo controller using lpc2148 for my hexapod and then reduced it to 32 coz 48 was just an overkill xD. Atm I have ported it to lpc1768 and works great with my hexapod. In late 2010 I had got an idea about an algo which could control more servos with lesser timers but then it would consume too much CPU , since it included sorting , hence never implemented it coz all the IK calculations , communication and servo controlling was done using single chip i.e lpc1768 and could not afford to waste CPU cycles in just servo controlling.

11-09-2015, 05:28 PM
Hi guys
I like your comment MR Anir. Here i bought a servo motor from Robomart. that i used for teeth cleaner this is my personnel experience with robomart.
know more about this product: https://www.robomart.com/servo-motors