Shop OBEX P1 Docs P2 Docs Learn Events
servo resolution question . . . — Parallax Forums

servo resolution question . . .

Don PomplunDon Pomplun Posts: 116
edited 2011-08-28 10:02 in Propeller 1
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
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

  • Mike GreenMike Green Posts: 23,101
    edited 2011-08-24 20:18
    Servos are just not that precise and the precision varies from servo model to servo model and from manufacturer to manufacturer. The reason you don't see it in the specs is that the manufacturers don't control for that. Dynamixel servos are different. They're controlled very differently and they're much much more expensive than other servos. On the other hand, you can precisely control servo position, get active feedback on the position, adjust servo speed, etc.
  • W9GFOW9GFO Posts: 4,010
    edited 2011-08-24 21:22
    If you look at the Hitech servos at ServoCity they will list a dead band. The smaller the dead band the more accurately they can be controlled.
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-08-25 09:53
    maybe you find this supermodified servos interesting for that kind of application

    keep the questions coming
    best regards

    Stefan
  • RonPRonP Posts: 384
    edited 2011-08-25 10:42
    Don-

    Openservo is another interesting project.

    -Ron
  • Don PomplunDon Pomplun Posts: 116
    edited 2011-08-26 11:59
    Interesting servo enhancements! Didn't realize these were available. Now just need better projects ;=)
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2011-08-28 10:02
    As Mike says, the hobby servos are just not that sensitive. From what I have observed, there is about a +/- 3 uS tolerance for the error correction circuit within the servo before "it" thinks it needs to engage the motor to correct the error. Essentially if you think of the servo as having an internal oscillator that's frequency is determined by the POT connected to the servo horn. The signal that you provide ( a 1 ms to 2ms pulse) translates to a second frequency within the servo. If the two frequencies are within a certain percentage, then there is no adjustment to the motor. However if there is to much error or different in the two signals, the servo tries to adjust my moving the motor in a direction that lessens the amount of detected error. Some servos apply dynamic drive strength, (the more the error the faster the servo motor turns) while others are simply on or off. This "window" creates a hysteresis that keeps the servo from constantly hunting for a location.
Sign In or Register to comment.