PBP projects for R/C models


Closed Thread
Results 1 to 40 of 772

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,116


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    Sounds like you need to limit your angle as you turn into the wall.

    When adjusting right to get to your imaginary line (closer to the wall), if front distance < 3 * side distance, then turn left (until front distance > 3 * side distance). Something like this should help keep from making too big of a right turn, but still get you closer to the wall.

    Changing the 3 would change the angle you would allow.
    I am pretty sure this method will lead to oscillations. In fact in the Ken's video this really happens. The car "oscillates" around its desired path.

    With simple if-then commands this cannot be compensated. As discussed in previous post, a PID loop control can help.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Smile I did as scalerobotics suggested and

    it worked better. Now it goes pretty straight but does not turn left hard enough when confronted with a corner. Watching and listening to my video I conclude that at this speed with this little friction the PIC needs more warning (I only gave it 53 inches) to turn sharply left. I'll change that and try again tomorrow. Also this sharp left turn should not be modulated. It should be bang.

    It is a bit of a drive to my deserted gym. It has no heat and no electricity. My laptop crashed a few weeks ago. So one fix on my desktop PC, one test.

    A question: Do you folks recommend any editor that automates my version control? I would like to start with version 1.0 then activate an editor that automatically adds each of my code changes one batch at a time. If I had that I could recreate any past version.

    Presently I am saving the versions identified by their checksum. That is clumsy.

    Ken

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


    Did you find this post helpful? Yes | No

    Smile Post Script

    I like the sliding robocar. If I want solid control I would go back to the 1/10 scale hobby level car. There are many available rubber compounds for the hobby car wheels. They have caster, toe-in, four wheel drive and weigh four pounds.

    Sliding looks like dirt track racing. When I was a kid we had midget car racing with little four cylinder Offenhouser engines on a 1/4 mile dirt oval. I did not do it, but I sure did watch.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    Versions..
    Might be kind of crude, but I just copy the *.bas file and paste it into the same directory. The the copy has Copy(x) added to the file name. Then the date and time stamp can be referenced.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Question How do you keep track of the changes?

    How do you keep track of the details of each change? Comments grow and grow and grow...

  6. #6
    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.

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,116


    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

  8. #8
    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.

  9. #9
    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: 1417
Size:  29.2 KB




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


    Did you find this post helpful? Yes | No

    Default

    You mean something like post# 649? http://www.picbasic.co.uk/forum/show...6577#post96577

    But since you have a Pickit2, it would probably be nice to put your car on a bench, leave your Pickit2 tethered, and use the Uart Tool. You can give all kinds of info from your pic out to your computer screen. You can have it tell you pinged distances for both sensors, etc. It can be a really handy tool for trouble shooting. All you need is some debug statements giving you the right data.

    Walter

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


    Did you find this post helpful? Yes | No

    Default Walter, thanks...

    At the time of that posting last November I did not understand it. Upon rereading I will try it. Where is the modifier "dig" mentioned and defined? I do not see it. Must be in one of the 'include' files. Yes?

    I never figured out how to use the MPLAB debugger. I thought it was only good for simulation running on my PC. I will give it a try.

    thanks again...
    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