Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: Flapping Servos? on: April 12, 2013, 03:13:58 pm
Totally my bad!  After trying out all the suggestions and they all taught me something even if they did not fix this, I fine combed my code and Lo and Behold, in the last group of commands to the feet I had accidently put in Knee as the name of the servos.  My servos were flapping because I was telling them to flap!  I fixed that and problem gone.  Thanks everybody who tried to help, I did learn some things from all the suggestions.
2  Using Arduino / Programming Questions / Re: Flapping Servos? on: April 08, 2013, 09:40:49 pm
OOOhhhh!  I better read more about the internals of the Arduino!  I see now how that can be a problem, thanks and I will change that.
3  Using Arduino / Programming Questions / Re: Flapping Servos? on: April 08, 2013, 07:33:38 pm
Isn't that what I am supposed to use?  There are analog pins on the shield but servos aren't analog devices and there are not enough of them anyway for 18 servos.  You have me at a loss as to what you are referring to?  Do you mean that I should use the Serial include statement?
4  Using Arduino / Programming Questions / Re: Flapping Servos? on: March 31, 2013, 11:53:13 pm
To answer PeterH's question the code I posted was my "bare bones" code.  Why?  Is there a way to make it smaller?  That would be nice!
5  Using Arduino / Programming Questions / Re: Flapping Servos? on: March 31, 2013, 11:50:26 pm
Thanks everybody!  I will try all of these suggestions and let you know what worked.
6  Using Arduino / Motors, Mechanics, and Power / Re: problem with supply on a hexapod robot on: March 29, 2013, 12:12:41 pm
You need to use a shield with the Arduino Uno for that many servo.  Get one that has a power terminal on it and supply the power directly to the shield.  You will still have to supply power to the Uno also.  Change your battery to a NiCD, Nimh or Lipo for the amperage you need,  dry cell batteries will not power that many servos.  I made a power connector for my bots which use many servo that powers both the shield and the Arduino. 
7  Using Arduino / Programming Questions / Flapping Servos? on: March 29, 2013, 11:56:52 am
I have a 6-legged 3 DOF spiderbot using an Arduino Mega with mega shield.  It is powered with a 3000mah Nimh battery.  It worked fine in the past but now has developed an unusual behavior and I am at a loss on how to fix it.  When I load a program in it the three "knee" servos on the right side flap up and down.  They move from center (90) to "down" which is (5).  They do this even if all I put in is the code to center all the servos.  I have tried switching out the Arduino Mega to another one, rewritten the code in case I had a hidden mistake, moved the servos to new new pins in case the sheild had a problem, replaced the shield with a new one, put in new freshly charged batteries including checking the battery with a voltmeter, removed all sensors from spider so just the legs are all that are on the spider, and pared down my code to the bare bones.
Has anybody incountered something like this?  I tried to research this on the internet before posting here.  I am including my code in this post for you to look at.  This code is just a standing stance for the spider.  It simply just stands there. 
Code:

#include <Servo.h>

Servo LFHip; 
Servo LFKnee;
Servo LFFoot;
Servo LMHip; 
Servo LMKnee;
Servo LMFoot;
Servo LRHip; 
Servo LRKnee;
Servo LRFoot;
Servo RFHip; 
Servo RFKnee;
Servo RFFoot;
Servo RMHip; 
Servo RMKnee;
Servo RMFoot;
Servo RRHip; 
Servo RRKnee;
Servo RRFoot;

void setup(){
  LFHip.attach(0); //set a pin for a servo/ESC to use
  LFKnee.attach(1); //set a pin for a servo/ESC to use
  LFFoot.attach(2); //set a pin for a servo/ESC to use
  LMHip.attach(4); //set a pin for a servo/ESC to use
  LMKnee.attach(5); //set a pin for a servo/ESC to use
  LMFoot.attach(6); //set a pin for a servo/ESC to use
  LRHip.attach(8); //set a pin for a servo/ESC to use
  LRKnee.attach(9); //set a pin for a servo/ESC to use
  LRFoot.attach(10); //set a pin for a servo/ESC to use
  RFHip.attach(37); //set a pin for a servo/ESC to use
  RFKnee.attach(36); //set a pin for a servo/ESC to use
  RFFoot.attach(35); //set a pin for a servo/ESC to use
  RMHip.attach(51); //set a pin for a servo/ESC to use
  RMKnee.attach(52); //set a pin for a servo/ESC to use
  RMFoot.attach(53); //set a pin for a servo/ESC to use
  RRHip.attach(46); //set a pin for a servo/ESC to use
  RRKnee.attach(47); //set a pin for a servo/ESC to use
  RRFoot.attach(48); //set a pin for a servo/ESC to use
}

void loop() {
   LFHip.write(85);
   LMHip.write(85);
   LRHip.write(95);
   RFHip.write(90);
   RMHip.write(90);
   RRHip.write(90);
   delay(500);
   LFKnee.write(180);
   LMKnee.write(170);
   LRKnee.write(180);
   RFKnee.write(5);
   RMKnee.write(5);
   RRKnee.write(5);
   delay(500);
   LFFoot.write(90);
   LMFoot.write(90);
   LRFoot.write(90);
   RFKnee.write(95);
   RMKnee.write(85);
   RRKnee.write(90);
   delay(500);
}


 
You can post here or contact me at carolhazlett@clearwire.net or facebook.com/CarolLynnHazlett
Thanks ahead for any help!
Pages: [1]