Servo and pwm


Closed Thread
Results 1 to 11 of 11

Thread: Servo and pwm

  1. #1
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52

    Default Servo and pwm

    Hi all,

    In reading the book (that should get me some spam in itself) I read that the PWM output wants an R/C network to "filter" the waveform. The burning question I've had, and now even worse, is that if the pic "wants" an R/C to give you nice clean PWM, why does the servo not work worth a dang when on the tail end of that R/C?

    Of course it would be much easier to answer the question if I'd just go buy a scope and watch that for a while.

    Has anybody watched these different outputs and can you tell me why the R/C is no go?

    Cheers
    Gary

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Meriachee, An R/C network attached to a pwm output will integrate the signal and turn it into an analog representation of the pwm value in percent between the full scale output voltage and 0. If you are talking about servos used for r/c control, most of them require a continuous series of pulses that are approx. 1.5 milliseconds wide and have a period of approx. 20 milliseconds.. The pulse width varies from about 1 millisecond to about 2 milliseconds. I think this is where you are getting confused....

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Thanks Dave,

    Analog makes sense.

    Cheers
    Gary

  4. #4
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    The little servo I am using is moving the arm when the power comes up in a rather uncontrollable fashion, until the pic is operational. With the linkage I am using, eventually it will cause some issues.

    I am thinking about putting a 2n3904 on the ground leg of the servo and bring it up on a gpio, ensuring that the power is "off" until the pic is running and ready to go. Any ideas on this approach, or is there a better way to ensure the servo does not rotate at all until the pic is ready?

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Meriachee, Possibly a pass transistor in series with the power lead to the servo. After the pic is up and running w/pwm pulses to the servo, turn on the power to the servo. That is what I can come up with as a quick and dirty solution. All servos act like that upon powerup with no command signal that I have seen...

    Dave Purola,
    N8NTA

  6. #6
    Join Date
    May 2008
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Pic/servo startup

    Hmm. I haven't seen that servo behavior myself, but I thought it might be worth an experiment so I plugged a servo directly into a battery pack with no signal. One out of every ten or so times I plugged it in it would twitch just barely. Is that the issue you're having? If this is it I think you have to go with switched power but it is a very small movement and it might be related to the specific servo you're using.

    If not you might want to look at where and what value is associated with thethe first pulseout is in your code. I have had issues where the servo is moved far from a default position and startup includes significant movement as it heads for default and I've also set the default position at the wrong value and had movement. Finally I've had the pic come up with outputs high or not set until late in the program which gave me some issues.

    I've also on rare occasion had spurious signals from dirty power - might want to check that. I'm also assuming that you're posting about standard 1-2ms commanded hobby or robotics servos.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Make sure you're wearing safety glasses before powering-up that servo with a
    2N3904 low-side switch...;o}

    An FET that can handle your servos stall current might be a better choice?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  8. #8
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Thanks Bruce,

    The servo is one of those micro-miniature jobs. I tried the same code on a "regular" hobby servo and it works like a charm without any switching. The regular one does not even move when you put power to it, the mini job can spin almost 1/2 way around. Not a cycle or two.....

    Cheers
    Gary

  9. #9
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Gary,

    I had one of those micro servos a few years back that did pretty much the same thing.

    It had a severe twitch under certain circumstances too as I recall. Can't remember exactly
    why, but it was a funky servo. I think it was a BlueBird brand? Can't remember. I blew it up
    goofing around, and never bothered replacing it.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  10. #10
    Join Date
    Oct 2008
    Posts
    51


    Did you find this post helpful? Yes | No

    Default

    Its down to the indidual servo buddy, the experiances i have had is the nice and cheap servos have alot of start up movement.... I got a cheap load of servos from ebay and they all have this problem. I also have another servo which i got from a friend at work which is of a higher wuality that doesnt have the issue

  11. #11
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Post

    Quote Originally Posted by Meriachee View Post
    The little servo I am using is moving the arm when the power comes up in a rather uncontrollable fashion, until the pic is operational. With the linkage I am using, eventually it will cause some issues.
    Hi, Dave

    You CAN'T have your servo, if an "analogic" one, steady while powering on its amplifier ... that's it !!!

    The only way is to cut the power to the motor terminals ( relay ...)

    Solution is to use a DIGITAL servo which control circuitry won't drive the motor at Power-up.

    No simple solution for "old analogic" servos ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. PMDC SERVO MOTOR WITH quadrature encoder DRIVE ?
    By phoenix_1 in forum Schematics
    Replies: 37
    Last Post: - 22nd November 2009, 19:45
  2. The best way to control a servo with a PIC
    By The Master in forum Off Topic
    Replies: 41
    Last Post: - 19th October 2008, 02:44
  3. how to change servo motor PWM
    By dboy in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 21st September 2008, 07:02
  4. RC Servo Receiver
    By Ioannis in forum General
    Replies: 2
    Last Post: - 23rd October 2007, 06:56
  5. inturrepts to control the servo motor position!
    By parinshah in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 2nd May 2006, 07:55

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

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