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

    Smile I found it

    On page 251 of DS33014K in Appendix A. is the list of ASM instructions.
    I had printed out that document last winter. Until now I did not find this list. (Except in a book printed by MikroElectroika in Belgrade.) I think this list ought to be the first thing in Chapter One!

    Thanks, all. Gotta "hit the books".

    Ken
    Ken

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


    Did you find this post helpful? Yes | No

    Wink Things are going a bit better

    I have not yet had to fall back on ASM code.

    I did discover:

    1. My PIC was resetting because of regressive subroutine calls. Changing a couple GOSUB's to GOTO's solved that.

    2. My car was not being driven smoothly because of occasional zero responses from the SRF05's (or at least one of the SF05's). Implementing a - check again if the sensor says zero - routine after polling the sonar sensors smoothed things out.

    I did notice that adding an IF THEN statement to the PBP code increased the size of the HEX code considerably. I still feel I need to understand the two compile processes.

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


    Did you find this post helpful? Yes | No

    Smile Things must get faster.

    Today I gained access to an abandoned gymnasium.

    Immediately I realized that to make this project 'interesting' to middle school students I must greatly increase the speed. I will need to adjust the distances which trigger the car's autonomous maneuvers. My next video will be of this car racing and toggling between PIC and RC control.

    Ken

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


    Did you find this post helpful? Yes | No

    Angry Frustration, thy name is speed.

    Not going well at all.

    When I up the speed the car does not respond quickly enough. At a corner Instead of seeing (hearing) ahead and turning, it crashes into the on coming wall, backs up, and tries again. Part of my problem is not understanding the machine language code behind the PICBASIC PRO commands. Another part is the PIC getting into little loops or resetting and thereby ignoring the real time signals. Lastly I need to expand the distances to which the code reacts. If the velocity is greater, it must start turning or braking sooner.

    On the bench, the machine seems to behave as expected, but on the race track. NOPE.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    Hi Ken,

    I may have a solution to your problem, or part of a solution...

    I picked up a PING module the other day and did some playing and watched the last video you posted very close.

    My conclusion is you need to run the PIC at 20MHz.
    I am running a very basic code to calculate distance so my findings may not be a total solution.

    Watching the video it appears the car is pointing more at the corner the first time through, and the second time when it does not hit the wall it is just a bit to the right and a little more straight on. When I try corner targets the reading becomes very erratic. Maybe for you have the front sensor pivot slightly from left to right. Could be done with a spring and a cam bumping on the wheels?

    Back to the software. I am using a PIC running a 20MHz.
    When I set the PULSOUT at 10 giving the 20us you have in your code the readings become inaccurate with a great deal of fluctuation and slow to respond.

    When I set the PULSOUT at 2 giving a 4us pulse the accuracy is within an inch and very very quick to respond.
    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

    Question Dave, thanks!

    First, my oscillator. I have been using the 16F887's internal oscillator. I think if I do nothing my prescaler is set at 4:1. The PIC has an 8mhz internal oscillator. Figure 4-1 on Page 61 of DS41291F (the x887 gospel) indicates that by setting OSCCON = %01110111 I can get the internal 8mhz oscillator and the prescaler of 1:1. Does this seem correct to you all? I will try this evening.

    What do I need circuit-wise to implement the 20Meg external crystal oscillator?

    Second, the placement of my forward looking SRF05. I thought I found that slanting them to the left just a bit makes less possible reflection from the side wall coming into the front pingers. That seemed to work on the bench, but again confusion in the real world. I have not thought through what the side pingers should be hearing while the car is turning left. For racing I have moved the desired track out to 24 inches away from the side wall.

    Using a carpenters measuring stick I have calibrated my pingers. They seem consistent (again on my bench).

    Ken

  7. #7
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kenjones1935 View Post
    First, my oscillator. I have been using the 16F887's internal oscillator. I think if I do nothing my prescaler is set at 4:1. The PIC has an 8mhz internal oscillator. Figure 4-1 on Page 61 of DS41291F (the x887 gospel) indicates that by setting OSCCON = %01110111 I can get the internal 8mhz oscillator and the prescaler of 1:1. Does this seem correct to you all? I will try this evening.

    Ken
    The oscillator (whether internal or external) frequency is always divided by 4 in these PIC's to get the instruction clock - it does not have anything to do with pre-scalers. Also, OSCCON.3:1 is read only.

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