go_away

Author Topic: roboduino PWM 3,5,6, and 11 do not work  (Read 2047 times)

0 Members and 1 Guest are viewing this topic.

Offline offyTopic starter

  • Supreme Robot
  • *****
  • Posts: 340
  • Helpful? 1
roboduino PWM 3,5,6, and 11 do not work
« on: March 19, 2009, 01:28:07 PM »
I just got a roboduino and I found out only pins 9 and 10 can run servos. I have more than 2 I need to plugin. 3,5,6, and 11 say PWM but do not work.

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #1 on: March 19, 2009, 01:33:37 PM »
What does your multimeter say about those signal/gnd/voltage pins at those locations?

Also, what kind of servos are they?

Offline offyTopic starter

  • Supreme Robot
  • *****
  • Posts: 340
  • Helpful? 1
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #2 on: March 19, 2009, 01:35:09 PM »
They are micro servos, with 3 wires, signal, power, ground.

Let me go dig up my multimeter.

Ok I found it, I don't know what setting on it to use (I never rly used one before) also where do you want me to test the pins (2 cables)
« Last Edit: March 19, 2009, 01:40:34 PM by offy »

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #3 on: March 19, 2009, 01:53:24 PM »
you could just put it on voltage? see if anything comes out when you command it?
Howdy

Offline offyTopic starter

  • Supreme Robot
  • *****
  • Posts: 340
  • Helpful? 1
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #4 on: March 19, 2009, 01:54:39 PM »
it gets power, just it does not send a signal.

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #5 on: March 19, 2009, 02:18:18 PM »
odd, although servos do need pwm i thought all outputs could do that. did you configure it to an output?
Howdy

Offline offyTopic starter

  • Supreme Robot
  • *****
  • Posts: 340
  • Helpful? 1
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #6 on: March 19, 2009, 02:39:18 PM »
what do you mean. I programed it to all the pins (one at a time to test) and it only works on pins 9 and 10. Is there more I need to do?

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #7 on: March 19, 2009, 02:45:54 PM »
hmm, i dont really have much experience with programming but no there shouldnt be, can you post the code?
Howdy

Offline offyTopic starter

  • Supreme Robot
  • *****
  • Posts: 340
  • Helpful? 1
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #8 on: March 19, 2009, 02:47:55 PM »
Yes I can. Right now it is set for pin 9, but I have been changing that.

Code: [Select]
// Sweep
// by BARRAGAN <http://barraganstudio.com>

#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 < 180; pos += 5)  // 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(25);                       // waits 15ms for the servo to reach the position
  }
  for(pos = 180; pos>=1; pos-=5)     // goes from 180 degrees to 0 degrees
  {                               
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(25);                       // waits 15ms for the servo to reach the position
  }
}

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #9 on: March 19, 2009, 06:54:01 PM »
I just got a roboduino and I found out only pins 9 and 10 can run servos. I have more than 2 I need to plugin. 3,5,6, and 11 say PWM but do not work.

look at this : http://curiousinventor.com/blog/66
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #10 on: March 19, 2009, 06:54:30 PM »
Dear Offy,

The problem is not the Roboduino, but the servo library. It was made so it uses only pins 9 and 10. For more servos, you need to install the SoftwareServo library, that works the same, but with all Roboduino pins. So, after you download and install the SoftwareServo library, you can use the same code, but instead of including Servo library, you include SoftwareServo library. Also, the servos need a refresh command that you need to call any time between 10 and 30 ms. Below is the sample code and I have attached the library:

Code: [Select]
#include <SoftwareServo.h>

SoftwareServo myservo;  // create servo object to control a servo

int potpin = 0;  // analog pin used to connect the potentiometer
int val;    // variable to read the value from the analog pin

void setup()
{
  myservo.attach(3);  // attaches the servo on pin 3 to the servo object
}

void loop()
{
  val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023)
  val = map(val, 0, 1023, 0, 179);     // scale it to use it with the servo (value between 0 and 180)
  myservo.write(val);                  // sets the servo position according to the scaled value
  delay(15);                           // waits for the servo to get there

  SoftwareServo::refresh();
}
Check out the uBotino robot controller!

