Results 1 to 8 of 8

Thread: Servo motors always going to extreme positions.

  1. #1

    Default Servo motors always going to extreme positions.

    I am controlling a servo motor(Hitec 311) using a 80512 chip(P89V51Rd2). However, the motor always moves to the extreme position regardless of the pulse width I am supplying to it ( I've tried 1ms,0.5ms, 1.5ms,2ms).
    The proteus program for it is working fine. Also I'm sure that my connections are perfect.
    Power is coming from a USB port from my computer. Is that a problem? In that case what battery do I use?
    Does the servo behave in such a manner if it is broken?
    ( I know there are several posts with doubts about servos but I'm still clueless. Generally, people are not having any problem with a Hitec Servo. So I hope my doubt is not too trivial.)
    Last edited by yash25; 01-10-2010 at 12:34 AM.

  2. #2
    Senior Member T-1000
    Join Date
    Mar 2005
    Location
    Bangalore
    Posts
    728
    Blog Entries
    7

    Default

    The proteus program for it is working fine. Also I'm sure that my connections are perfect.
    how do you know??
    If both are perfect, and the motor is a working one, it SHOULD work. so probably something IS wrong here. Did you check the signals with a scope?


    do these::

    1) Check the signals with a scope. give 1.5ms signal, TTL level. DOnt use load. Use 4.8 to 6V, if you dont have access to NIcds or NIMHs, simply use 4 normal AA size batteries in series.
    2) If, still , its not working, there must be something wrong with the motor. Set up a simple 555 based circuit. Also check the refresh rate. It should be between 15ms to 20ms.
    3) First look, its the pulse width and nothing else.
    4) NEVER use USB supply to test any load which have coils, inductors etc on it. in simple terms, never use it for any motors, or for anything greater than 100ma.
    5) Yes, fresh HItec motors never gave me a problem till date, unless you really misbehave with it.
    .... I didnt do it ! ....

  3. #3

    Default

    Quote Originally Posted by yash25 View Post
    I am controlling a servo motor(Hitec 311) using a 80512 chip(P89V51Rd2). However, the motor always moves to the extreme position regardless of the pulse width I am supplying to it ( I've tried 1ms,0.5ms, 1.5ms,2ms).
    The proteus program for it is working fine. Also I'm sure that my connections are perfect.
    Power is coming from a USB port from my computer. Is that a problem? In that case what battery do I use?
    Does the servo behave in such a manner if it is broken?
    ( I know there are several posts with doubts about servos but I'm still clueless. Generally, people are not having any problem with a Hitec Servo. So I hope my doubt is not too trivial.)
    Hi,

    Check if the pulse repeating timing is around 20ms..I think the freq is set too high (<<20ms) in ur case..If possible post ur code here..

    Regards

    happy_99

  4. #4

    Default

    Many thanks to allbits and happy_99. (@ allbits: I will definately see the pulses on a scope )
    Here is the code for generating a pulse of 1.5 milliseconds: (I have connected the servo motor to the 2.0 pin of the controller)

    //.................................................. .................................................. ......................
    #include<reg51.h>
    #include<stdio.h>

    sbit MTR=P2^0;

    void main(void)
    {
    TMOD=0x01;

    while(1)

    // 1.5 milliseconds 0th position
    {
    MTR=1;
    TH0=0xFA;
    TL0=0x99;
    TR0=1;
    while(TF0==0);
    TR0=0;
    TF0=0;

    MTR=0;
    TH0=0xBD;
    TL0=0x65;
    TR0=1;
    while(TF0==0);
    TR0=0;
    TF0=0;
    }
    }

    Here is the code for generating a pulse of 2 milliseconds:
    //.................................................. ...............................................
    while(1)
    {
    MTR=1;
    TH0=0xF8;
    TL0=0xCD;
    TR0=1;
    while(TF0==0);
    TR0=0;
    TF0=0;


    MTR=0;
    TH0=0xBF;
    TL0=0x32;
    TR0=1;
    while(TF0==0);
    TR0=0;
    TF0=0;
    }
    //.................................................. ................................................

    And the code for 1 millisecond:
    //.................................................. ................................................

    while(1)
    {
    MTR=1;
    TH0=0xFC;
    TL0=0x66;
    TR0=1;
    while(TF0==0);
    TR0=0;
    TF0=0;

    MTR=0;
    TH0=0xbb;
    TL0=0x98;
    TR0=1;
    while(TF0==0);
    TR0=0;
    TF0=0;

    }
    //.................................................. .................................................. .....................

    Thanks a million once again...

  5. #5

    Default

    But how do you refresh the signals, using a timer? Also check if the watchdog timer is turned off, you should turn it off.

  6. #6

    Default

    Hi.
    I was having similar problem. I believe there is nothing wrong with the servo. As long as you are giving a pulse between 1ms-2ms with a duty cycle of 20ms it should work. That is to say between, high for 1ms and low for 19ms, and high for 2ms and low for 18ms.
    Although, I had a problem with my microcontroller. It was using an internal RC oscillator instead of the external crystal which was frustrating. For me, I had to uncheck all the ticks under "security and configuration bits" for the microcontroller in pony prog. Depending on your microcontroller, it might be worth checking out. You can try to output say a 1second pulse using a similar timing program and use an LED on output to check if it's giving out a 1second pulse! If its taking longer then it must be using the internal Oscillator.
    Hope this helps.
    Ankit

  7. #7

    Default

    I figured out the problem. As soon as I started giving power through a battery and not through the PC, the code started working!
    Thanks a million for the help!

  8. #8
    Administrator T-1000 rao's Avatar
    Join Date
    Feb 2004
    Location
    New Delhi
    Posts
    833
    Blog Entries
    2

    Default

    LoL I didnt notice you were powering your servos from USB.. servos require 4.8V-6V volts with atleast 1A-1.5A current to source. Use a 6V 1800mAH to 2400mAH

    Refer to http://www.lynxmotion.com/ViewPage.a...22#servo-power

    This article has helped me

    also
    http://www.servodatabase.com/servos/hitec

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •