Offline
Newbie
Karma: 0
Posts: 42
|
 |
« on: April 25, 2012, 04:53:14 pm » |
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)
Offline
Brattain Member
Karma: 277
Posts: 25556
Solder is electric glue
|
 |
« Reply #1 on: April 25, 2012, 04:59:08 pm » |
It sounds like you have not modified your servos correctly to allow continuous movement.
|
|
|
|
|
Logged
|
|
|
|
|
Belgium
Offline
Edison Member
Karma: 34
Posts: 1076
Arduino rocks; but with my plugin it can fly rocking the world ;-)
|
 |
« Reply #2 on: April 25, 2012, 05:55:47 pm » |
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  On your problem I agree with Grumpy: "You probably did not correctly modify your servo's" Best regards Jantje
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 42
|
 |
« Reply #3 on: April 25, 2012, 06:41:39 pm » |
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)
Offline
Brattain Member
Karma: 277
Posts: 25556
Solder is electric glue
|
 |
« Reply #4 on: April 26, 2012, 01:39:03 am » |
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
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #5 on: April 26, 2012, 01:57:41 am » |
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
Edison Member
Karma: 34
Posts: 1076
Arduino rocks; but with my plugin it can fly rocking the world ;-)
|
 |
« Reply #6 on: April 26, 2012, 04:35:54 am » |
biotech Maybe you can point us to the instructions you have used to mod the servo? Best regards Jantje
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 42
|
 |
« Reply #7 on: April 26, 2012, 11:44:14 am » |
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.aspNow I found this site and they are showing how to modify a microservo very similar to the one I have: http://letsmakerobots.com/node/4873I 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
Faraday Member
Karma: 19
Posts: 3117
|
 |
« Reply #8 on: April 26, 2012, 12:21:08 pm » |
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
Tesla Member
Karma: 51
Posts: 6572
Arduino rocks
|
 |
« Reply #9 on: April 26, 2012, 12:44:32 pm » |
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// 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
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25556
Solder is electric glue
|
 |
« Reply #10 on: April 27, 2012, 02:35:39 pm » |
You do not need a motor shield of any sort to run a servo.
|
|
|
|
|
Logged
|
|
|
|
|
Dubai, UAE
Offline
Edison Member
Karma: 20
Posts: 1627
|
 |
« Reply #11 on: April 27, 2012, 02:45:39 pm » |
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
Newbie
Karma: 0
Posts: 42
|
 |
« Reply #12 on: April 27, 2012, 03:18:51 pm » |
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
|
|
|
|
|
|