PBP projects for R/C models


Closed Thread
Results 1 to 40 of 772

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    I am not good at figuring execution times but there is a thread around here some place talking about it... i can not find it

    I do see a 200 pause, add that to the IF/THENs...

    On the bench just to see you could remove some of the code and see it the LEDs blink faster. A primitive way yes. All I can say at the moment.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    What about PULSIN?

    It has 16 bit resolution and at 4MHz, the PULSIN resolution is 10uS.
    If you DON'T receive a pulse doesn't the PIC wait for 65535 x 10uS (0.655 seconds) before it "moves along" to something else?
    Perhaps you need a define to determine the max PULSIN time?

    IE:
    PULSIN_MAX 1000 'Maximum counts allowed before pulsin times out


    Just a thought.


    steve

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    Is it possible to place the car on a stand and the camra above it. Then have an object approaching form the side and back again so we could see the reaction of your sytem.

    Then I would suggest the ue of he PID routines of Henrik that are on this link to obtain smooth control: http://www.picbasic.co.uk/forum/showthread.php?t=5874

    Ioannis

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


    Did you find this post helpful? Yes | No

    Smile I sped things up a bit.....

    Inline code is probably faster than subroutine based code. I commented out all the HPWM subroutines and substituted in place of their calls the HPWM statements themselves.

    My guess is that the SRF05's are blinking faster. That is very good.

    I checked the SRF05 responses. They seem to be immediately after the one millisecond trigger pulse. PULSIN should not be timing out, but that is a vulnerability worth considering.

    Ken

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


    Did you find this post helpful? Yes | No

    Default PULSIN is part of the problem!!

    I did a DEFINE PULSIN_MAX 1000 and the car is falling into my 'failed' because 'rangefront' or 'rangeright' equals zero. Interesting!! Something there is not consistent.

  6. #6
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default

    You'll probably need a longer timeout than 1000.
    That would only be 10mS that it waits.
    Maybe try 10000?

    Fool around with it a bit. It needs to be long enough to see the whole pulse, but short enough that it doesn't waste excessive time waiting.


    steve

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


    Did you find this post helpful? Yes | No

    Default Voltage supply seems to make a difference

    When running independently off the 7.2v voltage regulated battery the SRF05's seem more consistent with their responses than when running off the PIKkit2 USB provided 5volt supply. Interesting if true.

    Thanks again, all...

    Ken

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


    Did you find this post helpful? Yes | No

    Default It gets interestinger and interestinger....

    Added complexities. Classic amateur robot stuff I would guess.

    1. The sonar proximity detectors have a fairly wide field of "vision". If the car bumps against the side wall at a sharpish angle, the front detectors see the wall. The program thinks the car has come to a corner in the room and makes a maximum sharp left turn. This sets the car up for a very zigzag pattern.

    I tried making a "megaphone" for the front sonar pingers out of the cardboard tube on a toilet paper roll. The sonar "detected" the tube. Hmmmm

    2. When the battery begins to fade the car has a difficult time moving from a dead stop. Given a nudge, it takes off. The net behavior becomes quite different. Discombobulating to say the least.

    3. The wheels and the steering servo still appear to be reacting too slowly. Exactly what is the problem is not clear.

    That is the report for today...

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