PBP projects for R/C models


Closed Thread
Results 1 to 40 of 772

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Thank you for your analysis

    Thanks gang.

    I came to much the same conclusion myself. I have been trying to figure out what exactly this PWM code does so that I can modify it meet the RC specs. The comments in the program are fairly clear. My first attempts have not worked but I am optimistic.

    Interesting how rusty my brain has become.

    Ken

  2. #2
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default All Right, I get it!

    Here is the code that makes the wheels spin.

    http://www.melabs.com/resources/samples/pbp/hardpwm.bas

    There are no PBP commands that overtly make pulses. They are created by appropriately loading CCP1CON and CCPR1L. I found CCP1CON easily enough. It is listed in the INDEX of the 16F887 Data Sheet. CCPRxL and CCPRxH are not in INDEX. They are quietly mentioned on page 127. But why is there no HPWM command per page 86 in the PBP manual?


    Although I see how this might be a low cpu overhead way to create PWM, I don't want to learn about this now. I want to use PBP and ASM commands to control my motor and servo. Maybe tomorrow all this will make sense.

    Ken

  3. #3
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default I need help

    The code in

    http://www.melabs.com/resources/samples/pbp/hardpwm.bas

    makes the wheels of my car go backwards in bursts. The bursts last, maybe 3/4 second then the wheels stop for a 1/4 second. I look at the code . I think that it is supposed to sweep through all pulse sizes in a second. I surmise the short ones are too short so the wheels don't move. As they get longer the come up near the low end of the electronic speed control spec. They start to move. Then the second is over.

    I would like to pump PWM pulses out CCP1 that have a frequency of one every 20 msec (50 per second) and a pulse width that I can (by changing the code) vary from 1 msec to 2 msec. Am I correct in guessing that the frequency of the pulses is dictated by the PAUSE command. One pulse per loop through mainloop:

    So far all my attempts have created no forward wheel motion at all! If one of you has the time please modify hardpwm.bas so that I understand it. Or, better yet, show me how to use PULSOUT. That does not work for me either.

    Ken

  4. #4
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Progress

    I've got code that searches for "duty" that runs the motor. I have found the region that drives it backwards and that keeps it motionless. So far i have not found the forward moving pulse size, but it will not be long now.

    Ken

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    A DC motor needs to have the polarity reversed to change the rotation???
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Yes, that is certainly true, but

    Yes, DC motors need the polarity changed to change direction. I was led to believe that there is something magical in this electronic speed control that made it work differently. Thank you for reminding me to question assumptions.

    Ken

  7. #7
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Maybe I need to use my dtdp switches

    If the electronic speed control does not reverse polarity as a function of pulse size, then I will need to use the technique Fritsl used in his wall hugging robot.

    http://letsmakerobots.com/node/928

    (which seems no longer available)

    He cross wired the motor with multiple DPDT relay switches controlled by his PIC. I was going to copy that idea, but then I started believing the story of the magical ESC.

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. PBP Extensions, What are they?
    By PJALM in forum PBP Extensions
    Replies: 9
    Last Post: - 28th September 2021, 11:26
  3. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 19:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30
  5. Making PBP code more modular
    By forgie in forum General
    Replies: 30
    Last Post: - 25th October 2005, 16:24

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