pulseout resolution


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Location
    NC, USA
    Posts
    53

    Default pulseout resolution

    I am trying to control a servo. Its actually a sail winch servo that turn 4 360 degree turns. With an RC controller I can adjust the servo in very small increament (~1-2 degrees). With a pulseout command of the PIC I can not acheive the same resolution. Is there way or a trick to sending out like a 152.4 ms pulse as an example? perhaps I should use the PWM? any ideas?

    Thanks
    Charlie

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Charlie,

    At 4Mhz OSC, the resolution of PULSOUT is 10us.

    The range of pulses required for servos is from 1.05ms - 1.95ms. That's a difference of 900uS. With 10us resolution you will get 90 steps of about 16 degrees each. Assuming a 4-turn rotary.

    At 20mhz the resolution is 2us, which will give 450 steps of about 3.2 degrees per step.

    At 40mhz you can get 900 steps of about 1.6 deg/step.

    Or, at 4mhz you can use this program to get 900 steps too.
    PWPS (Pulse Width Position Servo)
    http://www.pbpgroup.com/modules/wfse...hp?articleid=2

    HTH,
      Darrel

  3. #3
    Join Date
    Aug 2005
    Location
    NC, USA
    Posts
    53


    Did you find this post helpful? Yes | No

    Default

    The PIC is going to be doing some serial receipts, so I would prefer not to do the interupts of the PWM example. Anyway of using the hardware PWM? Or what about a timer to hold a pin open? I don't need to hold the servo, just set it.

    Although zooming the PIC at 40MHz may be the way. I was planning on using the 16F1628 and utilize its internal oscillator...

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    If you're going to be doing serial comms with a 16F628. Then all the more reason to use the interrupt driven version. I could see it if you could only use SEROUT2, but the 628 has a USART. With the PWPS program, it all happens in the background, leaving you to do HSERIN/OUT at your leasure, without having to worry about timing the serial stuff in-between the pulses.
    <br>
    DT

Similar Threads

  1. High Resolution Timer & Speed Calculator
    By WOZZY-2010 in forum Code Examples
    Replies: 4
    Last Post: - 7th February 2010, 16:45
  2. PULSIN & RCTIME resolution calculation
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th January 2010, 14:34
  3. DS1820 resolution
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 5th June 2008, 14:41
  4. Delay with 50nS resolution...
    By batee in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd May 2006, 22:12
  5. More accurate resolution from the A/d converters
    By pjsmith in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th August 2004, 22:49

Members who have read this thread : 0

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