go away spammer

Author Topic: Using a 556 to control servos  (Read 3232 times)

0 Members and 1 Guest are viewing this topic.

Offline JakePTopic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Using a 556 to control servos
« on: June 03, 2008, 09:01:48 PM »
The project I'm working on has an ATMega8 doing many tasks at once. It has two drive two servos, read data from an accelerometer, do some math, read from some other sensors (e.g. thermistors) write the data to memory and do some logic stuff. I was thinking of exporting the control of the servos to a 556 timer (double 555 timer) per servo. The output from the atmega8 would have to either vary resistance or capacitance... so I was thinking of using a digital potentiometer.. would that work alright?
I was mostly thinking of doing this just for the sexy factor, but now that I think about it, it might be a silly thing to do. I'm not quite clear on how long the low part of the pulse can be... I'm doing a bunch of other stuff on the chip, but not *ALOT*... maybe it would be ok?

Does manually doing the pulse on the main IC for multiple servos along with doing other stuff still work?

Don't know how well this is worded... it is late...

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: Using a 556 to control servos
« Reply #1 on: June 04, 2008, 12:58:22 AM »
I don't think you will get as good of signal using an analog system as a digital PWM system. We've found this out at work and we use digital much more than analog because timers on micros are much more accurate than the a2d's or any d2a we come up with ( R/2R resistor networks and what not...)

I'm working on an interrupt driven servo package that would allow about 10 servos per output compare register on a 16 bit timer. It's fairly specialized but I am basing it off of the avrlib servo code. But right now I'm having trouble getting my init to set up all the I/O registers correctly (my code not the library code  :-\ ). YMMV.
« Last Edit: June 04, 2008, 01:03:54 AM by JesseWelling »

Offline ALZ

  • Full Member
  • ***
  • Posts: 75
  • Helpful? 1
Re: Using a 556 to control servos
« Reply #2 on: June 04, 2008, 01:51:14 AM »
It's not hard to answer your own question. You only have to update the servos every 20 ms. Can you do everything (bunch of other stuff ) you want to do on the atmega8 in 20 ms. ?

For the money you would spend on  a 556 timer and a digital potentiometer you could buy a PIC which could do alot more than run 2 servos. 

Offline bens

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 335
  • Helpful? 3
Re: Using a 556 to control servos
« Reply #3 on: June 04, 2008, 02:11:15 AM »
You can use timer1's two PWM outputs to generate the servo pulses entirely in hardware, thereby freeing up your CPU to execute the rest of your program.  What speed is your mega8 running at?

- Ben

 


Get Your Ad Here