servo moves on reset

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

servo moves on reset

Postby tge1986 » Mon Jul 21, 2008 9:15 pm

I have a servo attached to my arduino and it rests at 178 degrees and then moves to 145 the problem I’m having is that when I power up the board or hit the reset button the servo tries to go to 0 degrees. Is there a way to stop this from happening? I noticed on the motor shield on the adafruit site it says something about a "Pull down resistors keep motors disabled during power-up" could I do this and would it stop my issue, and if so then how would I implement something like this?
tge1986
 
Posts: 28
Joined: Mon Jul 21, 2008 9:09 pm

Postby franklin97355 » Mon Jul 21, 2008 9:22 pm

Are you using the motor shield and what code are you using to drive the servos? do you initialize a value for the servo position before you output values to the servo.
User avatar
franklin97355
 
Posts: 1706
Joined: Mon Apr 21, 2008 1:33 pm

Postby tge1986 » Mon Jul 21, 2008 9:42 pm

I am not using the arduino motor shield. I'm using the servotimer.h that I downloaded from the site. Here is the code I am using right now its super simple right now it's just proof of concept.
Code: Select all
#include <ServoTimer1.h>

ServoTimer1 servo1;

void setup() {
  servo1.attach(10);
}


void loop() {
  servo1.write(178);
  delay(1000);
  servo1.write(145);
  delay(1000);
 
}


When I push the reset button the servo quickly tries to go to 0. Should I enter a value in the setup function?
tge1986
 
Posts: 28
Joined: Mon Jul 21, 2008 9:09 pm

Postby mtbf0 » Tue Jul 22, 2008 7:34 am

tge1986 wrote:When I push the reset button the servo quickly tries to go to 0. Should I enter a value in the setup function?


alas, that's what servos do when you power them up.

the pull downs you refer to appear to be for the motor driver chips and are unrelated to the servos.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1642
Joined: Fri Nov 09, 2007 11:59 pm
Location: oakland ca

Postby adafruit » Tue Jul 22, 2008 7:53 am

hmm, id say make sure there's a pulldown on the servo pin in case its trying to go 'high'
i dont recal that servos try to go to loc 0 but i dont know which servo brand you're using
User avatar
adafruit
 
Posts: 10491
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Postby X-Ray Satellite » Sun Aug 03, 2008 10:06 am

Is it a hardware or software issue ?

With no program in your device ( blank memory ) does the servo still attempt to move when you power up ? If yes, then there is a hardware issue and ladyada's suggestion about pullup/pulldown resistors to hold logic state inputs to avoid the effects of logic state transistions during the power up (or down) moments is what to do. Adding such resistors anyways is a good idea for servo command and enable control lines.

If it did not move, then it may be your program. Whether it is the program causing the unintentional movements or not, have some delay timer at the beginning of your program (like 10 seconds) to allow all of the hardware to power up and settle down.

Depending on your design intention, then the program or user can initiate a 'homing' sequence and operation.
X-Ray Satellite
 
Posts: 3
Joined: Thu Jul 31, 2008 9:08 am

Postby jmilk » Fri Aug 08, 2008 11:40 pm

Why don't you just turn the servo 145 degrees, and move it in the range from 0 - 33 degrees... :D
jmilk
 
Posts: 11
Joined: Sat Jun 14, 2008 3:21 pm


Return to Arduino

Who is online

Users browsing this forum: No registered users and 8 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [103]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[109]
 
Wireless[14]
Cables[61]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]