IMPORTANT SHIPPING DEADLINE INFORMATION - New Year's Eve and New Year's day - please read before placing your order!

servo motor not opeating
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

servo motor not opeating

by commander_rice on Tue Jan 29, 2013 6:23 pm

I purchased the servo motor/cobbler kit for Lesson 8, installed Occ v0.2 on the Pi, soldered & wired the set-up on the breadboard. The python program appears to run without error and writes outputs to the files (active 1, delayed immediate (?), mode [servo], etc), but the servo motor doesn't move. The voltage is 6V, so it looks OK. The red lead is +6V, brown is grd, orange is connected to pin 18, and the grd on the cobbler is jumped to battery grd as shown in the picture. The servo motor output shaft is rigid and cannot be advanced by hand, so this seems strange. Is it possible the servo is bad? How can I troubleshoot the set-up?
commander_rice
 
Posts: 4
Joined: Wed Jan 16, 2013 9:32 am

Re: servo motor not opeating

by adafruit_support_bill on Tue Jan 29, 2013 6:42 pm

The servo shaft is frozen even when not powered?
User avatar
adafruit_support_bill
 
Posts: 32806
Joined: Sat Feb 07, 2009 10:11 am

Re: servo motor not opeating

by commander_rice on Tue Jan 29, 2013 9:12 pm

After checking again, I find the shaft rotates 180 degrees to a stop; it can be rotated back 180 degrees to a firm stop. It takes considerable torque... more than I think 1.5v batteries will apply. If this is normal, I will set the shaft at mid-point between extents and try again. Should the shaft have only 180 degrees of rotation? That sems odd.
commander_rice
 
Posts: 4
Joined: Wed Jan 16, 2013 9:32 am

Re: servo motor not opeating

by adafruit_support_bill on Wed Jan 30, 2013 7:25 am

A standard servo is designed so that it can be precisely positioned over a range of 0-180 degrees. The resistance is due to the reduction gearing between the motor and the output shaft. https://www.adafruit.com/products/155

There are also "Continuous Rotation Servos" that operate more like a speed-controlled gear reduction motor.
https://www.adafruit.com/products/154
User avatar
adafruit_support_bill
 
Posts: 32806
Joined: Sat Feb 07, 2009 10:11 am

Re: servo motor not opeating

by commander_rice on Wed Jan 30, 2013 1:40 pm

The servo properties appear OK. Maybe I misunderstand the program. Does it make the motor advace from limit to limit (180 degrees?)? How does "setServo" work? Where is "angle" set? Perhaps angle=0, but should be set to a positive number. Is it in degrees or radians? Is there a way to test pin 18 output? Thanks for your help.
commander_rice
 
Posts: 4
Joined: Wed Jan 16, 2013 9:32 am

Re: servo motor not opeating

by adafruit_support_bill on Wed Jan 30, 2013 5:22 pm

This code should set the servo to 90 degrees:
Code: Select all | TOGGLE FULL SIZE
   setServo(90)

This code should sweep the servo over an angle of 0 to 180 degrees:
Code: Select all | TOGGLE FULL SIZE
for angle in range(0, 180):
   setServo(angle)
   time.sleep(delay_period)
User avatar
adafruit_support_bill
 
Posts: 32806
Joined: Sat Feb 07, 2009 10:11 am

Re: servo motor not opeating

by commander_rice on Thu Jan 31, 2013 9:29 am

Thanks, it is operating now. I realised that angle is an index counter for the loop, so I changed the time to 2. sec and printed angle to the screen as it looped. I was certain that the program was working because angle incresed every two seconds, so I looked for wiring errors. I found the 6V was not getting to the motor at the breadboard. Once fixed, it worked. Thanks again.
commander_rice
 
Posts: 4
Joined: Wed Jan 16, 2013 9:32 am

Re: servo motor not opeating

by pberg on Sun Mar 24, 2013 1:05 pm

I too got a cobbler kit and my servo does not move. I have it wired up just like the tutorial 8 diagram. I put a print statement in one of the loops and have confirmed that the python program is writing integers from 0 - 179. I have confirmed with the tail -f servo command that the servo file at /sys/class/rpi-pwm/pwm0/servo is getting these values written to it. I have tried a continuous rotation servo too and it always rotates in one direction when hooked up, even without the python program running. My servos both have Blk, Red, Wht wires on then and I assume Blk is ground, red is 6V and wht is control. I have confirmed 6V is present on the blk & red connection to the servos. Does anyone have any advice? Thanks.
pberg
 
Posts: 13
Joined: Mon Feb 20, 2012 6:37 pm

Re: servo motor not opeating

by adafruit_support_bill on Sun Mar 24, 2013 1:15 pm

I have tried a continuous rotation servo too and it always rotates in one direction when hooked up

That would indicate that there is a control signal. Does the standard servo resist movement by hand when hooked up?
User avatar
adafruit_support_bill
 
Posts: 32806
Joined: Sat Feb 07, 2009 10:11 am

Re: servo motor not opeating

by pberg on Sun Mar 24, 2013 7:16 pm

It does turn with a stiff resistance when the program is running. It is the same resistance when the program is not running. It seems the same either way. I have the control wire on pin 18 of the GPIO, is that correct and where in the python program does it call out pin 18? I don't understand how it works I guess. Since the continuous rotation servo spins whether the python program is running or not I don't think the control signal is changing when the program runs. How could I check?
pberg
 
Posts: 13
Joined: Mon Feb 20, 2012 6:37 pm

Re: servo motor not opeating

by adafruit_support_bill on Sun Mar 24, 2013 8:07 pm

It does turn with a stiff resistance when the program is running. It is the same resistance when the program is not running.

Is it the same resistance as when it is not powered at all?
User avatar
adafruit_support_bill
 
Posts: 32806
Joined: Sat Feb 07, 2009 10:11 am

Re: servo motor not opeating

by pberg on Mon Mar 25, 2013 7:24 am

Is it the same resistance as when it is not powered at all?


It is close to the same resistance, powered or unpowered. Its hard to tell. It could be harder to start turning when it is plugged in but once moving it seems about the same.
pberg
 
Posts: 13
Joined: Mon Feb 20, 2012 6:37 pm

Re: servo motor not opeating

by adafruit_support_bill on Mon Mar 25, 2013 8:04 am

Sounds like no control signal then. If there were one, the servo would actively resist movement and seek back to the original position if moved.

Does the servo controller show up in i2cdetect on the Pi? Which version of the Pi do you have? Earlier versions used i2c bus #0. Current versions use i2c bus #1.
User avatar
adafruit_support_bill
 
Posts: 32806
Joined: Sat Feb 07, 2009 10:11 am

Re: servo motor not opeating

by pberg on Mon Mar 25, 2013 6:00 pm

Does the servo controller show up in i2cdetect on the Pi? Which version of the Pi do you have? Earlier versions used i2c bus #0. Current versions use i2c bus #1.


How would I tell?
Do I type i2cdetect into terminal with the servo connected and the python program not running?
I've had the Pi a couple of months.

I did try the servo with an arduino and the sweep sketch and it did go back and forth as expected.
I appreciate your help. :)
pberg
 
Posts: 13
Joined: Mon Feb 20, 2012 6:37 pm

Re: servo motor not opeating

by adafruit_support_bill on Mon Mar 25, 2013 8:21 pm

This tutorial explains how to configure the Pi for i2c: http://learn.adafruit.com/adafruit-16-c ... pi-for-i2c
User avatar
adafruit_support_bill
 
Posts: 32806
Joined: Sat Feb 07, 2009 10:11 am