Servo controller

7 views
Skip to first unread message

Sebastien Lelong

unread,
Oct 10, 2009, 3:32:08 PM10/10/09
to jal...@googlegroups.com, jal...@googlegroups.com
Hi guys,

I'm still thinking about a nice servo controller made in jallib (at least 8 channels I'd say). Goal would be to provide a Jaluino shield too. While we already discussed about implementing PWM in software, this can give problems of accuracy. What about using a dedicated chip, like TLC5940 ?

http://focus.ti.com/docs/prod/folders/print/tlc5940.html

It's used to control LEDs, but it seems it can be used to control servos too (in some arduino references).

Don't you think it would speed up development of such controller ?


Cheers,
Seb
--
Sébastien Lelong
http://www.sirloon.net
http://sirbot.org

Joep Suijs

unread,
Oct 10, 2009, 4:33:15 PM10/10/09
to jal...@googlegroups.com
 
adding hardware feels like a surrender ;)
 
I think it should be feasable to create accurate timing with an isr by reprogramming the timer for each servo if there are no other interrupts.
And since i2c slave is the most usefull interface, we should adapt the i2c slave lib to work without interrupts.
 
Joep
 

 
2009/10/10 Sebastien Lelong <sebastie...@gmail.com>

William

unread,
Oct 10, 2009, 7:45:44 PM10/10/09
to jallib
Sounds like a great project!

But if you are gonna have two chips ( JAL chip + PWM chip), why not
just use two JAL chips? I've used the 3 channel 16F777 in the past,
and a quick scan of microchip shows some 5 channel devices available
for 16F and 18F.

William


On Oct 10, 2:32 pm, Sebastien Lelong <sebastien.lel...@gmail.com>
wrote:

Sebastien Lelong

unread,
Oct 11, 2009, 4:49:47 AM10/11/09
to jal...@googlegroups.com
Hi,

Using microchip chip to provide hardware PWM channels would cost a lot more than having a dedicated chip, don't you think ? That's really annoy me: there are so few PWM channels in PIC compared to Atmel...

I was thinking to use a PIC as controller of the whole board: commands would be sent to it, then it would throw them to dedicated PWM chip. It could add i2c interface, could store parameters for each servos, store sequence of commands, maybe with an extra EEPROM. Would it still sound like a surrender ? ;)


Cheers,
Seb

Sebastien Lelong

unread,
Oct 11, 2009, 5:28:21 AM10/11/09
to jal...@googlegroups.com
Hi again,


 
adding hardware feels like a surrender ;)

But sometime the right tool can save you lots of headache...
 
 
I think it should be feasable to create accurate timing with an isr by reprogramming the timer for each servo if there are no other interrupts.
And since i2c slave is the most usefull interface, we should adapt the i2c slave lib to work without interrupts.
 

TLC5940 can also be chained, we could provide a "simple" 16 PWM controller, and a "fat" 32 PWM controller, etc... It requires minimal external part (1 resistor if I'm reading ok). And as I said, i2c + programmable sequence + per-servo configuration doesn't look like a surrender :)

There are also things using 74HC595 shift register. One hardware PWM channel could sequentially drive 8 PWM output from this chip.


Cheers,
Seb

http://www.instructables.com/id/The_Dawm/
 
Joep
 

 
2009/10/10 Sebastien Lelong <sebastie...@gmail.com>

Hi guys,

I'm still thinking about a nice servo controller made in jallib (at least 8 channels I'd say). Goal would be to provide a Jaluino shield too. While we already discussed about implementing PWM in software, this can give problems of accuracy. What about using a dedicated chip, like TLC5940 ?

http://focus.ti.com/docs/prod/folders/print/tlc5940.html

It's used to control LEDs, but it seems it can be used to control servos too (in some arduino references).

Don't you think it would speed up development of such controller ?


Cheers,
Seb
--
Sébastien Lelong
http://www.sirloon.net
http://sirbot.org



Joep Suijs

unread,
Oct 11, 2009, 5:39:59 AM10/11/09
to jal...@googlegroups.com
Hi Seb,

2009/10/11 Sebastien Lelong sebastie...@gmail.com
 
> > I was thinking to use a PIC as controller of the whole board: commands would be sent to it, then it
> > would throw them to dedicated PWM chip. It could add i2c interface, could store parameters for each
> > servos, store sequence of commands, maybe with an extra EEPROM.
> > adding hardware feels like a surrender ;)
> But sometime the right tool can save you lots of headache...
 
Great specs! And maybe 'surrrender' is a too big word and definitely not intended personally, but adding hardware for things that could be handled in software is not the best way to go for non-prototypes. But you are right: it saves headache (fun, challenges, time)..
 
This product http://www.robotshop.us/pob-technology-pob-servo.html seems to be discontinued, but has an 16f877a that runs 20 servos. So it can be done...
 
For interrupts at regular intervals, I normally use timer1 and reload it in the isr. But experiments with fast interrupts learned me that it is better to use timer2, since a delay in handling the isr does not influence the time the next interrupt occurs.
And running a small interrupt routine (checking some counters, setting some io pins) at 80 kHz takes about 50% of the pic processing power, leaving 50% for housekeeping and comms. So maybe a 'base architecture' of 100 kHz to actually create the pulse (from 0 tot 255 * 10us = 2,55 ms) and all other code without interrupt could do the job.
 
But having said this... I thought the single pin display interface would be a usefull project too and afaik, it is not used by anyone else (and I could not use it in my latest project due to a 'name space conflict' for serial_software).
 
Joep

2009/10/11 Sebastien Lelong <sebastie...@gmail.com>

William

unread,
Oct 11, 2009, 5:59:21 AM10/11/09
to jallib
Greetings,

Like I said before, it sounds like a neat project.

Using the external chip is fine, go for it!

But it does look like you could get picmicro's with 5 channels of
hardware PWM for about $1.90 US, and your TI chip costs about the same
for 8 channels.

William


On Oct 11, 3:49 am, Sebastien Lelong <sebastien.lel...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages