Hi Matt,

You are right, a servo lib is long overdue. The thing is, that its not
so simple to create a lib that properly supports a servo without
putting severe limits on you application.
The most critical issue is stability of the pulse. Even one interrupt
during the delay will move the servo (slightly). And applications that
use serial or i2c can't afford to disable interrupt for 2.5 ms.
What could reduce the chance of a disturbance is to use a timer for
the pulse. This way only a interrupt at the end of the pulse will give
a disturbance, not any interrupt.

If I look at your code, the use_timer version is useful and it could
be improved if the actual pulse is also timer-based. And multiple
servos could be supported (up to 20ms / 2.5ms = 8 servos).
The non-timer version is not very useful IMO. It blocks the cpu for
20ms and must be called (almost) immediately after it returns.

I once saw a system that used a 10us interrupt to create servo pulse
timing. This is a heavy load (if feasible) for a pic. A more complex
but better solution would be to set a timer to the desired value for
each pulse and have it generate an interrupt. Maybe this gives a
smooth pulse with other interrupts and otherwise it gives a base to
work around this: most (all?) interrupt libs will work with the
specific IE flag false, if you poll the appropriate ISR continuously.

Joep


2010/1/21 mattschinkel <[email protected]>:
> I have seen that many people on jallist are looking for servo control
> and have started a lib. Please have a look.
>
> Currently only supports one servo, but it should be easy to add many.
>
> Thanks,
> Matt.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/jallib?hl=en.
>
>
>
>
-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.


Reply via email to