DT-int and SPWM


Closed Thread
Results 1 to 4 of 4

Thread: DT-int and SPWM

  1. #1

    Question DT-int and SPWM

    Hello All,

    So I have abandoned using asm interrupts in PBP on 16F1827 and I am now looking at Darrel's interrupts. In particular I want to generate and update 4 pwm channels. These channels are connected to 4 hobby servo's that need to start moving at the same time (sync start) but whose timing (pulse width changes 1 ~ 2ms). The refresh rate is 50 Hz or 16 ~ 20ms.

    Has anyone used Darrel's SPWM for this application? Any help would be appreciated.

    Best Regards,
    Nick

  2. #2
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: DT-int and SPWM

    Hi Nick, Just to be clear, Do you mean you can't have the servo pulse sent to each sevro in series as happens with a regular R/C Rx? I assume if the answer is no you can't, I am sure you have a valid reason not to be able to have the possible 2mS lag from 1 to the next. I will tell you it is the easier way to handle this.

    A pointer for you - In the other thread I see you were using the interrupt to control when to update the servo. So I assume it fired every 16-20mS or so. May I suggest you set that up as a 1mS timer. Then increment a counter in the ISR and leave. In your main, check if the timer = 16 (or whatever your frame rate need to be) then update the servos.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  3. #3
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: DT-int and SPWM

    This won't help you if they all need to have the same sync start, but you might be interested in this. A while back I did wrote code for a PIC12F683 servo pass through device. It used DT_INTS, but not his SPWM. Most of the code for the servo's is in asm, to make it respond faster. It listened for the receiver pulses, times them, and then sends them out to the servo's, allowing you to adjust them with input from say, gyro's, or whatever type of input you want.

    http://www.scalerobotics.com/71-pwm-passthrough.html
    http://www.scalerobotics.com

  4. #4


    Did you find this post helpful? Yes | No

    Question Re: DT-int and SPWM

    Thanks guys for your responses. I want to be able to update the servo positions all at once. I am using the servo's in continuous rotation and need to minimize lag between issuing commands to the modified servos. The platform vehicle I am working on needs to have synchronized motion of all 4 servos attached to wheels.

    A colleague suggested to use a PICAXE which has a SERVO command that allows up to 8 servo's at once. The output pulses to all the servo's start at once (obviously some pulses will be shorter than others depending on position 1 ~ 2ms). There has to be a way that I can do it on a PIC without assembly.....the scope of this project is too big to spend all my time on assembly code.

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