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,132


    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

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

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


    Did you find this post helpful? Yes | No

    Default

    In your case the "pot" signal would be the US Sensors signal. The result of the PID controller would be the steering signal. If the whole system is tuned correclty, the steering would be much more smooth.

    You do not have to mess with the speed of the car at this point. May be later if all are working as expected.

    As for the HPWM, why not use the DT-INTs with a 20ms timer to have it within specs? With 4MHz clock and TMR1 you can produce an interrupt every 20ms (50Hz) and then update the value to PWM module.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default Got it. thanks...

    I need to do some studying - PBP - ASM - 16F887.

    My original purpose for this project was to devise a kit and a collection of lesson plans that might hook middle school students into the thinking and documentation processes common to Science Technology Engineering Math.

    I hoped to give them an insight into, "How things work" this, the 21st, Century.

    Thanks again. I have my work cut out for me.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    Just some thoughts...
    You seem to be very close with your code, the kids are going to love it.

    Have you seen this?
    http://www.picbasic.co.uk/forum/cont...rial-backpacks
    What if you did something similar, a "car backpack" ?
    Then the parameters that the kids need/want to change to make it their own could be done with the demo version of PBP.
    http://melabs.com/pbpdemo.htm
    They would not have to learn the whole car code but learn enough to get started.
    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

    Default Back Pack??

    I do not know the term "back pack".

    Are suggesting that all the students' cars contain standard PBP code (one license). To experiment with sonar calibration and steering reaction time relative to changes in car velocity and 'race' course size each student has a set of definitions that can be downloaded via MPLAB or PIC kit 2 programmer?

    I have learned how to write data in the EEPROM section to be read whenever I hit the READ button. That's all the interaction I have mastered.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    With a serial LCD backpack the chip that runs the LCD is "attached" to the LCD. Parallel LCDs use at least six pins from a MCU so a lot of times the project MCU does not have enough spare pins.
    Use one pin from the project MCU to send data to the LCD MCU serially.

    Are suggesting that all the students' cars contain standard PBP code (one license).
    Yes, base code written by you.

    To experiment with sonar calibration and steering reaction time relative to changes in car velocity and 'race' course size each student has a set of definitions that can be downloaded via MPLAB or PIC kit 2 programmer?
    Yes again, these commands will be downloaded to a second MCU that communicates with the main MCU that you programmed.

    The students will be able to use the free demo version and not be able to "mess up" the main chip.
    Dave
    Always wear safety glasses while programming.

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