DC to servo pulse converter


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Location
    Cambridge UK
    Posts
    45

    Default DC to servo pulse converter

    I have a eflite blade MSR I would like to convert it from its coreless motors to brushless motors. I have all the hardware main and tail motors and two esc's here. What I need to do is convert the motor voltage into a servo pulse to control the brushless side. I can read a adc on a pic12f675 and convert it into a servo pulse in a crude form.

    These are the settings for the ADC plus code;
    DEFINE OSC 4
    DEFINE ADC_BITS 10 'DEFINES RESOLUTION
    DEFINE ADC_CLOCK 3 'DEFINES ACD CLOCK SPEED
    DEFINE ADC_SAMPLEUS 50 'DEFINES SAMPLE TIME OF 50ms
    ANSEL = %00001000 'TURNS ON A2D THREE

    Main:

    ANSEL = %00001000 'TURNS ON A2D THREE
    ADCIN 3,pos 'READS A2D AND PUTS THE RESULT IN THE POS REG
    pos = pos/8 '1024/8 = 128
    pause 20
    pulsout 2,72 + pos 'SERVO PULSE IS BETWEEN 0.72mS AND 2mS

    goto main

    Would the adc as configured be fast enough to read the fast changing tail motor voltage? If not what would the best way be to acheive this?

    ........thanks for your time

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Talking re-inventing the wheel ...

    Hi, Nick

    If I Understand it well ...

    you'd like to measure a PWM signal mean value ( Which period ??? good question ) to another PWM signal with a ~ 50 Hz period ...

    may be @ first try you should place a lo pass filter before entering the ADC ???



    BUT just note the PWM signal you swear to create ... already exists into your receiver ( see related forums where all those mods have already been explained ... hundreds times !!! )

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Nov 2005
    Location
    Cambridge UK
    Posts
    45


    Did you find this post helpful? Yes | No

    Default

    Hi Alain,
    Thanks for your relpy, I understand about the low pass filter. I dont understand that the pwm signal I want is on the board. As far as I am aware the MSR receiver produces signals to drive a motor directly.
    You refer to rc forums, do you mean "thesteve" converter? I am using this on one of my projects, but would like to write my own code for the pics I have here.

    ......Nick

Similar Threads

  1. More Servo Woes
    By chrisshortys in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 13th May 2009, 08:40
  2. DC volts and A/D converter
    By michel in forum Schematics
    Replies: 3
    Last Post: - 17th September 2008, 11:44
  3. Servo does not move
    By ruijc in forum General
    Replies: 12
    Last Post: - 12th November 2007, 19:14
  4. R/C Servo pulse Monitor
    By Harddkyss in forum Code Examples
    Replies: 7
    Last Post: - 25th February 2007, 15:00
  5. servo pulse problem...
    By tonkgang in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th April 2006, 16:12

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