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 I don't understand

    Joe,

    Are you saying that all I need to do to use PORTB is figure out how to appropriately configure it?

    If so, please give me a hint? I am soooo close.

    Ken

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kenjones1935 View Post
    Joe,

    Are you saying that all I need to do to use PORTB is figure out how to appropriately configure it?

    If so, please give me a hint? I am soooo close.

    Ken
    Ken,
    I am not an expert on pulseout or pulsein, and I have not read the manual lately, but I believe they are digital commands, which by default should require you to disable the analog functions on the pin you are using.
    On this chip you have,
    ADCON0
    ADCON1
    ANSEL
    ANSELH
    CMCON0
    CCP1CON
    CCP2CON
    CM1CON0
    CM2CON0
    CM2CON1 and a couple more which all have effect on the I/O. Get into the data sheet and read about them, they are all listed in the index of the data sheet, and see how to set them up. Remember if a bit is SET it is a 1 if cleared it is a 0.
    When you come out of the data sheet you will be a much more "Savy" programmer.
    Last edited by Archangel; - 2nd March 2010 at 15:26.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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


    Did you find this post helpful? Yes | No

    Default I think I've got it. By George I've got it.

    My problem was that the length of the PULSOUT pulse was way toooo long. This was true even if I did a PULSOUT trigfront, 1.

    So I changed it to:

    HIGH trigfront
    PAUSE 1
    LOW trigfront.
    It seems to respond correctly on its blocks with me moving a oak cutting board in front and on the right side to simulate inside a room with no furniture.

    The battery needs charging and I need to neaten up the bundle of wires. I feel a video might not be long in coming.

    Thanks, gang. Whomever you are.

    Ken

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


    Did you find this post helpful? Yes | No

    Default My idea may have a basic flaw....

    I've got the car driving around using HPWM to control the electronic speed control and the steering servo. This is a high quality hobby level car. It seems to not react quickly enough to the PIC commands. It was designed to have a person at the radio transmitter controlling with finger and wrist movements while watching how the car performs. This is a beautiful mechanism when human judgment is included.

    A toy level car runs the wheels with direct current. The steering is a bang bang servo with a mechanical mechanism forcing it straight. Fritzl used a toy level car in his wall racer. http://letsmakerobots.com/node/696

    I have added 'kickers' to the steering commands. Realizing that steering straight is the servo's action when given no current, I figured that transitioning from hard left or hard right to straight might be faster if the go straight HPWM command were preceded by a momentary hard shot to the opposite extreme. My first experiment did little to improve response.

    Of course it might be that my car needs a grease job.

    Hmmm....

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    COOL!!! It works!!!
    Videos???
    Of course it might be that my car needs a grease job.
    Or may the code is rusty?

    Are you using interrupts or just running straight?
    The PIC should be able to react faster than humans.
    Last edited by mackrackit; - 4th March 2010 at 03:35.
    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 Running straight poling continuously

    It is not that he PIC is slow, I think it is that the steering mechanism is too complex. It is a close match for what is in a real automobile. I need to get the car to go slower if it is going to drive along a wall no more than 15 inches away.

    My code also needs some serious tweeking.

    Ken

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


    Did you find this post helpful? Yes | No

    Default Up on blocks it does the correct stuff

    When up on blocks and I am fooling the sonar with my hands. (Remember it is supposed to hug the walls and thereby go around a room counter clockwise looking down.)

    It:
    1. goes straight when my hand is about 10 inches away on the car's right side and nothing is in front.
    2. turns right when my hand is more than 10 inches away on the right
    3. turns left when my hand is 15 to 20 inches away up front
    4. goes backward when my hand is much closer up front. Once it has retreated 15 to 20 inches it turns left and tries again.

    When on the floor the car is too fast for the PIC driven steering mechanism. It bumps into things, retreats, turns, and comes flying forward. It is too fast for me.

    It is behaving similarly to those floor vacuuming robots only way too fast. I have the electronic speed control at its slowest PWM settings.

    Needless to say, manipulating a video camera while waving my hand at this machine ain't easy.

    Ken

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 : 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