Page 1 of 1

Help controlling Futaba S3003 servo using RPi

Posted: Sat Dec 08, 2012 8:08 am
by Robo
I'm fine with software programming, but new to electronics.

I'm trying to control the Futaba S3003 servo in my RC car using RPi. The spec is here:

http://www.futaba-rc.com/servos/analog.html
http://www.servocity.com/html/s3003_servo_standard.html

I connected 4x 1.5V AA batteries in series to power the servo. The servo made a little jitter then does nothing which is what I expect, then this is where it gets weird.

As soon as I connect the servo's control wire to the Pi, the servo steers the wheels of the RC car full lock to the left. This is before I start my servo software. I used a multi meter to confirm the GPIO pin wasn't sending any voltage, I even connected the control wire to pin 6 of the Pi (GND) and it does the same thing.

I start the servo software which does a softServoWrite(1, 1500), and it doesn't make any difference. The servo continues to steer the wheels full lock to the left.

So, as far as I can tell, the Pi is sending zero voltage to the control wire, so why is it causing the servo to move? As soon as I disconnect the control wire, the servo stops moving.

Re: Help controlling Futaba S3003 servo using RPi

Posted: Sat Dec 08, 2012 10:27 am
by joan
I'd double check that the gpio you are using is actually connected to the PI pin header you are using. There are several conflicting numbering schemes.

I'd guess that electrical noise and a floating control pin is forcing the servo to an end stop.

Re: Help controlling Futaba S3003 servo using RPi

Posted: Sat Dec 08, 2012 10:31 am
by Robo
I've tried hooking an LED to the GPIO pin. When I run the servo program it lights up, when I quit the LED turns off, so it's definitely the correct pin.

I've done the same with multimeter, turn servo program on, multimeter gets a voltage reading, turn program off, multimeter says zero. But when I link that pin to the servo, even with program not running, the servo moves all the way to one side.

Re: Help controlling Futaba S3003 servo using RPi

Posted: Sat Dec 08, 2012 10:36 am
by joan
Does the LED vary in intensity according to the pulse width?

If you send a 500 microsecond pulse it should only be on for 0.5 ms every 20 ms. A 2000 microsecond pulse should be noticeably brighter.

Re: Help controlling Futaba S3003 servo using RPi

Posted: Fri Dec 14, 2012 11:35 am
by clicky
If I understand servos correctly you need to send pulse of 1ms to 2ms to define servo angle.

1ms should be fully left and 2ms fully right. 1.5ms (or more precisely 1520µs) should be middle.

Also, be careful not to send pulses faster than 50 times a second (20ms). Some servos can't handle them (and servo you have chosen is definitively one of them) and could easily overheat and get damaged.

Anyway - if your servo is going to one side soon you connect gpio connector it might be that:

- servo is not working properly (servo's pot is somehow disconnected)
- or pulse you are sending is too short (try experimenting with other values)

Reading what you put in (1500) it should make proper sense - but, what if that method is actually accepting values in µs from 0 to 1000 (adding another 1000µs to it internally)? That would mean you are sending pulses of 2500µs and that might cause servo going to one direction. Try with 500 and 2000. If I am right 500 would lock it in the middle while 2000 would do exactly the same as 1500 is doing... Experiment! :)