1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Servo motor

Discussion in 'Robotics & Mechatronics' started by uaefame, Oct 27, 2008.

  1. fsmyth

    fsmyth New Member

    Joined:
    Jun 16, 2008
    Messages:
    39
    Likes:
    0
    Location:
    texas
    Here is a couple of 555-based servo testers:
    Servo Drivers and Circuits
    Not my designs; I usually just program whatever uC is handy
    to send the correct pulse train.
    <als>
     
  2. uaefame

    uaefame New Member

    Joined:
    Feb 22, 2008
    Messages:
    271
    Likes:
    9
    Location:
    Dubai, UAE
    I already build it!!

    Nothing happen nothing rotate.

    First about my project: my instructor or advisor decided that we just need to go as far as we can because he say if we never have a deadline you will never keep pulling things.
    He is not interested about the result of the competition. He is interested how far we go. How much we learn!

    Second about 555 timer, I build servo driver for my ds8911 servo but nothing happen here are several question i need to ask.
    Q1> How you know for P1 where is 1 2 or 3?? or 1 and 3 doesn't really matter? just the middle one matter :)

    Q2> I am sure that i need higher frequency rating. The one I am using now is 50Hz. I think i need to come up with a new design for 555 to run my servo motor. As the tutorial mentioned at the end there are new bread of servo motor which are know as digital servo motor. These motor need higher frequency to operate. I operate my servo motor using function generator at 300Hz. But 300Hz is just a guess. Because time is critical now, I will go with 300Hz.
    If you know how I can set the period using PIC16F818 it will be great.

    For fun I just bought a PIC 16F877 it so big hehe :) 40 legs
     
    Last edited: Nov 9, 2008
  3. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Why not learn to use MPLABs built in simulator. Try to generate a 1.5ms wide pulse with a 20ms period. The stopwatch function is quite handy.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. uaefame

    uaefame New Member

    Joined:
    Feb 22, 2008
    Messages:
    271
    Likes:
    9
    Location:
    Dubai, UAE

    Thanks blue for replying,

    I connect the wires again and Ya its working now. But its shaking (jittering) in the desire place. I am not sure what wrong.

    When I used function generator to operator it. It operates, but the problem is I am confused which parameter I am suppose to change duty cycle or period? Look at the diagram to understand more.

    When I kept the duty cycle at 50% it operates from 0 to 120 by changing the period from 1.6ms till 4.3ms.

    But when i kept the duty cycle at 20% it change from 0 to 120degree by changing the period from 4.1ms till 10.9ms.

    I am confused which paramerter to change duty cycle or period. Both work, but which one is better?

    When the frequency is 500Hz i can change duty cycle from 21%-62% to have that interval.

    Q2> I am using pulse in function generator and its working fine when I use square wave it going crazy or jittering. You know how I can produce pulse using PIC? Any ideas?

    Thanks in advance
     

    Attached Files:

    Last edited: Nov 10, 2008
  6. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Stop fussing with the function generator and guessing at values. Servos have specific parameters if you want them to function.
    Here's my advice
    Write code for whatever PIC you plan on using in assembler that will output a 1.5ms pulse every 20ms to port RA0 and run it using the MPLAB simulator. Stop playing with stupid values you think might work and start following specifications. You are proceeding at a snails pace because you simply don't seem to follow advice.
     
    Last edited: Nov 10, 2008
  7. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    5,897
    Likes:
    502
    Location:
    Cleveland, OH, USA
    ONLINE
    I agree with Bill about the stop fussing aspect and have a little experience with running model servos at more than 50 Hz.

    At frequencies a lot higher than 50 Hz, you have no idea what the servo is "seeing." For example, 500 Hz is 2 ms per cycle, which is what the servo expects to see as its control pulse, not frame rate.

    As for the shaking, when I ran a different brand servo (Hitec) above 150 Hz or so, I still had control of movement, but lots of buzzing and shaking.

    John
     
  8. uaefame

    uaefame New Member

    Joined:
    Feb 22, 2008
    Messages:
    271
    Likes:
    9
    Location:
    Dubai, UAE
    I build this servo motor circuit When I read the signal using Oscillascope it was reading Fine AMP +5V OnTime 1.8ms for 2.2V Analog input.
    When I connect my servo it started shaking around? Any ideas why it keep shaking?
     
  9. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    5,897
    Likes:
    502
    Location:
    Cleveland, OH, USA
    ONLINE
    What's your frame rate? Did you read my post about digital servos and 555 drivers (October 28).

    The shaking may be because your frame rate is too fast or just a characteristic of the circuit you are using.

    John
     
  10. uaefame

    uaefame New Member

    Joined:
    Feb 22, 2008
    Messages:
    271
    Likes:
    9
    Location:
    Dubai, UAE
    Ya the frame rate is 23ms.

    Any idea why it's shaking.

    Can't find your post?
     
    Last edited: Nov 21, 2008
  11. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,019
    Likes:
    317
    Location:
    Brisbane Australia
    ONLINE
    If your frame rate is 23mS then either your power supply is glitching or your on time is varying. Or, your servo is knackered.

    Mike.
     
  12. uaefame

    uaefame New Member

    Joined:
    Feb 22, 2008
    Messages:
    271
    Likes:
    9
    Location:
    Dubai, UAE
    You mean I use another power supply?

    I don't think it's tired. I just using a new one :) I have plenty of samples here 18 pieces
     
    Last edited: Nov 21, 2008
  13. uaefame

    uaefame New Member

    Joined:
    Feb 22, 2008
    Messages:
    271
    Likes:
    9
    Location:
    Dubai, UAE
    I wrote these codes in PIC16F84a
    Code (text):

        list      p=16F84A             ; list directive to define processor
        #include <p16F84a.inc>         ; processor specific variable definitions

        __CONFIG   _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC

    org 0x0
        cblock 0x0c
        d1,d2,d3
        endc

            bsf     STATUS,RP0
            movlw   b'00000'
            movwf   TRISA
            bcf     STATUS,RP0
           
    START   movlw   b'11111'
            movwf   PORTA
            call    Delay2msec
            movlw   00h
            movwf   PORTA
            call    Delay18msec
            goto    START

    Delay18msec
                ;17993 cycles
        movlw   0x0E
        movwf   d1
        movlw   0x0F
        movwf   d2
    Delay18msec_0
        decfsz  d1, f
        goto    $+2
        decfsz  d2, f
        goto    Delay18msec_0

                ;3 cycles
        goto    $+1
        nop

                ;4 cycles (including call)
        return

    Delay2msec
                ;1993 cycles
        movlw   0x8E
        movwf   d1
        movlw   0x02
        movwf   d2
    Delay2msec_0
        decfsz  d1, f
        goto    $+2
        decfsz  d2, f
        goto    Delay2msec_0

                ;3 cycles
        goto    $+1
        nop

                ;4 cycles (including call)
        return


        END  
     
    The motor goes to the desire angle :) but it shake every 0.5second and stop shaking for 1second then shake for 1/2second and doing it again and again :( Anyone know why?
     
  14. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Put your scope on the servo pin or run it through MPLABs simulator.
     
  15. uaefame

    uaefame New Member

    Joined:
    Feb 22, 2008
    Messages:
    271
    Likes:
    9
    Location:
    Dubai, UAE
    I finish my testing and I know the working range of my servo motor its between 0.8ms and 2.1ms the angle don't know still need to get it soon :).

    About shaking i will do as you said bill.

    You think the control wire consume alot of current? More than the PIC can handle ? Or I am thinking too much?

    Thanks in advance
     
  16. uaefame

    uaefame New Member

    Joined:
    Feb 22, 2008
    Messages:
    271
    Likes:
    9
    Location:
    Dubai, UAE
    Hello again,

    I did the oscilloscope test it fine :) I can see nice square wave.
    I am using the same power supply for the servo and the PIC you think that has to do something with it?

    BUT the skaking is still there :(

    Thanks in advance
     
    Last edited: Nov 21, 2008
  17. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    The servo control wire draws very little current. Many servo controllers have 100ohm resistor in series anyway.
     
  18. uaefame

    uaefame New Member

    Joined:
    Feb 22, 2008
    Messages:
    271
    Likes:
    9
    Location:
    Dubai, UAE
    THanks everyone for replying,

    Q1> I have PIC16F877, HOw many servo motor can be controlled using it?
    Q2> I need to send same command to 3 servo motor at the same time, do i hook up the RB0 to 3 servo motor?
     
  19. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    A skilled programmer could drive as many servos as there are output pins.

    One Output pin per servo

    Stop worrying about servos till you unterstand the PIC and MPLAB better.
     
    Last edited: Nov 22, 2008
  20. uaefame

    uaefame New Member

    Joined:
    Feb 22, 2008
    Messages:
    271
    Likes:
    9
    Location:
    Dubai, UAE
    I am trying to design a power supply for my servo motor.
    Number of servo = 18
    Servo specification
    Torque: 347 oz/in @ 4.8V, 403 oz/in @ 6V
    Speed: .19 sec/60° @ 4.8V, .15 sec/60° @ 6V
    Current rating i heard it is 2.5A at max not sure ....

    Any idea how my power supply should be or ratting ?
     
  21. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    5,897
    Likes:
    502
    Location:
    Cleveland, OH, USA
    ONLINE
    Not sure exactly to what that current rating refers. Is it per servo? Those are pretty hefty servos in modeler's terms. I would not be surprised at the current rating per servo. Then you have to consider what the loaded and stalled currents are.

    For example, in a simple model with typical servos (6) I use a switching supply capable of several amps, because during critical phases (like putting flaps at 90% on a fast landing approach), current drains can be quite high. I have been told more than a amp per servo, and these are just 40 in/oz servos.

    Thus, can you get current drain under load and at stalled? How many servos will be loaded or stalled at the same time? How critical/damaging will it be if the supply shuts down due to overload at some point?

    John
     

Share This Page