Scale from RC Radio 1% to 100% (Idea)


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Puerto Rico
    Posts
    133

    Question Scale from RC Radio 1% to 100% (Idea)

    I need to Run a DC Motor but in a scale...

    If some one dons this please help


    RadioScalefactor = ThrottleMax - ThrottleMin
    CycleStep =10

    Scale= ((Throttle - ThrottleMin) * 100/ RadioScalefactor )


    If (CurrentStep < Scale) And (Scale <= 100) Then
    While (CurrentStep * CycleStep < 100)
    CurrentStep = CurrentStep + 1
    Wend

    While (CurrentStep * CycleStep > 100)
    CurrentStep = CurrentStep - 1
    Wend
    End If
    MotorDc=CurrentStep (Motor Speed)

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jetpr
    I need to Run a DC Motor but in a scale...

    If some one dons this please help


    RadioScalefactor = ThrottleMax - ThrottleMin
    CycleStep =10

    Scale= ((Throttle - ThrottleMin) * 100/ RadioScalefactor )


    If (CurrentStep < Scale) And (Scale <= 100) Then
    While (CurrentStep * CycleStep < 100)
    CurrentStep = CurrentStep + 1
    Wend

    While (CurrentStep * CycleStep > 100)
    CurrentStep = CurrentStep - 1
    Wend
    End If
    MotorDc=CurrentStep (Motor Speed)


    Sounds to me like your talking about using pulse-width-modulation to run a DC motor on an R/C car or something.
    Correct?
    JDG

    EDIT: Added a bunch of stuff

    If you are talking about PWM, then it should be relatively easy.
    An R/C servo signal is generally a 50-ish Hz signal with a variable pulse, somewhere between 1-2ms, with a 1.5ms center.
    So, you set up an output to be a hardware PWM output (doesn't even have to be hardware, it could be an interrupt driven software PWM), say 5khz, and you vary the duty cycle according to the incoming pulse width.
    Let's just assume that the incoming pulse from the receiver is actually what I said above, 1-2ms with a 1.5ms center.
    You sample the incoming pulse width knowing those numbers (and they'll probably change depending on the software in the PIC, the R/C hardware, etc.etc. so you'll have to measure them somehow or set up something in software to do that for you).
    We've got the pulse width in microseconds, we subtract 1000 from it. That gives us a number from 0-1000, representing 0 - 100%. Let's just pretend (to keep the numbers simple) that number would actually go from 0-1023 (10 bit number). You could either divide that by 4 to give you a BYTE value for your duty cycle in the PWM register, or multiply it by 64 to give you a WORD value for the duty cycle register.

    And BAM. You're done. Feed that output into a few MOSFETs, and instant speed control.
    Of course, that's only if you're talking about one direction. If you're talking about both directions, then you have to add another bit, some more software, and maybe an H-bridge with and more MOSFETs to run the motor.


    Unless I've missed the point completely and you're talking about something entirely different, then I don't know Maybe...
    JDG
    Last edited by skimask; - 11th December 2006 at 04:17.

  3. #3
    Join Date
    Jan 2005
    Location
    Puerto Rico
    Posts
    133


    Did you find this post helpful? Yes | No

    Question Scale from RC Radio 1% to 100% (Idea)

    hey JDG
    Thanks
    PWM :

    yes one direction thanks but ken you send some code of how you do that.

    i need one idea from where to start

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jetpr
    hey JDG
    Thanks
    PWM :

    yes one direction thanks but ken you send some code of how you do that.

    i need one idea from where to start

    I've made my own R/C speed control, I know it can be done.
    I would give you code, but in the end, you will have learned absolutely nothing.

    So....Why don't you write some code, come up with an idea, anything...draw up a small schematic, and post them. The rest of us will most likely try and help point you in the right direction and get it working. Because, quite frankly, I gave you practically all the information you'd need to know in my last post.

    JDG

Similar Threads

  1. Replies: 5
    Last Post: - 2nd March 2006, 09:21
  2. RC measuring routine Radio PCM
    By jetpr in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th August 2005, 02:18

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