Servos, Motor Drivers and Outside Control Systems

Here are the links:
Board - http://arduino.cc/en/Main/arduinoBoardDuemilanove
Motor Drivers (5 Total) - SyRen 10A regenerative motor driver - analog, R/C, and serial motor control
Servos (2) - Traxxas 2056 Servo Specifications and Reviews
Controller - http://www.logitech.com/en-us/gaming/controllers/devices/7360

Not really sure how or in what format to create or present schematics for it. Right now nothing is hooked up to the board but in the past with the servo I've had it in the exact same setup as that specified here : arduino.cc/it/Tutorial/Sweep and then connected through the usb port.

The only code I've used for the servo is the Sweep sample program with modified servo range and port values in attempts to get it to work.

The servo is being powered directly from the board as shown in the link above.

The servo is being powered directly from the board as shown in the link above.

Can you supply the servo from four AA batteries ( don't forget to connect the grounds together), and post your code.

I tired supplying it with the four batteries and uploading the program but nothing happened. Here is the code :

// Sweep
// by BARRAGAN <http://barraganstudio.com> 
// This example code is in the public domain.


#include <Servo.h> 
 
Servo myservo;  // create servo object to control a servo 
                // a maximum of eight servo objects can be created 
 
int pos = 0;    // variable to store the servo position 
 
void setup() 
{ 
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
} 
 
 
void loop() 
{ 
  for(pos = 0; pos < 45; pos += 1)  // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
  for(pos = 45; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees 
  {                                
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
}

What about trying zoomkat's servo test code?

I am still not getting any movement from the servo. I have checked all the batteries, all my wires, and all my connections as well. Is there anything else I can do?

mac55:
I am still not getting any movement from the servo. I have checked all the batteries, all my wires, and all my connections as well. Is there anything else I can do?

A common mistake is to forget to connect the grounds together as AWOL noted. The battery negative, servo ground and arduino ground must all be connected. If they are and that doesn't help, try another pin to control the servo. If you still get no joy, go back to run blink, to make sure the duemillanove is still working.

Still nothing more than a twitch on upload and blink still runs just fine. I've tried at least 3 ports and have it hooked up to a regulated power supply set to 6 volts. I've even tried another servo. Is there anything that I could possibly be doing wrong?

Sounds like a power issue still. Take a look at this thread: http://arduino.cc/forum/index.php/topic,78052.0.html. There's a ludicrously huge picture I took of a single servo wired to external power & Arduino. Maybe comparing it to your setup will shed some light on it. How many amps is your supply rated for?

Simple servo test code you can try with the serial monitor.

// zoomkat 10-22-11 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// for IDE 0022 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h> 
Servo myservo;  // create servo object to control a servo 

void setup() {
  Serial.begin(9600);
  myservo.writeMicroseconds(1500); //set initial servo position if desired
  myservo.attach(7);  //the pin for the servo control 
  Serial.println("servo-test-22-dual-input"); // so I can keep track of what is loaded
}

void loop() {
  while (Serial.available()) {
    char c = Serial.read();  //gets one byte from serial buffer
    readString += c; //makes the string readString
    delay(2);  //slow looping to allow buffer to fill with next character
  }

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured string 
    int n = readString.toInt();  //convert readString into a number

    // auto select appropriate value, copied from someone elses code.
    if(n >= 500)
    {
      Serial.print("writing Microseconds: ");
      Serial.println(n);
      myservo.writeMicroseconds(n);
    }
    else
    {   
      Serial.print("writing Angle: ");
      Serial.println(n);
      myservo.write(n);
    }

    readString=""; //empty for next input
  } 
}

Big picture of arduino/servo/battery wiring.

One more thought: have you fallen foul of the notorious "My breadboard has two separate ground lines?" I recall a thread where someone was using such a breadboard and had assumed (actually hadn't even considered it - who would?) that any hole on the bottom line would do for ground. This became true when he connected the two segments together.

Simple servo test code you can try with the serial monitor.

I already tried this earlier today and got no response from the servo or anything displaying in the monitor.

One more thought: have you fallen foul of the notorious "My breadboard has two separate ground lines?"

Big picture of arduino/servo/battery wiring.

Sounds like a power issue still.

I already ran connection tests through everything. It's all connected right and all my wires are good. And my power supply is rated to 15 amps.

So not really sure where this leaves me in terms of what I'm even going to be able to get to work. I still get the initial twitches on upload but then nothing afterwards. I have already tried two servos which is all I currently have a available. I can try different types in another week but until then I'm stuck trying to get the Traxxas 2056 ones I have now to work.

One thing that might be worth noting, or might not, is that the servos I am using are only 600.

And also for zoomkat's code, I am getting the error:

sketch_apr02a:12: error: 'class Servo' has no member named 'writeMicroseconds'

when I try to verify or upload despite it uploading without errors earlier today.

And also for zoomkat's code, I am getting the error:
when I try to verify or upload despite it uploading without errors earlier today.

I copied the code I posted, pasted it into the 1.0 IDE and uploaded it to my arduino. The standard servo I have connected to pin 7 with an external power supply worked as expected. Your servos seem to be somewhat specialized digital servos, but I would think they would operate as a standard servo. You probably need to sort out the compiling error and recheck your wiring.

Your servos seem to be somewhat specialized digital servos,

The link said "analog".

At this point, I'd be reaching for my scope probes, and putting a print in "setup()" at least, just to see I'm not getting repeated resets.

MOVEMENT!! I went with an analog output and just uploaded the fade program and put the data pin into the pin where the light would normally go and now it is working. Exact control is going to be a little hard this way but I should be able to make it work. Thanks to everyone for helping with the servo issue. While I was doing that I also found out how to work the motor drivers. The only things now is some sort of real time control with a keyboard or game controller. Anyone have any ideas or suggestions for that?

I went with an analog output and just uploaded the fade program and put the data pin into the pin where the light would normally go and now it is working.

Are you saying you're using a PWM output ("analogWrite") to drive your servo?
Is it getting warm?

Well I still have the outside power supply hooked up, I'm just using the pwm for the data pin. I haven't noticed any change in temperature but I'll keep a close eye on it if you think it might be a problem.

Are you saying you're using a PWM output ("analogWrite") to drive your servo? Is it getting warm?

You know, you would think they would learn to actually appropriately answer a technical question. No wonder so much stuff is screwed up. :frowning: