PBP projects for R/C models


Closed Thread
Results 1 to 40 of 772

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Since it doesn't have to be exact, you could simplify your code.

    Instead of:
    Code:
    Checkpot:
    adcin PORTA.0, Potread
    write 4, word Potread
    select case Potread
    case Potread < 36
    Forward = 112
    case Potread => 36 and Potread < 73
    Forward = 113
    case Potread => 73 and Potread < 109 
    Forward = 114
    case Potread =>109 and Potread < 146 
    Forward = 115
    case Potread => 146 and Potread < 182 
    Forward = 116
    case Potread => 182 and Potread < 219
    Forward = 117
    case Potread => 219
    Forward = 118
    end select
    write 2, word Forward
    something like:
    8 bit ADC:
    Code:
    Checkpot:
    adcin PORTA.0, Potread
    Potread = Potread/37
    Forward = Potread+112
    10 bit ADC:
    Code:
    Checkpot:
    adcin PORTA.0, Potread
    Forward = Potread/147 + 112
    Last edited by ScaleRobotics; - 2nd September 2010 at 16:15.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Smile Beautiful!!

    I chose your first suggestion:
    Potread = Potread/37
    Forward = Potread+112

    It works beautifully. Tomorrow I shall make a video of my car on blocks in its "going forward" state with me making it go faster and slower by twisting the pot's knob. At least I intend to do that tomorrow.

    THANK YOU!!!

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


    Did you find this post helpful? Yes | No

    Smile Did not work at all as planned....

    Sorry for the delay. I have been discouraged. The new HPI Sprint R/C car has an ESC-15 that thinks for itself. The HPI manufacturing/sales organization refuses to give me the behavioral specs. This is a STEM educational project. Not a by guess and by golly exercise in inductive reasoning.

    One solution is to make an ESC on my solderless proto board. (Complete with cooling fins?)

    My PIC (like the R/C receiver) makes appropriate PWM digital signals. The car wheels want appropriate PWM bi-directional current pulses. Have any of you seen a design I could copy?

    Ken

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


    Did you find this post helpful? Yes | No

    Default How about no speed control

    My PIC already produces quality PWM signal streams. Why can't I put this signal directly to a MOSFET circuit thereby producing a current switched wheel motor driving signal. My pic could use two HPWM's for the wheels. One for forward, the other for backward. It could steer the correct MOSFET signal with a third 'direction' output. Only trouble is I do not know how to detail design what I just typed.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    I don't know how far the zigflea can transmit and receive. But StickOS makes it pretty easy to connect devices that control each other. The first and I think the second video talk about hooking the remote zigflea up.

    Here one piece of hardware you could use:
    http://www.sparkfun.com/commerce/pro...oducts_id=9645

    And pretty soon the ZigFlea should be available for it:
    http://overtone-labs.ning.com/forum/...flea-for-cui32

    I don't know how much room you are left with with StickOs, but you need to get up to PIC32MX4 to use it. The chip has 512K programmable memory and 32K ram.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default This may be a whole new ball game.....

    My cars use the same solderless protoboard as CPUstick uses here:



    On the tail end I have velcro'd the RC radio receiver. There is plenty of room inside the car's outer body to add a horizontal zigflea if I can rig the connection as 0.1" centers.

    I do not understand the above package. How about I start with this from EMCelectronica? It looks like it will plug into my protoboard and not give me stuff I do not need. At ~50EUR it is not inexpensive. Do you think I could put the thing together myself as I have done with the 16F887?



    Ken

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


    Did you find this post helpful? Yes | No

    Default

    Ok, so now we plug the usb cord into the computer, and see what happens. If you have windows 7, there is a .inf file to download first. It's LED's may dance and sing, but you may have to configure that, to let it know where the heartbeat LED is. If you don't have windows 7, and it is not recognized when you plug it in, you might need to download the FTDrivers at http://www.ftdichip.com/FTDrivers.htm

    Check out page 13 of the manual. In your computer, goto the Device Manager screen and see what port gets added to your computer. Should be an extra USB Serial Port (comx). Use hyperterminal or similar program to connect to comx.

    You should get a nice welcome message like on page 14 or so of the manual.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default Windows XP Professional SP3

    My Hyperterminal only gives me COM1, COM3 TCP/IP or dial-a- number access. I see no USB capability. Do I need to buy a COM3 to USB adapter or some kind of driver which fixes my hyperterminal? I did not expect this.

    Ken

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


    Did you find this post helpful? Yes | No

    Default

    I wouldn't worry too much about the "hheelloo". If it was not giving your text errors, it was not communicating with StickOS.

    Here is the code that I believe is in the newer UBW32. http://www.schmalzhaus.com/UBW32/FW/...UBW32_v1_3.hex

    Although, I see a possibly newer and different one here: http://www.schmalzhaus.com/UBW32/FW/UBW32_v1_3/D32.hex

    I have not checked the configs in the hex, but I would have assumed they did not hide the code. I have some doubts is your Pickit2 is really communicating with the UB32.
    Last edited by ScaleRobotics; - 16th October 2010 at 21:19.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default

    Here is some more info about StickOS with some youtube videos by the guy the wrote it. Pretty cool stuff.

    http://www.picbasic.co.uk/forum/show...9397#post89397
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default Just for fun....

    Just for fun, here is a quad copter that does some pretty amazing stunts. I am fond of the one with velcro. I guess it helps if you have your speakers on. It doesn't sounds quite autonomous. The 20 cameras are static in the room.

    Sorry Ken, I just thought it was really cool. These students are older. (And they appear to have a much bigger budget!)



    And through moving hoops

    Last edited by ScaleRobotics; - 13th October 2010 at 20:10.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default Did my .hex do the right thing?

    I WROTE my .hex file into the PIC32. It did not object too much. Now what? Small addresses in the FLASH remained 'FF'. Here's a shot of the transition.

    1D0069C0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
    1D0069D0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
    1D0069E0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
    1D0069F0 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF
    1D006A00 0F401A8E 00000000 0F4073A0 00000000
    1D006A10 1000FFFF 00000000 27BDFFE8 AFBF0010
    1D006A20 40046800 0F402166 00000000 8FBF0010
    1D006A30 03E00008 27BD0018 27BDFFD8 AFBF0020
    1D006A40 AFB3001C AFB20018 AFB10014 AFB00010
    1D006A50 3C0204C4 3451B400 0F4073EA 24130005
    1D006A60 00409021 24030040 3C02BF88 AC432004
    1D006A70 02201821 00008021 3C02FE36 34453C80
    Now What? Does it dance and sing? Do I connect a hyperterminal via an old fashioned USB cable to the provided USB connector? Do I push the RESET button and the PROGRAM button? Any ideas?

    I'm in a bit of a rush. I'll look at your videos later this evening.

    Ken

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


    Did you find this post helpful? Yes | No

    Default More details in, less goose chases out.

    Thanks Ken,

    That's a start! The more information you give me, the easier this will be to trouble shoot. If I have to guess what you are doing, this is going to be pretty slow and painfull. But, here it goes... (I suppose, in a way I deserve it for leading you astray for a day or two).

    There are two possibilities of where you are at, if I were to guess.

    1. You have loaded the firmware from post# 486 into the used UBW32 using your Pickit2, and have now plugged it in with the usb cord to the back of your computer. And now you are looking in the device manager. I am wondering what, if anything occured in the lower right hand part of your computer screen. Did it say new hardware found? Did it try to find a driver, or did it do nothing?

    2. You already tried #1 and have gone to step 2: You switched to the untouched UBW32. You downloaded the microchip driver here and have installed it (like you have mentioned) http://www.sparkfun.com/datasheets/D...C/UBW32inf.zip ,and have plugged the usb cable into it. You have checked to see if you get a "new hardware detected" message.


    You have run the HID Bootloader executable from microchip http://www.cpustick.com/downloads/HIDBootLoader.exe , and you have seen if it can find your UBW32. Then you selected the first firmware I sent you in post#463. This one: StickOS for Microchip PIC32MX4-F512L UBW32 Board Bootloader (v1.80) (.HEX, UBW32 HID bootloader image) with the long name. Let the microchip bootloader try to load the firmware into the untouched one (not even using your PicKit2).

    And now you are looking into your Device Manager, but see no new serial port.




    http://www.scalerobotics.com

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