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

    Red face Feeling a bit overwhelmed

    Guys and Gals,

    I might take a side trip to a scenic view along this road.

    Here is a pointer to a BASIC (which BASIC I do not know) program that controls a toy level RC car. Toy levels have no Electronic Speed Control. The DC motor and servo are driven by direct current controlled by four DPDT switches. (Bang-Bang: full speed forward, full stop, full speed back.) This project has only autonomous control. The radio receiver has been eliminated. These simplifications plus the fact that the details are on the WEB make this diversion very tempting.

    http://letsmakerobots.com/files/wall_racers.bas
    and
    http://letsmakerobots.com/node/928

    I have an appropriate RC car.
    I have a spare PICkit2.
    I need to translate wall_racers.bas into PBP.
    I need to adapt the resulting ASM to my 16F887.
    I think I have enough proto. parts for both projects.

    My ego needs a boost.

    Ken:

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


    Did you find this post helpful? Yes | No

    Default

    Ken,

    You are kind, intelligent, and I hear good looking.

    There is your ego boost

    Your new approach does sound like a good way to start. Save the PWM for later and work on the other parts.

    You may want to think about what Bruce said and go "modular". Then when you do get back to the PWM part it could live on a separate chip.

    You said you have some solder-less breadboards, so you could get a few of the 8 or 14 pin chips with ADC to play with. Remember MicrChip has a samples program so you could get three from them to start.
    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

    Talking Lookit this great picture

    On the other hand==>

    Look at this great oscilloscope-like picture of the PWM pulses (fifty per second) very close to 1.75ms long created by Bruce's PAUSEUS technique. I finally figured out the Analyzer part of the PICkit 2 Logic Tool.

    Ken
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kenjones1935 View Post
    On the other hand==>

    Look at this great oscilloscope-like picture of the PWM pulses (fifty per second) very close to 1.75ms long created by Bruce's PAUSEUS technique. I finally figured out the Analyzer part of the PICkit 2 Logic Tool.

    Ken
    Now that's progress! Great job Ken. That a pretty nice looking scope, and the price makes it look even better!

    Now you can see what you are doing .... er (or not doing).

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


    Did you find this post helpful? Yes | No

    Smile It compiles and measures!!

    Fritsl's code compiles and runs on my PICkit2.

    The proximity detector (Devantech SRF05) responds with different size pulses (depending on the distance from it to an echoing object) when queried by this code.

    Next to prove out control of the four DPDT switches which steer DC to the motor and to the servo, destroy the toy car by ripping out its radio receiver. and figure out how to mount the PICkit, the switches board and the two SRF05's.

    Question. Is there any way that I can read through the PICkit programmer what is happening in real time to some of the variables. How do I think about adding debugging code?

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    In case someone wants to measure multiple RC channels with one CCP1 pin, I did a small expermiment. If you connect every other RC receiver channel to CCP pin using 1N914 diodes (or similar), you will be able to measure pulses from three (or four) RC channels using one pin. Without the diodes, the RC channels that are low, ground out the one that is trying to pulse.

    Here is a picture of RC channels 2,4, and 6. Without a channel space between them, they stay high. So, with a PIC that has two CCP pins, you should be able to read all 8 channels!

    This picture shows scope yellow probe (rc 2, 4, and 6) with their diodes attached to the scope probe. and scope red probe directly attached to RC channel 2.

    Attached Images Attached Images  
    Last edited by ScaleRobotics; - 7th February 2010 at 02:18.

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


    Did you find this post helpful? Yes | No

    Lightbulb

    Come to think of it, using one CCP pin, you can decode (however many channels your RC transmitter has - 1). So, using a 6 channel transmitter, you can decode 5 channels using a chip with a single CCP compare pin. To do this, connect RC1, RC3 and RC5 channels from your receiver to the CCP pin with some diodes, and a pulldown resistor. Then capture every transition with capture. The in between pulses are RC channels 2 and 4.

    Now to write some code...

    Attached Images Attached Images  

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