servo resolution question . . .
Don Pomplun
Posts: 116
I'm playing with standard R/C servos (1-2ms input pulse width). The following code starts it in the neutral position, and each button push bumps the input pulse up or down by a usec. It ends up taking a few pushes to have the servo move. Seems that, although I've got 1000 ua steps from 1 to 2, the resolution of the servo is less. Looking at various servo specs, I don't see that stated anywhere. Since I'm using it to move a laser pointer over tens of feet, I'd like to get as tight a delta as possible. The units I'm using are a couple Futaba S3003's and a Thunder S-15. Any insight?
TIA
Don
TIA
Don
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 VAR long servoStack[50] long servoDwell OBJ ser : "fullduplexserial" PUB startups | debounce ser.start(-1, 25, 0, 9600) servoDwell := 1500 ' microseconds cognew( servo, @servoStack ) dira[18]~ ' button dira[22]~ ' button repeat debounce~ if ina[18] ' CCW servoDwell += 1 servoDwell #>= 950 ser.tx( 12 ) ser.dec( servoDwell ) repeat if not ina[18] debounce++ else debounce~ until debounce => 1000 debounce~ if ina[22] ' CW servoDwell -= 1 servoDwell <#= 1950 ser.tx( 12 ) ser.dec( servoDwell ) repeat if not ina[22] debounce++ else debounce~ until debounce => 1000 '############################################################################################# '############################################################################################# '############################################################################################# PRI servo dira[23]~~ ' LED dira[15]~~ ' servo control repeat outa[15]~~ outa[23]~~ waitcnt( cnt + clkfreq / 1_000_000 * servoDwell ) outa[15]~ outa[23]~ waitcnt( cnt + clkfreq / 1_000 * 10 ) ' ms
Comments
keep the questions coming
best regards
Stefan
Openservo is another interesting project.
-Ron