Needing servo help!

I'm really hoping someone can help us. I am trying to help my 10 year old build a robot. He is using a basic stamp kit and three servos. He rigged the servos to turn 360 degrees.

Now we have hit a wall. The servos seem to only go one direction! He is using a light sensor and push sensors and wants his robot to go forward until it hits something or senses light, and then he wants to program it to go backwards. Can anybody offer help or suggestions? I think we are using Futabo S3001 inderect drive servos. Is there a way to make them go both directions?

 

Thanks for any help!!

Marcia

Sounds like a programming

Sounds like a programming issue.

Need to see code (just the part that control the servo, absolutely only that part)

need more info

When you say he "rigged the servos", do you mean he opened the servos and modified the internal gears ?

When you say "turn 360 degrees", do you mean the servos continuously turn? There are some servo hacks that simply allow the servo to turn "more" than normal but not continuously.

There are several links on this site for modifying a servo for continous rotation. Did you use a variable resistor or fixed resistors in place of the feedback potentiometer in the servo ?

Did you remove the drive electronics all together ? If not, you need to drive the servos with a pulse from 1 millisecond to 2 milliseconds in length. The pulse needs to happen every 20 milliseconds of so.

With more info, it will be easier to understand the problem your having.

reply to RascalRobot - 1-

reply to RascalRobot -

1- Yes

2- Yes, continuously

3- Neither because we can’t get the servo case open. (we’re going to try to desolder the motor in the servo tonight to get inside to the potentiometer if that’s what will fix the problem)

4- We haven’t removed the drive electronics. He is doing 1-2 milliseconds every 20 milliseconds.

 

TIA

** reply to fritsl- (basic**

reply to fritsl- (basic stamp language - with basic stamp editor)

 

SERVOFORWARD3:

FOR COUNTER = 1 TO 150

PULSOUT 15, 2000

PAUSE 10

NEXT

 

SERVOBACKWARD3:

FOR COUNTER = 1 TO 150

PULSOUT 15, 2000

PAUSE 10

NEXT

 

SERVORIGHT3:

FOR COUNTER = 1 TO 150

PULSOUT 14, 500

PAUSE 20

NEXT

 

SERVOLEFT3:

FOR COUNTER = 1 TO 150

PULSOUT 14, 1000

PAUSE 20

NEXT

 

SERVOCENTER3:

FOR COUNTER = 1 TO 150

PULSOUT 15, 750

PAUSE 20

NEXT

 

END

Erh… that’s a little hard

Erh… that’s a little hard te figure out; What parts are working, what are not?

If you want the SERVOFORWARD3 and SERVOBACKWARD3 to be any different, then they should be… different :slight_smile: (THey are the same)

From a distance and without much of the info I need (Like comments on the code, what you’d expect it to do and what it does, as I cannot see that) - it looks to me as if you have “rigged the servos” wrong; Centering / stopping the servo should be something like PULSOUT 15, 1500 - if that makes it turn in one direction, the resistor / potmeter is not centering as the hack should make it do. Fix would be to make sure the servo stops at 1500 - and then higher values would make it go one way, lower the other…

My 10 year old’s answer

My 10 year old’s answer (because I know nothing about this stuff) -

The servo is turning counter clockwise but not clockwise.

The reason the servoforward3 and servobackward3 are the same is because I need to know what numbers to put. (the basic stamp kit programming book doesn’t tell this as far as he can tell).

 

SERVOFORWARD3: (makes robot go forward)

FOR COUNTER = 1 TO 150

PULSOUT 15, 2000 (15 after pulsout references the pin number.)

PAUSE 10

NEXT

 

What other part of the program would be helpful to see? It is about two pages long.

When we hacked the servo we only took out the mechanical stopper but we did not put the resistors in. Tonight we are going to open it and put the resistors in. We will then change the numbers and hopefully that will fix the problem. Is there anything else we should know?

Thank you!!! We really appreciate your help :slight_smile:

 

I think you need to read

I think you need to read info on how to hack the servo; You may not have put the potmeter in the center, and I believe that is the whole problem.

This page might help: https://www.robotshop.com/letsmakerobots/node/5086 (Read the theory, and make sure your potmeter is "at center")

The PULSOUT command varies

The PULSOUT command varies depending on the Basic Stamp being used. In the manual it shows :

PULSOUT Pin, Duration

as proper syntax. Since the command is directed to pin 15, I’ll assume you are not using a BS1, since the Stamp 1 has no pin 15. For a Basic Stamp 2 the duration is in 2 microsecond increments. So that the command :

PULSOUT 15, 2000

Would cause a 4 millisecond (2000 x 2 us) pulse to occur every 10 milliseconds (PAUSE command duration is 1 millisecond for all Stamps) from your code for SERVOFORWARD3 and SERVOBACKWARD3. Note also that each pulse and delay above is repeated 150 times (the FOR counter), making it 2.1 seconds before any other command can be sent to the servo. Servos will only turn one direction for a 4 millisecond pulse. The other subroutines of SERVORIGHT3, SERVOLEFT3, and SERVOCENTER3 all appear to be valid servo driving pullses with seperation if the Basic Stamp 2 is being used. Other Basic Stamps like the BS2e, BS2sx, and BS2px have a different duration timing. (As does the BS1).

If the above is sent to a BS2 to run, I’d expect the servo connected to pin 15 to turn hard one direction for a period of 4.2 seconds, then stop for 3 seconds (SERVOFORWARD3, SERVOBACKWARD3, both with wrong timing, and SERVOCENTER3 are the only commands addressing pin 15). If there is a servo on pin 14, then I’d be expecting it to turn one direciotn for 3 seconds then turn back for 3 seconds (SERVORIGHT3 and SERVOLEFT3 addressing pin 14).

There is still the likelyhood that the servo has not been completely modified as needed, so that needs to be addressed as well as correcting the code.