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

    You do have oscillations don't you?

    Well, the best way to avoid them is the PID suggested again earlier.

    Give it a try and see the beauty of automatic control. You cannot do it other way.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Smile I added a left hand side sonar sensor

    I think this video does a pretty good job of showing the potential of this PIC controlled car.

    )

    With the three sensors this car might be able to negotiate a true maze.

    What do you think?

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    Ken,

    I think the PIC® drives better than you do

    Looks great!!
    That should really get the kids interested.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default Potential problem with interrupt driven PWM

    I need the correct PWM signals to be going to the wheels (Electronic Speed Control) and to the steering (servo) at all times.

    I have programmed a PAUSE 500 to guarantee sufficient time for the car to back up out of trouble after hitting a wall.

    Am I correct is thinking that since PAUSE 500 is not re-entrant my interrupt driven PWM pulses will not occur for that 1/2 second? The car will not back up as planned.

    I need to turn my PAUSE into a time consuming DO LOOP. True??

    Ken

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


    Did you find this post helpful? Yes | No

    Default Hello again from autonomous-RC-car-negotiating-a-maze land

    Sorry, folks, I've been distracted trying to figure out how to "kit" this "educational tool" (toy). The Microchip PICKit2 board only costs $23.99. It has a small surface mount proto area. I do not understand how to make use of it. I need to mount my Zettler relay and my TI sn7407n plus a bunch of mini EMS connectors for the radio, the three SRF05's the steering servo and the electronic speed control. sssissshhh!

    Today I eliminated the need for channel 3 on the radio system. Which is very good cost-wise. Regular Ready to Race hobby cars come with only two channels on their radios. Adding the third is quite expensive. The PIC can know it is inside a maze given input from three proximity sensors. If there is something close to the right and to the left then it must be in a maze. The first run of this new algorithm showed it flawed. The PIC thinks it is out of the maze when it comes to a corner.

    Back to the drawing board. Any suggestions?
    Ken

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


    Did you find this post helpful? Yes | No

    Default

    Is darkening the maze an option? Then maybe a light sensor would work??
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Question This I'm-in-a-maze automatic detection mechanism is not going well

    My first attempts at toggling between PIC and Radio control automatically have not gone well. I figured that the PIC could know from the proximity sensors that it was inside the maze. There seems to be too many variables.

    If I were to use a light sensor to distinguish, which sensor and at what wave length makes sense. Remember I am imagining the cars to be racing - going fast even in the maze. This set up would be in a middle school gymnasium - a basketball court maybe. If I could imagine making a maze out of BIG cardboard boxes with roofs I could use simple light detection. But I don't see how to make that elaborate a maze. Is there a light detector that does not see ordinary ambient indoor lighting, but does see some kind of special light source? Could I run a string of these light sources the length of the maze? Inversely I could run a string of these light sources outside the maze where the cars would see them.

    Thanks for your attention.

    Ken

  8. #8
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    You do have oscillations don't you?

    Well, the best way to avoid them is the PID suggested again earlier.

    Give it a try and see the beauty of automatic control. You cannot do it other way.

    Ioannis
    Good advice here.

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


    Did you find this post helpful? Yes | No

    Default How about a simple photocell to toggle

    How's this sound. Two 100 watt bulbs inside reflectors. One mounted close to the beginning of the maze and the other at the end of the maze. I think I could get a standard photocell to detect the difference between that light intensity and ambient room level. The rule for the PIC would be, "See the light, TOGGLE."

    Here's the spec for the PHILMORE photocell 10807:

    "A typical use is for switching on lighting after dark. These are also used in alarm systems, exposure meters, flame detectors, opto-couplers etc. This cell has a dark resistance of 5,000 ohms and 300 ohms in bright light (100 cds. or more)."

    If this technique were used in my car an emergency TOGGLE device would be a powerful flashlight.
    What do you think? I have the 10807's. I think I need to experiment. An old fashioned Triplett multimeter should to the trick.

    On the old subject of oscillations. These were oscillations in the motion of the car. They were caused by my not correctly selecting the thresholds on the SRF05 proximity detectors. I felt I solved that.

    The idea of a WHILE WEND loop is a good one. I sort of do that already. The PIC triggers the SRF05's many many times per second. My car continues to do one thing until the three echo pattern changes, then it does something else. If there is a bit of noise in one set of readings, it is smoothed over by the next set coming in a few milliseconds. I do not have an error signal.

    When I first read Ioannis' PID suggestion I thought of a PID system based on position of the servo. My mistake. He is really suggesting that I devise an error signal to minimize. I gotta think more about that.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    The photocell should work, not sending data, just a simple HIGH/LOW..

    Just in case you do not have the link.
    http://www.picbasic.co.uk/forum/showthread.php?t=5874
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Question I'm not doing well w ith the control toggling light sensor

    I'm not getting my analog voltage comparator act together.

    I want the teacher, at race time, to certify that each car will respond correctly to the bright lights at the beginning and end of the maze.
    The photoresister R/C to PIC toggling threshold should be calibrated per car.

    The PICkit2 comes with a built in pot attached to pin RA0. Each car while being exposed to the bright light could have its pot turned with a long handled screw driver (avoiding shadows) to the point that the car's control toggles.

    This translates to a voltage comparison between the input of RA0 and RA1. The photoresister 10807 reduces its resistance in bright light from 5k down to near 500 ohms If I build a voltage divider with a 5k resistor to Vss = 5V and the 10807 to Gnd and attach it to RA1 will that do the trick? It would give the PIC a swing of about 2V not figuring the input impedance of the PIC.

    I've got a some of questions.

    First, does the above make sense?
    Second, do any of you know some PBP code that does a similar comparison?
    Three, I believe I will need to smooth out noise during the transition as the car comes into and leaves the bright light? How would you suggest I do that?

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    First, does the above make sense?
    Yes.
    Second, do any of you know some PBP code that does a similar comparison?
    I do not have any code but here is how I might try setting it up.
    First add a switch on the car and code for the switch at power-up. Also add a LED for calibration indicator.
    If switch is HIGH then ADC_SETUP routine. The code will go here once and never loop back to it.
    Inside the SET_UP routine have the drive wheels turned off and sub loop reading the ADC from the light and the "calibration" pot.
    Have it coded so when the reading from the light and pot are equal with in a certain amount (exact will be difficult) the calibration LED come on.
    Then when the calibration switch is turned off the code will go to EXIT_SETUP. This routine will save the ADC reading from the pot to EEPROM then goto the main program.
    Now the main program will read the EEPROM to get the value to use for light checking. The reason for EEPROM writing is you will only have to "setup" once and not have to do the setup every time the car is turned on. Maze changes do another SET_UP.
    Three, I believe I will need to smooth out noise during the transition as the car comes into and leaves the bright light? How would you suggest I do that?
    Turn to the students and say "SSHHH"

    Are you meaning light noise? If so this is where the ADC needs to be with in a certain amount so a small range of "bright" light will do the triggering. This partwill take some experimentation for car speed and othe on site variables.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default Learn something new every day..

    I took the car to a TV studio today. It was going to be on Access television. I brought the laptop computer and the USB connector. I forgot the battery charger. The car had not been charged for a couple of days. Big mistake.

    At the beginning it did just as I thought I had told it, but then as time went on it crashed more, got stuck more. I chose not to do the TV shoot. It sort of worked, but not quite.

    I think as the battery discharges, even with the 5volt voltage regulator in the electronic speed control box, everything degrades before it finally refuses to move. I know the DC wheel power motor uses lots of juice

    Sound correct to you all?

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