View Single Post
  #22   Spotlight this post!  
Unread 02-05-2008, 00:10
yongkimleng yongkimleng is offline
deus ex programmeur
AKA: James Yong
FTC #0747
Team Role: Mentor
 
Join Date: Aug 2006
Rookie Year: 2004
Location: Singapore, West
Posts: 134
yongkimleng is a jewel in the roughyongkimleng is a jewel in the roughyongkimleng is a jewel in the rough
Send a message via MSN to yongkimleng
Re: Need help with PWM 1-2ms pulse control

If you're driving a victor from this, I don't think you need to worry about deadband. The victor has quite abit of deadband around the 127 region.

As for a servo.. well it may jitter around (not so sure).

You may want to print out the values to screen to see how much its jittering at. Maybe add a small (0.1uf? 1nF?) capacitor from signal to ground for the analog input. That usually helps when my analog cable is non-shielded and very long...

Edit:
apologies for using bit shifting, so I shall add a bit to explain what it is

>> is essentially known as 'bit shifting'.

Skipping the complicated details, it is simply:
a >> 1 same as a / 2
a >> 2 same as a / 4
a >> 3 same as a / 8
a >> 4 same as a / 16
The difference is that a bit shift operation takes significantly lesser processing time compared to a divide (unless compiler optimized).

Similarly, a << 1 same as a * 2
a << 2 same as a * 4
and so on.
__________________
| jamesyong.net |
FVC2007, FTC2008

Last edited by yongkimleng : 02-05-2008 at 00:25.