Offline
Newbie
Karma: 0
Posts: 22
|
 |
« on: March 13, 2012, 03:29:42 pm » |
Hey guys.
Im doing a project involving robotic arms with 2 servos - pan and a tilt.
Ive had no problems with the tilt mechanism as i only need to move 100 degrees, finding a motor for this was easy and the ones i got work in the way i expected - i e send it a number through PWM which moves it to a position.
But with the 360 degree ones it works differently. for example send it an 80 and it moves slowly clockwise, 85 it moves faster then send it a 70 and it moves the other way. This is completely useless to me!
So, can anyone tell me how i can make these work differently or where i can get 360 degree servos that work normally??
thanks in advance!
Rich
|
|
|
|
|
Logged
|
|
|
|
|
New Jersey
Offline
Edison Member
Karma: 24
Posts: 2345
|
 |
« Reply #1 on: March 13, 2012, 03:58:52 pm » |
It sounds like that is a continuous rotation servo - you can't control its position, just turn it at variable speed in two directions or stop it. Folks here often refer to them as "ex-servos". If you look for servos for model yachts - sail or winch servos, you'll find examples that can turn 360 degrees or more.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #2 on: March 13, 2012, 04:08:15 pm » |
Thanks wildbill.
I did come across winch servos, but the guy in the shop said they worked in a different way again. something along the lines of having to rotate a certain amount of times one way to be able to go back the other?! this seemed very strange, do you know what he was reffering to or is this just false?!
cheers Rich
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Online
Brattain Member
Karma: 279
Posts: 15295
Measurement changes behavior
|
 |
« Reply #3 on: March 13, 2012, 04:30:34 pm » |
this seemed very strange, do you know what he was reffering to or is this just false?! I suspect just a false or misguided opinion. This appears to operate just as a standard servo except total travel is rated as 360 degrees rather then 180: http://www.pololu.com/catalog/product/522
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #4 on: March 13, 2012, 04:40:50 pm » |
thanks. will go ahead & order one to test.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 50
Posts: 6530
Arduino rocks
|
 |
« Reply #5 on: March 13, 2012, 06:27:23 pm » |
Be aware that the sail winch servos may turn from three to six turns, with rotatio position accuracy possibly being reduced by 2x the number of turns.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #6 on: March 17, 2012, 07:05:42 am » |
Ok so i bought a "hitec hs785 hb" sail winch servo.
Cant believe it but im having exactly the same problem! I thought it might be to do with the code i was sending from processing so tried it with examples/servo/sweep. it just doesn't do what the code says it should. Instead of moving 180 degrees, it moves about 280. I think it is controlled in exactly the same way as the motors i had the original problem with.
Can anyone help?!
cheers Rich
|
|
|
|
|
Logged
|
|
|
|
|
New Jersey
Offline
Edison Member
Karma: 24
Posts: 2345
|
 |
« Reply #7 on: March 17, 2012, 07:17:25 am » |
The sweep example uses servo.write, which is a wrapper for servo.writeMicroseconds. It assumes a servo with a 180 degree range of motion. That isn't true of your new server so you won't get the 180 you expect. Try using writeMicroseconds directly and experiment with the range of values the servo will accept.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 50
Posts: 6530
Arduino rocks
|
 |
« Reply #8 on: March 17, 2012, 10:01:00 am » |
Simple servo test code for use with the serial monitor that you can try. // 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
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #9 on: March 20, 2012, 06:35:37 am » |
cheers zoomkat.
but still i get the same result. if i type 180 into serial monitor it goes fast continually 1 way, if 0, the other way and 90 it stops. dohh!!
i have spoken to someone on an rc shop techline and he said maybe i was sending a digital signal instead of an analog one. But am i write to think PWM is analog?
if not has anyone ever controlled a servo with on of the analog outputs? and would this make it act differently? (not PWM)
cheers Rich
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Online
Brattain Member
Karma: 136
Posts: 18995
I don't think you connected the grounds, Dave.
|
 |
« Reply #10 on: March 20, 2012, 07:27:33 am » |
i have spoken to someone on an rc shop techline and he said maybe i was sending a digital signal instead of an analog one. But am i write to think PWM is analog? Servo control pulses are digital. I've never seen an analogue-controlled R/C servo (except maybe in historical references) - your techline man is talking out an orifice not normally associated with verbal communication.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 22
|
 |
« Reply #11 on: March 20, 2012, 08:31:03 am » |
lol!! ok problem solved! found a reference to the position/microsecond value, which is different for this servo - http://www.robotshop.com/ca/hitec-hs785hb-servo-motor-2.htmlthen used zoomkat's test code for the win! thanks guys!!
|
|
|
|
|
Logged
|
|
|
|
|
|