Shop OBEX P1 Docs P2 Docs Learn Events
Futaba S148 not responding as expected. — Parallax Forums

Futaba S148 not responding as expected.

NitrohawkNitrohawk Posts: 17
edited 2006-01-30 15:36 in BASIC Stamp
Everywhere I look, people are modifying servos and getting them to spin in one direction and then another direction depending on the pulse.

I must be doing something VERY wrong becuase I can only get mine to spin clockways.

Here is the simple code I am running for testing:

Servo_pin CON 14 'I/O pin that is connected to servo
temp VAR Word 'Work space for FOR NEXT

 
start:
DEBUG "start 200 - 1200", CR
FOR temp = 200 TO 1200
  PULSOUT Servo_pin,temp
  PAUSE 50
NEXT
 
PAUSE 2000
 
DEBUG "start 1200 - 200", CR
FOR temp = 1200 TO 200
  PULSOUT Servo_pin,temp
  PAUSE 50
NEXT
 
END


If this snip look familure its because its straight out of the Standard Servo PDF. I have even attempted to widen the range up to 2000 and down to 1.

As for modifying the servo, I have done two things. Keep in mind this is a Futaba FP-S148 servo.

First I just took out·the little plastic clip out that turned the pot and manualy adjusted it to center... I still could not get the servo to go counter clockwise. (based on the code above).

Second, I took the pot out of the picture and added two resistors (2.2k each). I kept the center leg of the pot and replaced the outside legs with the resistors. Tried the above code again... and still had no luck.

Any one have ideas?

I have searched... and found that most of what is suggested I have attempted in one form or another... but by all means, point out my wrong doings. smile.gif


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
0011010000110010

Nitrohawk
956 x 863 - 126K

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-30 06:14
    You don't say which version of the BASIC Stamp you're using so I'll assume it's a stock BS2.· In order to get the "standard" servo control pulse of 1.0 ms to 2.0 ms you would do something like this:

    Setup:
    · LOW Servo

    Main:
    · FOR pos = 500 TO 1000 STEP 10
    ··· FOR idx = 1 TO 3
    ····· PULSOUT Servo, pos
    ····· PAUSE 20
    ··· NEXT
    · NEXT
    · GOTO Main

    Note the timing and refresh values -- I'm not sure where you got your numbers but they don't make sense to me.· You need to refresh the servo about 50 times per second, that equates to a 20 ms delay between pulses.· I hope this helps you get back on track.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-01-30 11:32
    One of the obscure oddities of servos is that you can get them to spin by a low battery reset going through the microprocessor. Since this is a special case, they do it in only one direction [noparse][[/noparse]I suspect the pulse is either too short or too long].

    Since reseting over and over causes a series of pulses, you get rotation.

    That would explain yours behavior.

    Alternatively, you may have shorted out something and created a low power condition in that manner. It would also explain why changes in software code apparently have no effect on the behavior.

    I had a low battery and both my servos on another manufacture's wheeled bot started to spin in the same direction. The result is tight circles and nothing else.

    Removing the tab and using two resistors to make a symetrical voltage divider are right.· Personally, I prefer to keep the pot, but disengage its linkage.· Then I can actually adjust the value to 'center' to what I want.·

    It is also possible that one of your resistors is shorted and creating an asymetrical response, but I am not sure how software would responsd.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 1/30/2006 11:39:37 AM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-01-30 14:22
    "One of the obscure oddities of servos is that you can get them to spin by a low battery reset going through the microprocessor. Since this is a special case, they do it in only one direction [noparse][[/noparse]I suspect the pulse is either too short or too long]."

    True, but very confusing and misleading. "you can get them to spin by <Causing an INADVERTENT> low battery < condition which will > reset the microprocessor."

    And you can easily see if this is happening if you put a "DEBUG [noparse][[/noparse]"I have reset.", 13]" message at the start of your code.

    Otherwise, you MUST adjust code for the type of processor, as the PULSOUT values are different.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-01-30 15:12
    Allan,

    ·· Must be a matter of context.· I took Kramer to mean that if you were experiencing a brownout condition you might inadvertantly generate a pulse causing the servo to go only one way, since it was restarting.· =|

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • NitrohawkNitrohawk Posts: 17
    edited 2006-01-30 15:13
    Just to clear some of the confusion...


    The chip I am using is the BS2.

    The snip of code I used came from this document:
    http://www.parallax.com/dl/docs/prod/motors/stdservo.pdf

    I am also sure the battery pack (4 AA's) is fully charged using my DMM.

    Just to make sure im not going batty, the stripes on the resistor is Red, Red, Red, Gold. That, if I am not mistaken is 2.2k ohms, right?

    Jon, Thanks for the suggested code. I will be sure to check that out this evening.

    Setup:
      LOW Servo
    
    Main:
      FOR pos = 500 TO 1000 STEP 10
        FOR idx = 1 TO 3
          PULSOUT Servo, pos
          PAUSE 20
        NEXT
      NEXT
      GOTO Main
    
    



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    0011010000110010

    Nitrohawk
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-30 15:32
    I will check with the writer of that document -- the PAUSE 50 is clearly a typo. The servo values can vary servo-to-servo, but the numbers I gave you create pulses for the standard 1.0 to 2.0 pulse output when using a BS2.

    A 2.2k resistor would be Red-Red-Red. Red-Red-Yellow would be 220k.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • NitrohawkNitrohawk Posts: 17
    edited 2006-01-30 15:36
    Okay... Good to hear about the color combo. I got it right!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    0011010000110010

    Nitrohawk
Sign In or Register to comment.