View Full Version : servo controller

02-18-2008, 10:29 PM
guys....I want to make a hexapod. I am using 18 servos...the same way tht lynxmotion site sez. I want to give the control signals to all the servo motors using a 8051. Will that be totally fine? Can I proceed with just an 8051? I dont want to spoil the servos as they are really costly. I get this doubt because i see lynxmotion hexapods using a special microcontroller called basicatom and a servo controller SSC32. I tried to find some info about using servo controllers for servo motors but there is hardly any. The first question that comes to mind is "why use a servo controller when the servo motor already has a servo control circuit inside it". I know I am wrong as it is obvious that i wouldnt be seeing them being used by lynxmotion if i were right. Correct me guys

02-18-2008, 10:49 PM
Is the servo controller only used to control the robot using a serial port device such as a joystick??does it have any other purpose??

02-19-2008, 02:42 AM
Forget 8051, get an AVR or PIC controller. The SSC-32 controller you mentioned also uses an AVR ATMega168. It will be very cumbersome to control more than a few servos with a single 8051, leaving you with little resources for any other work.

The Basicatom thing is probably a glorified BASIC Interpreter squeezed into a high end AVR/PIC/ARM microcontroller. You won't be needing that to control servos.

Servos get damanged only when you exceed their specifications like over voltage or excessive mechanical load etc. If you are too worried then test your code with the help of a oscilloscope or you can use interactive smulation tools like Proteus

02-19-2008, 10:18 AM
with 18 servos, it will be fun writing the code.


Not easy, dear, you can expect a lot of jitter in your servos. The algorithm becomes more important. It is not easy to generate 18 PWM signals at 18 different pins with minimum CPU overhead.

Assuming a 20ms gap (the refresh rate), you can place ten-2ms pulses between two 20 ms pulses. Not more than that. So you WILL have to use the interrupt and the timers efficiently.

And you might go crazy, when the servos go haywire when you connect 18 of them together. You might need a VERY powerful battery, not in terms of voltage, but in terms of amperage. Add loads of bypass capacitors.

I would recommend using a separate servo controller for any application using an 8 bit, <20MHz controller controlling more than 8 servos. Not because its impossible, because sometimes keeping the software complexity to the minimum pays off. And if i have the money, i would always buy the off the shelf servo controller. After all, it is a wonderful sight to see a hexapod crawl, without a jitter.

02-19-2008, 10:38 AM
how about using a preemptive scheduler (RTOS, I mean to say)? The context switches and the process priorities can take care of the complexity, also the jitter can be calculated beforehand....just a thought, not tht I have tried something like this before.....I thought this one wud be a gud application to appreciate the use of an RTOS....

02-19-2008, 11:56 AM
but wouldnt RTOS be an overkill?

RTOS can generate great CPU overheads, for these 8 bit controllers.

02-20-2008, 08:29 AM
@me_supreme/allbits: Nothing to it, efficient use of the timer should suffice. An RTOS, as allbits said, is overkill for such a simple task. A few counters and a timer tick interrupt should be sufficient. A single timer may produce jitters on 18 servos, with a x51, so you could use more then one timer. If you use a AT89C51RE2, you will get 3 timers, also, since it runs at 60 MHz, it will produce clean jitter free pulses.



02-21-2008, 09:19 AM
thnx for the replies allbits, saurabhg, kishore2k4 and debu. Helped me a lot :D . Just one more doubt. I saw this question being posted before , but the answer wasnt strong enough. Can i give the control signal directly from the 8051??? or do i need to use some extra circuitry for current amplification? I tried giving the control signal directly from 8051 to the vegakit motors. They got spoilt..i dunno for wat reason. As docel said, they might as well have been spoilt already("piece of junk"..hehe). Now i bought Hitec motors. I wanna take all the precautions necessary before i test them. cos they costed me a fortune

02-21-2008, 05:14 PM
@me_supreme: Nothing to worry about. Interfacing servos is as simple as interfacing resistors. :lol: :lol: :lol:

Just connect the pulse wire (Normally Yellow) to your uC pin. The red wire to 4.5-6V, and the black wire to your uC ground.