Announcement

Collapse
No announcement yet.

More Servo

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • More Servo

    I was looking at a Melab's sample program for servos and from what I've learned I thought that it wouldn't possibly work after getting my servo going but I tried it with little modification (I wasn't using the Lab-X or the same PIC). And it didn't (work) at least properly. The main flag I saw was in this following section/code below because the timing of the pulse seems wrong from everything I've seen. Can anyone tell me how this could have worked under some circumstance other than a normal servo situation? The original program is here;http://melabs.com/samples/LABX1-16F877A/servox.htm :



    servo1 = 1 ' Start servo pulse





    53 Pauseus 1000 + pos





    54 servo1 = 0 ' End servo pulse





    55 Pause 16 ' Servo update rate about 60Hz





    56 Goto mainloop ' Do it all forever

  • #2
    For starters it should be

    PAUSEUS (15660 - POS) for the correct frame timing.
    Dave Purola,
    N8NTA
    EN82fn

    Comment


    • #3
      AFAIK the servo expects a ~50Hz PWM signal with a positive pulse width of 1000 to 2000us. The servo position is encoded in the width of pulse and the exact frequency usually isn't very critical.
      So, what do you think is wrong with the timing?

      /Henrik.

      Comment


      • #4
        Well, I am wrong as well, not thinking about 50 Ms. and looking at his code I adjusted the timing for 60Hz. as in the comment. It should be:

        PAUSEUS (19000 - POS) for the correct frame timing of 50 Hz. Not enough coffee I guess...
        Dave Purola,
        N8NTA
        EN82fn

        Comment

        Working...
        X