Pages: [1]   Go Down
Author Topic: Arduino UNO plus Adafruit motor shield to run modified servo or DC  (Read 2400 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone. Please help!
I am very new with Arduino and my first goal is to make two little modified servo motors work to be the wheels of my first robot. I modified them so now they can rotate 360 degrees. But when I connect them in the servo pins of the Adafruit motor shield, they still work as normal servos. Can someone please tell me if I should connect them in a different place and give me an easy code to download and make them run as if the where little DC motors? Thanks.
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 596
Posts: 33279
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It sounds like you have not modified your servos correctly to allow continuous movement.
Logged

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1893
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

As you can read on the adafruit site: "The adafruit motorshield just connects through the servo" So you do not need the shield.
However the connectors are very convenient  smiley
On your problem I agree with Grumpy: "You probably did not correctly modify your servo's"

Best regards
Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you guys for the quick response. As far as I know I modified the servos well. After doing it now I am able to get a full turn with my hand. The main thing is that I don´t know if the modified servos should still be connected to the same connector (Serv 1 o Serv 2) in the Adafruit shield  and the fact that I don´t have any code to simulate simple wheels movement so I can see if they can do the job. If you have any code please let me know.
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 596
Posts: 33279
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Modifying a servo for continuous rotation involves some electronic changes. Once done if you tell the servo to go to a position it will rotate continuously. The fact that it continues to act like a servo means you have not modified it correctly.
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It does look like you just removed the end-stops. You have to do something to the pot too, or replace it with fixed resistors, I believe.
Logged

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1893
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

biotech
Maybe you can point us to the instructions you have used to mod the servo?
Best regards
Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi! I just modified the gearbox to allow continuous rotation but I didn´t touch the electronic thing. So as you all say I didn´t finish the job. The site I used as a reference was:

http://www.roboticapy.com/servo2.asp

Now I found this site and they are showing how to modify a microservo very similar to the one I have:

http://letsmakerobots.com/node/4873

I will have a try and see if I can get the full turn following their instructions. Otherwise, any other info you may send me on this subjet will help me a lot!

Please can someone tell me if the modified servos should still be connected to the Serv 1 o Serv 2 jumpers in the Adafruit? Is there any simple code you can give me for modified servos to act as robot wheels? Thanks to you all!!!
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, you still attach them in the same way.

When modified correctly, there will be a value, around 90 degrees, where the servo will be stopped. Setting to 0 degrees will be full speed in one direction and 180 degrees will be full speed in the other direction.
Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9470
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The servo pot also has to be disconnected from the motor gearing along with removing the gearing stop. Below is how I made some continious rotation servos. You do not need a motor shield on the arduino with the continous rotation servos. Bottom is some servo code you can use to test your servo.

http://www.lynxmotion.net/viewtopic.php?f=31&t=6388

Code:
// 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
  }
}

Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 596
Posts: 33279
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You do not need a motor shield of any sort to run a servo.
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
    While it is completely correct to say that you do not need a shield to drive servos, you will almost certainly need separate power, see the links in my signature for the reasons why, a demonstration why and a very simple solution using an additional 4 AA batteries.

Duane B

rcarduino.blogspot.com
Logged


Offline Offline
Jr. Member
**
Karma: 0
Posts: 76
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

When I posted my question I could never have imagined that I would get this kind of feedback. I am just amazed!

Now I know that I don´t need a shield for the servos, I have good guidance on how to work on the electronics to make them run as DCs, and I also have the code and info on how to power the servo without the shield. What else could I ask?

This weekend I will have a go on the electronics and see if I can get it done propertly. Not very optimistic though as for the time being all the electronic work looks scary to me. Buy I am sure that sooner or later I will get there with your help. When I finally have the servos up and running I will let you know. Thanks a lot to you all!
Logged

Pages: [1]   Go Up
Jump to: