+ Reply to Thread
Results 1 to 10 of 10

Thread: Servo Controll... In reverse?

  1. #1
    savage Newbie
    Join Date
    Jun 2004
    Location
    Cape Town, South Africa
    Posts
    35

    Question Servo Controll... In reverse?

    Hi,

    Just one quick question, and one more difficult one...

    Looking at http://www.imagesco.com/articles/picservo/03.html Is that pretty accurate as far as controlling Servo with a PIC?

    Based on the 4MHz Crystal, how do I know that sleep 18 in the asm will give me a period of 18ms ?

    Ok, so now that is all sorted out, and I have my PIC controlling the position automatically of the Servo. To make it easy, let's say the PIC sends the Servo from Position 0 to 180 or anywhere in between.

    If I want to control this manually now?? I cut the power to the Servo, the Servo remains at what ever position the PIC left it in. Manually turning the Servo, how can I read what position the Servo is at??

    Thanks,
    Regards,
    Chris.


  2. #2
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,759

    Default

    Quote Originally Posted by savage
    Hi,

    Just one quick question, and one more difficult one...

    Looking at http://www.imagesco.com/articles/picservo/03.html Is that pretty accurate as far as controlling Servo with a PIC?

    Based on the 4MHz Crystal, how do I know that sleep 18 in the asm will give me a period of 18ms ?
    It's not assembler, it's BASIC, and the 18mS delay will be plenty accurate enough.


    Ok, so now that is all sorted out, and I have my PIC controlling the position automatically of the Servo. To make it easy, let's say the PIC sends the Servo from Position 0 to 180 or anywhere in between.

    If I want to control this manually now?? I cut the power to the Servo, the Servo remains at what ever position the PIC left it in. Manually turning the Servo, how can I read what position the Servo is at??
    You don't, there's no output from a servo (except the mechanical one), when you power back up the servo will move itself to whatever position the program tells it to. You also shouldn't reply on turning the PIC off and the servo staying where it is, servo's aren't designed to do that.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  3. #3
    savage Newbie
    Join Date
    Jun 2004
    Location
    Cape Town, South Africa
    Posts
    35

    Default

    Wow, that was helpfull.

    So with the 4Mhz crystal, how do I know that 18 is enough? How is it calculated?

    And yes, I know I can't read a value from a Servo, and no, I'm not powering down the PIC, I'm powering down the Servo just like I typed the first time...

    Guess I'll have to come up with something machanical to read the position...
    Regards,
    Chris.

  4. #4
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,759

    Default

    Quote Originally Posted by savage
    Wow, that was helpfull.

    So with the 4Mhz crystal, how do I know that 18 is enough? How is it calculated?
    The BASIC program should specify what the clock frequency is, and produce delays accordingly. 18 is chosen because servos run on a 20mS repetition, with the active pulse being between 1mS or 2mS - so 18 and 2 make 20mS. The 20mS isn't critical, so the 19mS for a minimum pulse doesn't matter.


    And yes, I know I can't read a value from a Servo, and no, I'm not powering down the PIC, I'm powering down the Servo just like I typed the first time...

    Guess I'll have to come up with something machanical to read the position...
    Why do you need to do that?.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  5. #5
    savage Newbie
    Join Date
    Jun 2004
    Location
    Cape Town, South Africa
    Posts
    35

    Default

    4 Servos controlled by 1 Pic. All 4 Servos (mostly) will be kept in sync.

    In certain conditions, 1 or more of the Servos will be switched off and needs to go to idle (position). In other circumstances, the levers attached to the Servos will have to be controlled manually, instead of automatically.

    Think for example hmm.. A throttle handle.

    1) You can control the throttle manually by adjusting the position of the lever (here, I need to read the position), or
    2) The throttle can be automatically controlled by something else (in my case a pic), in which case I need to move the lever to the corresponding condition....

    Practical example... Throttle levers on a airplane?
    Regards,
    Chris.

  6. #6
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,759

    Default

    You wouldn't normally force a servo mechanically, it's not going to help it last very well - for your throttle example I would suggest a clutch between motor and lever, so the clutch slips if you push the throttle manually. You then need a feedback device on the throttle itself, so you don't need a servo to power it, just a motor/gearbox - the feedback device on the throttle then becomes the feedback part of a servo system - but externally, not in a single unit.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  7. #7
    evandude Good evandude Good evandude Good
    Join Date
    Oct 2003
    Location
    Maine, USA
    Posts
    1,395

    Default

    A servo is controlled internally by that type of feedback system; if you open one up you'll find a potentiometer, by which it measures its own position. To read the position of the servo, probably the easiest possible way would be to simply run an extra wire into it to directly measure the potentiometer output. What nigel says is entirely true though, the servo is probably not going to last long, especially if you use one of the ones with plastic gears instead of metal gears. If you're trying to build a high-quality system, a clutch-type setup as nigel suggests is probably a much better bet, but if you're just trying to throw something together that doesn't have to last forever, measuring the servo pot is probably the easiest and cheapest solution.

  8. #8
    savage Newbie
    Join Date
    Jun 2004
    Location
    Cape Town, South Africa
    Posts
    35

    Default

    That has crossed my mind yes... Re my reference to 'something machanical', it was precisely refering to a external or seperate module to read the position... It should be relatively easy to do with a couple of sensors, or even a POT...

    If the Servo is switched of, and you do NOT manually turn the Servo over it's min/max turn rate, surely it can't really cause damage?? Remember the enclosure for the throttles will have to automatically be able to turn 0 to 90 degrees... I'm thinking of making the enclosure so that the Servo can only turn 5 to 85 degrees (and obviously program the PIC as such as well). Thus, it will be impossible to over turn considering that you will hit the end of the enclosure 5 degrees before the over turn point of the Servo?
    Regards,
    Chris.

  9. #9
    savage Newbie
    Join Date
    Jun 2004
    Location
    Cape Town, South Africa
    Posts
    35

    Default

    Hmm Evandude... Good point. I wasn't thinking about the gears...

    I am talking very low RPM here for operational use... But point taken. Will have to spend some more time with the thinking cap on infront of the drawing board. Atleast I can control the Servos now
    Regards,
    Chris.

  10. #10
    eblc1388 Excellent eblc1388 Excellent eblc1388 Excellent eblc1388 Excellent eblc1388 Excellent
    Join Date
    Jan 2005
    Location
    UK
    Posts
    2,226

    Default

    Can you tell us more why can't you do the manual lever adjustment via the PIC using up/down buttons instead of manually moving the servo unit output lever?

    You may have to first disable the software servo auto adjustment loop first.
    L.Chung

+ Reply to Thread

Similar Threads

  1. 555 servo controller? can get them working
    By lompa in forum General Electronics Chat
    Replies: 19
    Latest: 6th November 2009, 12:59 AM
  2. Converting A DC motor to ServoMotor
    By holobean in forum Electronic Projects Design/Ideas/Reviews
    Replies: 22
    Latest: 31st May 2006, 10:01 PM
  3. Replacing RC Servo w/ Custom PCB (Open Servo)
    By dknguyen in forum Electronic Projects Design/Ideas/Reviews
    Replies: 3
    Latest: 29th May 2006, 02:48 AM
  4. Help required with servo motor controller
    By mayhem in forum Robotics Chat
    Replies: 3
    Latest: 26th May 2006, 04:21 PM
  5. Determining lifting capacity of a servo
    By Jerran in forum Robotics Chat
    Replies: 4
    Latest: 24th October 2004, 10:53 PM

Tags for this Thread