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

    Again kind of crude.
    A large comment block at the end of the code. 'Notes
    And or a text file. Kind of like a daily log.

    I keep current project in DopBox so I can at least look at the code and take notes in the field on my phone if I do not have a computer with me.

    Evernote is pretty good also.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    Dave,

    do you keep the *.bas, *.pbp in the default directory? Does compiler have any problem with the path?

    I am considering to keep my files there too.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    Ioannis,

    I let PBP and MPLAB install to their default directories, but my actual code and related project files are kept here.
    C:\MAC\My Dropbox\PIC PROGS\"project name here"
    Cad/CNC files and such are in a sub directory of the above.

    Another benefit from having an off site backup... My CNC machine's PC is also DropBoxed so the machine always has the latest files automatically.

    No problems with the path, the path name is still under the length limit this way.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    OK, Thanks Dave.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Red face Calling all Geeks......

    Ladies and gentlemen - I am bamboozled. My 1/10 toy level car seems to be a bit confused also. Garbage in. Garbage out. The old give-no-quarter rule of programming. Is the issue response time? Is the issue inconsistent friction? Is the issue - no it couldn't be - my PBP code? I believe the electronics are consistent and the hookup wires are stable ( I used Silicone household sealant)

    In the video I say, "As soon as it starts to turn right, it's in trouble." That now seems not to be the problem. After it successfully negotiates a corner-caused left turn and it is too close to the new wall, it turns left to get out to desiredtrack, but never straightens out.

    The code is at: http://www.employees.org/~kjones/ToyCarKickTurn4.htm



    Any insight would be greatly appreciated.
    Ken

  6. #6
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default my $.02

    Its really cool!! It has come a long way, in a very positive way.

    When its stuck, I see 2 distinct possibilities. the first time when the car was perpendiculer to the wall, my guess was it was too close, therefore the front sensor missed the echo. the second and third times, when it was trying to go forward into the wall, my guess is the angle was just right so as the reflection of the sonar bounced off the wall and kept going forward so the car thought it was all clear ahead.

    One time towards the beginning it ran head on into the wall. it went straight back, I am not sure if it bounced or if the car said reverse.

    Overall it seems like response time may be the issue. are you able to slow the car when the front is blocked and needs to turn? If so, maybe cut the speed to half when the front is blocked. then on the all clear go back to full ahead. I don't think the car is able to make the turn, check the front, check the side and continue forward.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

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


    Did you find this post helpful? Yes | No

    Smile You might be absolutely correct.

    I suppose an echo has a significant energy distribution pattern which is a function of the angle on incidence. I do not know the physics but it certainly seems reasonable.

    Thank you!

    Ken

  8. #8
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    You got it Ken. Your ICSP pins are RB7 and RB6. I think I have the definitions right for you. So you should be able to get it to talk pretty easy.
    Attached Images Attached Images  
    Last edited by ScaleRobotics; - 31st January 2011 at 01:54.

  9. #9
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    Friction is sure a problem with your car along with others...

    Try to increase the friction with this simple idea.

    Cut from a kitchen glove the fingers and place the cut parts on your wheels. I think these will last for a test run, at least.

    With the increased friction you will get over the overturning of the car.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Smile Two steps forward....

    1. I cobbled together the working parts of two DELL 8600 lap tops and created one that works!! I installed the PBP tools and have a strong new battery. I will be able to modify my code in the building - sans electricity and heat - where I test.

    2. I found that putting a cardboard right up to the front SONAR makes it behave as if there is nothing within range. Sooo up real close is far away as far as it is concerned.

  11. #11
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Hi Ioannis,

    Yes, it takes TTL True, so Ken can do debug something like this for his setup:

    Code:
    DEFINE DEBUG_REG PORTB      'This is set to match the ICSP pins
    DEFINE DEBUG_BIT 7          'PIC sends data to the PC on this pin
    DEFINE DEBUGIN_BIT 6        'Can be used to receive data from the PC
    DEFINE DEBUG_BAUD 38400     'This is the highest baud rate Pickit2 can handle
                                'It seems to work ok with my 8 mhz stuff and higher
    DEFINE DEBUG_MODE 0         'Sets debug to True levels (1 for inverted)
    Last edited by ScaleRobotics; - 30th January 2011 at 22:08. Reason: Edited for Ken's hardware

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


    Did you find this post helpful? Yes | No

    Default The pin assignments

    My PICkit2 communicates with my PIC on its pins 4 and 5 already. Are you saying that after it is downloaded and running, my code can use the same USB wire to talk back to the PC? And I can display what it says using the DEBUG tool.

    Ken

  13. #13
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    As Walter stated, exactly that Ken!

    So, this is a great tool. I wonder why Pickit3 does not support this handy idea.... Mysterious way Microchip works...

    Ioannis

  14. #14
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: PBP projects for R/C models

    It's in there ... about 1/4 the way through.
    Code:
    ;****************************************************************
    ;* HPWM       : Output a pulse width modulated wave in hardware *
    ;*                                                              *
    ;* Input      : W = channel 1 - 5                               *
    ;*            : R1 = frequency                                  *
    ;*            : R4 = duty cycle                                 *
    ;* Output     : None                                            *
    ;*                                                              *
    ;* Notes      :                                                 *
    ;****************************************************************

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


    Did you find this post helpful? Yes | No

    Smile You're correct. It is there!

    I must have spelled HPWM wrong.

  16. #16
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Hi Ken,

    DIG is for digit. Nothing in there needs any include file. Dig is covered in the manual, but you have to look around a little bit for it. DIG returns the value of a decimal digit.

    C var byte
    D var byte
    C=123
    D = C DIG 0 ; Makes D = the lowest digit of C (3)

    When I mentioned debug, I meant the DEBUG command. It lets you send serial out of any one of your PIC's pins. Then you can use the Uart tool on your Pickit2 to read any value you want. Much simpler than Mplab debugger if you ask me.

    Name:  Uart-Tool.PNG
Views: 1584
Size:  29.2 KB




  17. #17
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    Hi Walter.

    I saw this picture of Pickit2 with UART connection. Does the PIC connect to Pickit2 as TTL level serial link?

    Ioannis

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