Pages: [1]   Go Down
Author Topic: Minimum possible angle movement of HS 311 Servo motor  (Read 687 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear All,

I hope you are all in the best of your health and spirits.

The servo.h library does not allow the use of floating numbers. I desire the maximum possible accurate movement of this motor. Currently, I can only move it to 1 degree. How do I get to floating numbers?

I am not good at this stuff .Any help regarding the matter would be highly appreciated.

Thank you.
Logged

Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you sure the servo can be positioned as closely as you want in the first place?
Logged

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

0
Offline Offline
Tesla Member
***
Karma: 116
Posts: 8938
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Servo test code where you can use the writeMicroseconds to test your servo.

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

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you sure the servo can be positioned as closely as you want in the first place?

I am not sure on that either.  smiley-confuse I guess, it depends on the gear and the teeth assembly?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank You ZoomKat. Appreciate it.
Logged

0
Offline Offline
Tesla Member
***
Karma: 116
Posts: 8938
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've tinkered with servo resolution in the past and .5 deg is about the limit of resolution with standard servos. Also analog servos usually have about 5us deadband internally to reduce position hunting.




Logged

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

Johannesburg UTC+2
Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you sure the servo can be positioned as closely as you want in the first place?

I am not sure on that either.  smiley-confuse I guess, it depends on the gear and the teeth assembly?


Yes I see that's a nylon geared one... and I also read that sometimes there's an intrinsic lack of positioning ability in the potentiometer mechanism in a servo. I'd be really surprised if you can get even repeatably to anything like a degree. But that's me just guessing...

So what I'm going to do is rig up some kind of pointer / protractor thing this weekend and see what kind of luck I have. I've got a couple of standard size HK15138s and micro size HXT900s.

What sort of loading will your servo be subject to?

Edit... hey ZK, that's exactly the kind of rig I have in mind... I was thinking 1/2 degree tops, most likely even 1 degree. We'll see.....
« Last Edit: March 15, 2013, 10:33:39 am by JimboZA » Logged

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


What sort of loading will your servo be subject to?

Running on no-load conditions as of now.
Logged

Pages: [1]   Go Up
Jump to: