Shop OBEX P1 Docs P2 Docs Learn Events
need help with TowerPro MG995 servo — Parallax Forums

need help with TowerPro MG995 servo

thangngocthangngoc Posts: 23
edited 2010-01-23 06:16 in BASIC Stamp
The towerPro MG995 servos can only rotate -90 to +90.
I know the center for the TowerPro MG995 servos is 1500. Is the TowerPro MG995 servos programmable like the continuous rotation servo using Basic Stamp. If so how can I center TowerPro MG995 the servo using basic stamp v2 code? Thanks

Post Edited (thangngoc) : 1/20/2010 8:07:49 PM GMT

Comments

  • kf4ixmkf4ixm Posts: 529
    edited 2010-01-20 20:04
    on the bs2 stamp you would do this
    PULSOUT 12, 750 ' output of pulse on pin 12

    750 is the pulses it would send out on pin 12, the bs2 stamp operates at 2us, so 750 * 2=1500
  • thangngocthangngoc Posts: 23
    edited 2010-01-20 20:21
    unlike the continuous rotation servo, I simple use this code PULSOUT 12, 750 and adjust the potentiometer in the servo to center it. But the TowerPro MG995 doen't have the potentiometer. What should I do? When I try the following code
    DO
    PULSOUT 12 , 1500
    PAUSE 20
    LOOP

    The arm of the servo rotated 180 degree then stop.
  • kf4ixmkf4ixm Posts: 529
    edited 2010-01-20 20:38
    1500 may be too much for the servo, try 1400 1000·or even 1300 900·and see what happens, may be the feedback pot in the servo going bad... 1500 on the bs2·translate to·the servo·to go fully right and there may be some slop in the feedback pot or a bad place in the feedback pot.

    Sorry for the misinformation, was being distracted. i have found 1100 to 1300 will max some servos while 1400 to 1500 is fine. this is something you will just have to play with and see where your servo max's out at

    Post Edited (kf4ixm) : 1/21/2010 2:14:55 PM GMT
  • FranklinFranklin Posts: 4,747
    edited 2010-01-21 01:46
    Did you try:
    PULSOUT 12, 750 ' output of pulse on pin 12
    with your servo hooked to pin 12?
    If not go back and do that. Most servos that don't rotate all the way around are centered mechanically by removing the horn and setting it where you want it when you are sending the servo code for 'center'

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • W9GFOW9GFO Posts: 4,010
    edited 2010-01-21 03:21
    thangngoc said...
    unlike the continuous rotation servo, I simple use this code PULSOUT 12, 750 and adjust the potentiometer in the servo to center it. But the TowerPro MG995 doen't have the potentiometer. What should I do? When I try the following code
    DO
    PULSOUT 12 , 1500
    PAUSE 20
    LOOP

    The arm of the servo rotated 180 degree then stop.

    All a servo does is try to seek a position based upon the width of the pulse that it receives.

    PULSOUT 12, 1500 is equivalent to a 3.000mS pulse width. That is likely too much. For general operation you want to use pulse widths that range from 1.000ms to 2.000mS.

    If you need more movement out of the servo you can go outside that range but you must experiment to find the limits. The extents of a standard servo's range of travel are mechanically limited, if you use a pulse width that the servo can't reach it will be stalled while it pushes against that mechanical limit.

    To center your servo, send a pulse width of 1.500mS (PULSOUT 12, 750). There is no adjustment to make. If you need the servo horn to point a different direction, remove it and reinstall in the desired position. Like Franklin said.

    Remember each increment of PULSOUT is .002mS.

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Simple Servo Tester, a kit from Gadget Gangster.

    Post Edited (W9GFO) : 1/21/2010 3:26:34 AM GMT
  • thangngocthangngoc Posts: 23
    edited 2010-01-21 18:08
    thanks W9GFO. The servo was center when I tried PULSOUT 12, 750 and this is what I wanted. I tried PULSOUT 12, 1500 and it went beyond the limit of traveling range as you said. Thanks you guys
  • thangngocthangngoc Posts: 23
    edited 2010-01-22 21:01
    I tried this code below to initialize the position of the horn of the servo. It did stop as the position where I wanted, but the motor seemed still running inside ( I could hear by the sound inside), perhaps it still took a lot of current. How can I avoid that?

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    DEBUG "Program Running!",CR
    
    counter    VAR    Word
    
    Setup:                   ' Initial position of the servo
    
    FOR counter = 1 TO 10
      PULSOUT 12, 750
      PAUSE 20
    NEXT
    
    
  • W9GFOW9GFO Posts: 4,010
    edited 2010-01-23 06:16
    thangngoc said...
    I tried this code below to initialize the position of the horn of the servo. It did stop as the position where I wanted, but the motor seemed still running inside ( I could hear by the sound inside), perhaps it still took a lot of current. How can I avoid that?

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    DEBUG "Program Running!",CR
    
    counter    VAR    Word
    
    Setup:                   ' Initial position of the servo
    
    FOR counter = 1 TO 10
      PULSOUT 12, 750
      PAUSE 20
    NEXT
    
    


    You are only sending the pulses to the servo for 1/5th of a second. 10 times through that FOR..NEXT loop only takes about 200mS. If you increase to (counter = 1 to 100), the servo will get pulses for about two full seconds.

    According to what I have read about the TowerPro MG995, the pots are low quality and it exhibits significant overshoot. That may contribute to it being noisy when it's not supposed to be moving.

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Simple Servo Tester, a kit from Gadget Gangster.
Sign In or Register to comment.