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 That's a one of...

    Yes, the PBP is not freeware. But from the point of view of a middle school club or group project it is a 'one of'.

    I did not anticipate the complexity of upping the speed of this car and only asking it to follow the wall. This has been a good lesson for me.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    Yes, the PBP is not freeware. But from the point of view of a middle school club or group project it is a 'one of'.
    You may want to read the back cover of your manual.

    Something like this came up before, no group license.
    That is why I get kids started with some basic ASM and/or what they can do with the demo version.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default Oops!!

    I just read the above mentioned Software License.

    I'd rather use LOGO. But that does not seem forthcoming. Hmmm...

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    I would contact MeLabs, maybe they will work a deal with you.
    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

    Default Yes, PID is the ideal.

    Of course you are correct. Classic robotics is error signal driven.

    My problem with PID is my lack of confidence. I do not know the capabilities and limitations of PBP and the 16F887. I have not figured out how to debug the stuff in real time on the bench etc. I have been lazy regarding the 300+ page PIC Owners Manual. I never mastered MPLAB.

    Can you point me to some simple PID code in a familiar language - C or C++ (complete with libraries) for example.

    Ken

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


    Did you find this post helpful? Yes | No

    Default MIne is a state machine...

    My wall following code is state machine code. I am going forward. The right facing sonar tells me a distance. I compare that to constants and to the previous measurement. Given where I am relative to a line parallel to the wall and whether I am getting closer to or farther from the wall, I steer right, left or straight.

    Here's the code:

    Code:
    keepgoingforward: '----Compare to right wall
    IF oldrangeright = rangeright THEN
    HPWM 1,Straight,50
    ENDIF
    
    IF rangeright > outertrack THEN
    HPWM 1,HalfRight,50
    ENDIF
    
    IF rangeright < desiredtrack AND oldrangeright < rangeright THEN
    HPWM 1,Straight,50
    ENDIF 
      
    IF rangeright > desiredtrack AND oldrangeright > rangeright THEN
    HPWM 1,Straight,50
    ENDIF
    
    IF rangeright > desiredtrack AND oldrangeright < rangeright THEN
    HPWM 1,HalfRight,50
    ENDIF
    
    IF rangeright < desiredtrack AND oldrangeright > rangeright THEN
    HPWM 1,HalfLeft,50
    ENDIF
    
    GOTO main
    Given my limitations this seemed the easiest path to take.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    No need to go far away from your PBP lanquage.

    Have a look at Henrik's routines here http://www.picbasic.co.uk/forum/showthread.php?p=54846

    It is not easy as A-B-C but also not too hard to follow. May the difficult part would be to tune the PID parameters.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default I am confused....

    I sort of understand using PID to set a POT value via a DC motor. The feedback is stable and static.

    My robocar needs to stay in a path while moving. The feed back - change in the echo response from the wall - is dynamic and is a function of the car's speed and direction. The PIC is plenty fast. The sonar response is not "dynamic" in this sense. My response delay problem is in the physical reality of the steering mechanism and the physics of car motion.

    Another issue may be that the HPWM signal is not "really" to radio control spec. It is not a 50Hz pulse of width varying between 1msec and 2msec with 256 gradations. The frequency is more than 50 per second. The arguments I use for HPWM I arrived at empirically. I do not have an appropriate oscilloscope to accurately measure what I am producing.

    I need a better understanding of what you are suggesting.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    Hmm, have a look at the videos at YouTube about line followers with and without PID control of the robot.

    Behaviour of non PID is similar to your nervous car. The same robot with PID control slides smooth on the line (or in your case follow the wall in a steady distance).

    Why not give it a try?

    Here is the same robot with and without.

    http://members.jcom.home.ne.jp/felm/ltc_p.mpg
    http://members.jcom.home.ne.jp/felm/ltc_pd.mpg

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