how to change servo motor PWM


Closed Thread
Results 1 to 16 of 16
  1. #1
    Join Date
    Sep 2008
    Posts
    5

    Default how to change servo motor PWM

    Hi,friends

    Now I am researching servo motor with PIC BASC Pro. My problem is how to change servo motor PWM. I try to design programming. But it is not successful.Please give me some ideal. Thank you.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Code:
    pin   var yourport.x ' for instance PortB.7
    Duty  var byte
    cycle var byte
    
    PWM pin,duty,cycle ' right out of the book 
     . . . . . . Or,
    PWM PORTB.7,127,100 ' RIGHT FROM THE BOOK 50% duty cycle @ 100 cycles
    Alter the values in the variables to change the values of the Duty time and Cycle time.
    you can change them using digital methods or analog a/d converters and a potentiometer.

    to alter numbers just . . . duty = 130
    .................................. cycle = 150
    Last edited by Archangel; - 20th September 2008 at 09:29.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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


    Did you find this post helpful? Yes | No

    Default

    Hi, Joe

    I think the question was " how to move the servo's arm" ...

    Alain


    DBoy,

    As you have to learn everything about servos management ... I'd recommend you to make a Web search on R/C and Robotics sites about How a servo works.

    Once that, with once more the SEARCH tool ,of this forum, now, you'll find how to do that with PicBasicPro...

    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 " !!!
    *****************************************

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Joe

    I think the question was " how to move the servo's arm" ...

    Alain


    DBoy,

    As you have to learn everything about servos management ... I'd recommend you to make a Web search on R/C and Robotics sites about How a servo works.

    Once that, with once more the SEARCH tool ,of this forum, now, you'll find how to do that with PicBasicPro...

    Alain
    Hi Alain,
    Boy there a zillion open threads in here about that, I would be happy if I could just make interrupts work.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    Hi Alain,
    I would be happy if I could just make interrupts work.
    Could you PM me more about what you want to do ???

    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 " !!!
    *****************************************

  6. #6
    Join Date
    Sep 2008
    Posts
    5


    Did you find this post helpful? Yes | No

    Smile servo motor

    Thank you for your ideal. Actually servo motor pulse width variance from 1ms to 2 ms. I want servo motor shaft slowly turning. So I want to change PWM.

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Question

    Hi, Dboy

    YOU know what you are doing ( or closer: trying to do ...)

    WE do not know anything at all of you.


    Here I'm wondering if you want to turm the servo arm slowly from a position to b position ... or if you want a continuous slow rotation of this arm ...

    Solutions are not exactly ( way of speaking !!! lol ) the same ...

    PLEASE

    Explain what you want to do AS a FINAL GOAL ...

    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 " !!!
    *****************************************

  8. #8
    Join Date
    Sep 2008
    Posts
    5


    Did you find this post helpful? Yes | No

    Smile servo motor

    I want a continuous slow rotation of servo motor

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dboy View Post
    I want a continuous slow rotation of servo motor
    continuous slow rotation of a servo motor - Is this servo motor capable of continuous (like a clock) slow rotation? Most, if not all, R/C aircraft type servos have mechanical stops that won't allow them to rotate past a certain point. Unless you've modified a servo to do a slow rotation somehow (and I don't see that happening), this slow rotation isn't going to happen.

  10. #10
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Dave
    Always wear safety glasses while programming.

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Not sure how it works...but I'm going to guess...
    The servo's feedback pot is mechanically disconnected and locked into the 'center' position? Assume that this servo's center is 1.5ms. You give it a pulse of 1.6ms, it runs right at X speed. You give it a pulse of 1.7ms, it runs right at 2X speed. Same thing for the other direction? You give it a 1.4ms pulse, it runs left at X speed, pulse it at 1.3ms, and it runs left at 2X speed?
    Therefore, the farther the input pulse is from 1.5ms, the faster it will travel in that particular direction?

  12. #12
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Not sure how it works...but I'm going to guess...
    The servo's feedback pot is mechanically disconnected and locked into the 'center' position? Assume that this servo's center is 1.5ms. You give it a pulse of 1.6ms, it runs right at X speed. You give it a pulse of 1.7ms, it runs right at 2X speed. Same thing for the other direction? You give it a 1.4ms pulse, it runs left at X speed, pulse it at 1.3ms, and it runs left at 2X speed?
    Therefore, the farther the input pulse is from 1.5ms, the faster it will travel in that particular direction?
    You got it. They used to sell these with instructions to modify, now they do the modification for you.
    Makes really nice rolling gizmos.
    Dave
    Always wear safety glasses while programming.

  13. #13
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    You got it. They used to sell these with instructions to modify, now they do the modification for you.
    Makes really nice rolling gizmos.
    So, if you get a servo with a really tight deadband, it could be almost impossible to get the motor to stop 'cause it would always be trying to hit that sweet spot?

  14. #14
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I have only used a dozen or so of these and have only had that problem a couple of times, but the little screw inside makes them adjustable. So it is not that big of a problem.
    Dave
    Always wear safety glasses while programming.

  15. #15
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    I have only used a dozen or so of these and have only had that problem a couple of times, but the little screw inside makes them adjustable. So it is not that big of a problem.
    Well, that's a handy bit of information. I didn't know those types of servos were any sort of popular and/or used that much. That'll come in handy for a few things I've been wanting to mess with.

  16. #16
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Modifying R/C servos in the manner you described have been a fairly common way to get a low speed/low torque reversible motive system.

Similar Threads

  1. More Servo Woes
    By chrisshortys in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 13th May 2009, 08:40
  2. saving RCREG to word
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th September 2008, 13:51
  3. Servo does not move
    By ruijc in forum General
    Replies: 12
    Last Post: - 12th November 2007, 19:14
  4. Beginner + Servo
    By james in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st July 2007, 21:31
  5. Help with Servo Control Please!
    By wireman22 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th June 2007, 18:15

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