Offline airman00

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #11 on: March 19, 2009, 07:08:55 PM »
Although the new softwareServo library can control all the pins , ONLY PLUG IN YOUR SERVOS TO THE PWM PINS!
This is because only the PWM pins are unregulated power pins, the others are all regulated.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline offyTopic starter

  • Supreme Robot
  • *****
  • Posts: 340
  • Helpful? 1
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #12 on: March 19, 2009, 07:24:01 PM »
I know PWM is for servos, and servos should not go else where. I like the servo.h library better, it is more simple, like I can do for(pos > 180) and stuff, this one I have tons of timing.

I want it set up like this. Is this possible?

Code: [Select]
#include <SoftwareServo.h>

SoftwareServo servo1;
int pos = 0;
void setup()
{
  servo1.attach(5);
}

void loop()
{
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
    servo1.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees
  {                               
    servo1.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}
« Last Edit: March 19, 2009, 07:47:27 PM by offy »

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #13 on: March 19, 2009, 08:16:52 PM »
Although the new softwareServo library can control all the pins , ONLY PLUG IN YOUR SERVOS TO THE PWM PINS!
This is because only the PWM pins are unregulated power pins, the others are all regulated.

Servos will work on the other pins, they just go slower because they don't get as much voltage.

Offline want2learn

  • Robot Overlord
  • ****
  • Posts: 189
  • Helpful? 4
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #14 on: March 19, 2009, 09:09:54 PM »
Although the new softwareServo library can control all the pins , ONLY PLUG IN YOUR SERVOS TO THE PWM PINS!
This is because only the PWM pins are unregulated power pins, the others are all regulated.

Servos will work on the other pins, they just go slower because they don't get as much voltage.

And theres the possibility of overloading the regulator sending it into shutdown
The question that drives me hazy:

Am I, or the others crazy?

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #15 on: March 19, 2009, 09:47:41 PM »
I know PWM is for servos, and servos should not go else where. I like the servo.h library better, it is more simple, like I can do for(pos > 180) and stuff, this one I have tons of timing.

I want it set up like this. Is this possible?


SoftwareServo library works exactly the same like Servo library, it's based on it actually. So yeah, your code will work.
Check out the uBotino robot controller!

Offline offyTopic starter

  • Supreme Robot
  • *****
  • Posts: 340
  • Helpful? 1
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #16 on: March 20, 2009, 04:44:41 AM »
how come this doesn't work than?

I tried it but no luck...

Code: [Select]
#include <SoftwareServo.h>

SoftwareServo servo1;
int pos = 0;
void setup()
{
  servo1.attach(5);
}

void loop()
{
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
    servo1.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees
  {                               
    servo1.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #17 on: March 20, 2009, 06:19:27 AM »
Edit: Sorry about that, I have modified the library a bit  ::)

After you include SoftwareServo library, you declare the servos like this:

Code: [Select]
Servo servo1;
then before the end of the void loop (after the for loop) you add this line:

Code: [Select]
Servo::refresh();
That should do it!
« Last Edit: March 20, 2009, 06:26:54 AM by Ro-Bot-X »
Check out the uBotino robot controller!

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: roboduino PWM 3,5,6, and 11 do not work
« Reply #18 on: March 20, 2009, 09:59:44 AM »
Offy,

seriously you gotta start reading included documentation! :P

http://www.arduino.cc/playground/ComponentLib/Servo


It's like how us guys don't like to stop and ask for directions, or read the manual on a dvd player before wasting an hour trying to figure it out.

First read up and do your research and then come back and ask educated questions.

Sorry to be harsh but I think that the people new to electronics/robotics need to learn where to look for answers first.

A lot of times, in the IT world for example, higher-ups or supervisors will first tell you RTFM or 'Google' it! before they spoon-feed you the solution.
« Last Edit: March 20, 2009, 10:02:41 AM by pomprocker »

 


Get Your Ad Here